Browse Source

Fix Instagram support

master
Les De Ridder 2 years ago
parent
commit
ae2455eef7
1 changed files with 2 additions and 7 deletions
  1. +2
    -7
      background.js

+ 2
- 7
background.js 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)) {


Loading…
Cancel
Save