Skip to content

Commit ce07edd

Browse files
committed
fix
1 parent 0f9ac83 commit ce07edd

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

DownloadAllContent/DownloadAllContent.user.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,16 @@
236236
function fetch(){
237237
var aEles=document.querySelectorAll("a"),list=[];
238238
for(var i=0;i<aEles.length;i++){
239-
var aEle=aEles[i];
240-
if(aEle.href && /^http/i.test(aEle.href) && /PART\b|Prologue||Chapter\s*\d+|.+[|||||||]|^$|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|[\d|||||||||||||||||-]+(||\.)/i.test(aEle.innerText)){
239+
var aEle=aEles[i],has=false;
240+
for(var j=0;j<list.length;j++){
241+
if(list[j].href==aEle.href){
242+
list.splice(j,1);
243+
list.push(aEle);
244+
has=true;
245+
break;
246+
}
247+
}
248+
if(!has && aEle.href && /^http/i.test(aEle.href) && /PART\b|Prologue||Chapter\s*\d+|.+[|||||||]|^$|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|[\d|||||||||||||||||-]+(||\.)/i.test(aEle.innerText)){
241249
list.push(aEle);
242250
}
243251
}

0 commit comments

Comments
 (0)