Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instagram: include query parameters in thumbnail URL #31

Merged
merged 2 commits into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/WebThumbnailer/resources/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
"hotlink_allowed": true
},
"rules": {
"image_regex": "<meta property=\"og:image\" content=\"(.*?)(?:\\?.*?)?\"",
"image_regex": "<meta property=\"og:image\" content=\"(.*?)\"",
"thumbnail_url": "${1}"
}
},
Expand Down
12 changes: 8 additions & 4 deletions tests/WebThumbnailer/Finder/QueryRegexFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,10 @@ public function testQueryRegexImgurGallery()
*/
public function testQueryRegexInstagramPicture()
{
$expected = 'https://scontent-cdg2-1.cdninstagram.com/t51.2885-15/sh0.08/e35/p750x750/'
. '14719286_1129421600429160_916728922148700160_n.jpg';
$expected = 'https://scontent-cdg2-1.cdninstagram.com/v/t51.2885-15/e35/'
. '14719286_1129421600429160_916728922148700160_n.jpg'
. '?_nc_ht=scontent-cdg2-1.cdninstagram.com'
. '&_nc_cat=100&_nc_ohc=xWaFFBqAj6wAX_gqYWt&tp=1&oh=dd77c7c72429d2db9ca3666f01c60e60&oe=605B2EDA';
$allRules = DataUtils::loadJson(FileUtils::RESOURCES_PATH . 'rules.json');
$rules = $allRules['instagram']['rules'];
$options = $allRules['instagram']['options'];
Expand All @@ -295,8 +297,10 @@ public function testQueryRegexInstagramPicture()
*/
public function testQueryRegexInstagramProfile()
{
$expected = 'https://scontent-cdg2-1.cdninstagram.com/t51.2885-19/s150x150/'
. '11351823_506089142881765_717664936_a.jpg';
$expected = 'https://scontent-cdg2-1.cdninstagram.com/v/t51.2885-19/s150x150/'
. '11351823_506089142881765_717664936_a.jpg'
. '?_nc_ht=scontent-cdg2-1.cdninstagram.com'
. '&_nc_ohc=US3NCxc_VOcAX-WwNIl&tp=1&oh=2bb367a88e579c411c7c484fcc6b1e3e&oe=605C8165';
$allRules = DataUtils::loadJson(FileUtils::RESOURCES_PATH . 'rules.json');
$rules = $allRules['instagram']['rules'];
$options = $allRules['instagram']['options'];
Expand Down
Loading