diff --git a/Douban2Piratebay.meta.js b/Douban2Piratebay.meta.js index 6287fdd..eabb28a 100644 --- a/Douban2Piratebay.meta.js +++ b/Douban2Piratebay.meta.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Douban2Piratebay // @namespace https://github.com/bitdust/Douban2Piratebay/ -// @version 0.4 +// @version 0.5 // @description And direct link to piratebay from douban movie page. // @author bitdust // @match https://movie.douban.com/subject/* diff --git a/Douban2Piratebay.user.js b/Douban2Piratebay.user.js index 43a05ab..fe009bb 100644 --- a/Douban2Piratebay.user.js +++ b/Douban2Piratebay.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Douban2Piratebay // @namespace https://github.com/bitdust/Douban2Piratebay/ -// @version 0.4 +// @version 0.5 // @description And direct link to piratebay from douban movie page. // @author bitdust // @match https://movie.douban.com/subject/* @@ -13,10 +13,10 @@ (function() { 'use strict'; - // Your code here... function insertAfter(newNode, referenceNode) { referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); } + var links = document.querySelectorAll ( "#info > a" ); @@ -28,6 +28,7 @@ break; } } + if (imdblink !== null) { var imdbindex = imdblink.innerText; var fragment = document.createDocumentFragment(); @@ -35,7 +36,6 @@ var parent = imdblink.parentElement; var span = imdblink.previousElementSibling.cloneNode(false); span.textContent = "海盗湾链接: "; - span.class = 'pl'; var a = imdblink.cloneNode(true); a.href = 'https://thepiratebay.org/search/' + imdbindex; fragment.appendChild(br);