From 0067f0aae9413ef236f7f480e00dc079b2dccb21 Mon Sep 17 00:00:00 2001 From: "Zane.Y" Date: Sat, 4 Sep 2021 13:51:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=A5=E9=80=82=E9=85=8D?= =?UTF-8?q?=E8=B1=86=E7=93=A3=E6=94=B9=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Douban2Piratebay.user.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Douban2Piratebay.user.js b/Douban2Piratebay.user.js index 63db24c..22cdc11 100644 --- a/Douban2Piratebay.user.js +++ b/Douban2Piratebay.user.js @@ -14,38 +14,40 @@ 'use strict'; function insertAfter(newNode, referenceNode) { - referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); + $(newNode).appendTo(referenceNode); } function addLink(fragment, text, href){ - let a = imdblink.cloneNode(true); + let a = document.createElement("a") a.textContent = text; a.href = href; fragment.appendChild(a); } var links = document.querySelectorAll ( - "#info > a" + "#info" ); - var imdblink = null; - var imdbRe = new RegExp("tt[0-9]{4,}"); + var imdbLink = null; + var imdbindex = null; + var imdbRe=new RegExp(".*?(tt[0-9]{4,})"); for (var i=0; i