Merge pull request #2 from chickenPopcorn/master
add support for more sites
This commit is contained in:
commit
819f24eff3
|
@ -22,25 +22,33 @@
|
||||||
);
|
);
|
||||||
var imdblink = null;
|
var imdblink = null;
|
||||||
var imdbRe = new RegExp("tt[0-9]{4,}");
|
var imdbRe = new RegExp("tt[0-9]{4,}");
|
||||||
for (var i=0;i<links.length;i++) {
|
for (var i=0; i<links.length; i++) {
|
||||||
if(imdbRe.test(links[i].textContent)) {
|
if(imdbRe.test(links[i].textContent)) {
|
||||||
imdblink = links[i];
|
imdblink = links[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (imdblink !== null) {
|
function addLink(name, href){
|
||||||
var imdbindex = imdblink.innerText;
|
let imdbindex = imdblink.innerText;
|
||||||
var fragment = document.createDocumentFragment();
|
let fragment = document.createDocumentFragment();
|
||||||
var br = document.createElement("br");
|
let br = document.createElement("br");
|
||||||
var parent = imdblink.parentElement;
|
let parent = imdblink.parentElement;
|
||||||
var span = imdblink.previousElementSibling.cloneNode(false);
|
let span = imdblink.previousElementSibling.cloneNode(false);
|
||||||
span.textContent = "海盗湾链接: ";
|
span.textContent = name + "链接: ";
|
||||||
var a = imdblink.cloneNode(true);
|
let a = imdblink.cloneNode(true);
|
||||||
a.href = 'https://thepiratebay.org/search/' + imdbindex;
|
a.textContent = "下载";
|
||||||
|
a.href = href + imdbindex;
|
||||||
fragment.appendChild(br);
|
fragment.appendChild(br);
|
||||||
fragment.appendChild(span);
|
fragment.appendChild(span);
|
||||||
fragment.appendChild(a);
|
fragment.appendChild(a);
|
||||||
insertAfter(fragment, imdblink);
|
insertAfter(fragment, imdblink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (imdblink !== null) {
|
||||||
|
addLink("电影天堂", 'http://www.btrr.net/tag/');
|
||||||
|
addLink("HD湾", 'http://www.hdwan.net/?s=');
|
||||||
|
addLink("RARGB", 'https://rarbgmirror.com/torrents.php?imdb=');
|
||||||
|
addLink("海盗湾", 'https://thepiratebay.org/search/');
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue