Merge pull request #2 from chickenPopcorn/master

add support for more sites
This commit is contained in:
bitdust 2017-06-06 13:03:36 +08:00 committed by GitHub
commit 819f24eff3
1 changed files with 18 additions and 10 deletions

View File

@ -29,18 +29,26 @@
}
}
if (imdblink !== null) {
var imdbindex = imdblink.innerText;
var fragment = document.createDocumentFragment();
var br = document.createElement("br");
var parent = imdblink.parentElement;
var span = imdblink.previousElementSibling.cloneNode(false);
span.textContent = "海盗湾链接: ";
var a = imdblink.cloneNode(true);
a.href = 'https://thepiratebay.org/search/' + imdbindex;
function addLink(name, href){
let imdbindex = imdblink.innerText;
let fragment = document.createDocumentFragment();
let br = document.createElement("br");
let parent = imdblink.parentElement;
let span = imdblink.previousElementSibling.cloneNode(false);
span.textContent = name + "链接: ";
let a = imdblink.cloneNode(true);
a.textContent = "下载";
a.href = href + imdbindex;
fragment.appendChild(br);
fragment.appendChild(span);
fragment.appendChild(a);
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/');
}
})();