Fix Instagram support

This commit is contained in:
Les De Ridder 2018-05-04 02:09:51 +02:00
parent c76b5016ae
commit ae2455eef7
1 changed files with 2 additions and 7 deletions

View File

@ -108,16 +108,11 @@ function getBetterUrl(url, callback) {
callback(url);
} else if(isInstagramUrl(url)) {
var request = new XMLHttpRequest();
request.open('GET', 'https://api.instagram.com/oembed/?callback=&url=' + url, true);
request.open('GET', cleanExtension(url) + '?__a=1', true);
request.onload = function () {
var json = JSON.parse(request.responseText);
var filename = json.thumbnail_url.substr(json.thumbnail_url.lastIndexOf('/') + 1);
filename = filename.substr(0, filename.indexOf('?'));
var baseurl = 'https://scontent-amt2-1.cdninstagram.com/';
callback(baseurl + '/' + filename);
callback(json.graphql.shortcode_media.display_url);
};
request.send();
} else if(isPixivUrl(url)) {