Fix Instagram support
This commit is contained in:
parent
c76b5016ae
commit
ae2455eef7
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue