Fix Instagram support
This commit is contained in:
parent
c76b5016ae
commit
ae2455eef7
|
@ -108,16 +108,11 @@ function getBetterUrl(url, callback) {
|
||||||
callback(url);
|
callback(url);
|
||||||
} else if(isInstagramUrl(url)) {
|
} else if(isInstagramUrl(url)) {
|
||||||
var request = new XMLHttpRequest();
|
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 () {
|
request.onload = function () {
|
||||||
var json = JSON.parse(request.responseText);
|
var json = JSON.parse(request.responseText);
|
||||||
|
|
||||||
var filename = json.thumbnail_url.substr(json.thumbnail_url.lastIndexOf('/') + 1);
|
callback(json.graphql.shortcode_media.display_url);
|
||||||
filename = filename.substr(0, filename.indexOf('?'));
|
|
||||||
|
|
||||||
var baseurl = 'https://scontent-amt2-1.cdninstagram.com/';
|
|
||||||
|
|
||||||
callback(baseurl + '/' + filename);
|
|
||||||
};
|
};
|
||||||
request.send();
|
request.send();
|
||||||
} else if(isPixivUrl(url)) {
|
} else if(isPixivUrl(url)) {
|
||||||
|
|
Loading…
Reference in New Issue