Skip to content

Commit 03e1de8

Browse files
committed
for yueloo
1 parent 1d248c3 commit 03e1de8

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

DownloadAllContent/DownloadAllContent.user.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// @name:zh-TW 懶人小説下載器
55
// @name:ja 怠惰者小説ダウンロードツール
66
// @namespace hoothin
7-
// @version 1.20
7+
// @version 1.21
88
// @description Fetch and download main content on current page, provide special support for chinese novel
99
// @description:zh-CN 通用网站内容抓取工具,可批量抓取小说、论坛内容等并保存为TXT文档
1010
// @description:zh-TW 通用網站內容抓取工具,可批量抓取小說、論壇內容等並保存為TXT文檔
@@ -144,8 +144,7 @@
144144
if(/^\s*$/.test(item.data))
145145
item.parentNode.removeChild(item);
146146
else hasText=true;
147-
148-
}
147+
}else if(/^(I|A|STRONG|B|FONT|P)$/.test(item.tagName))hasText=true;
149148
}
150149
for(j=content.childNodes.length-1;j>=0;j--){
151150
item=content.childNodes[j];
@@ -177,7 +176,7 @@
177176
continue;
178177
[].forEach.call(content.childNodes,function(item){
179178
if(item.nodeType==3)curNum+=item.data.length;
180-
else if(/^(I|A|STRONG|B|FONT)$/.test(item.tagName))curNum+=(firefox?item.textContent.length:item.innerText.length);
179+
else if(/^(I|A|STRONG|B|FONT|P)$/.test(item.tagName))curNum+=(firefox?item.textContent.length:item.innerText.length);
181180
});
182181
}
183182
if(curNum>largestNum){
@@ -238,7 +237,7 @@
238237
var aEles=document.querySelectorAll("a"),list=[];
239238
for(var i=0;i<aEles.length;i++){
240239
var aEle=aEles[i];
241-
if(aEle.href && /^http/i.test(aEle.href) && /PART\b|Prologue|Chapter\s*\d+|.+[|||||||]|^$|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|\s*|[\d|||||||||||||||||-]+(|)/i.test(aEle.innerText)){
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*|[\d|||||||||||||||||-]+(||\.)/i.test(aEle.innerText)){
242241
list.push(aEle);
243242
}
244243
}

0 commit comments

Comments
 (0)