Skip to content

Commit 0f9ac83

Browse files
committed
for yuzhaiwu
1 parent e04e42a commit 0f9ac83

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

DownloadAllContent/DownloadAllContent.user.js

Lines changed: 4 additions & 4 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.21
7+
// @version 1.22
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,7 +144,7 @@
144144
if(/^\s*$/.test(item.data))
145145
item.parentNode.removeChild(item);
146146
else hasText=true;
147-
}else if(/^(I|A|STRONG|B|FONT|P)$/.test(item.tagName))hasText=true;
147+
}else if(/^(I|A|STRONG|B|FONT|P|DL|DD|H\d)$/.test(item.tagName))hasText=true;
148148
}
149149
for(j=content.childNodes.length-1;j>=0;j--){
150150
item=content.childNodes[j];
@@ -176,7 +176,7 @@
176176
continue;
177177
[].forEach.call(content.childNodes,function(item){
178178
if(item.nodeType==3)curNum+=item.data.length;
179-
else if(/^(I|A|STRONG|B|FONT|P)$/.test(item.tagName))curNum+=(firefox?item.textContent.length:item.innerText.length);
179+
else if(/^(I|A|STRONG|B|FONT|P|DL|DD|H\d)$/.test(item.tagName))curNum+=(firefox?item.textContent.length:item.innerText.length);
180180
});
181181
}
182182
if(curNum>largestNum){
@@ -237,7 +237,7 @@
237237
var aEles=document.querySelectorAll("a"),list=[];
238238
for(var i=0;i<aEles.length;i++){
239239
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*|[\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*|\s*|[\d|||||||||||||||||-]+(||\.)/i.test(aEle.innerText)){
241241
list.push(aEle);
242242
}
243243
}

0 commit comments

Comments
 (0)