File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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文檔
144144 if ( / ^ \s * $ / . test ( item . data ) )
145145 item . parentNode . removeChild ( item ) ;
146146 else hasText = true ;
147-
148- }
147+ } else if ( / ^ ( I | A | S T R O N G | B | F O N T | P ) $ / . test ( item . tagName ) ) hasText = true ;
149148 }
150149 for ( j = content . childNodes . length - 1 ; j >= 0 ; j -- ) {
151150 item = content . childNodes [ j ] ;
177176 continue ;
178177 [ ] . forEach . call ( content . childNodes , function ( item ) {
179178 if ( item . nodeType == 3 ) curNum += item . data . length ;
180- else if ( / ^ ( I | A | S T R O N G | B | F O N T ) $ / . test ( item . tagName ) ) curNum += ( firefox ?item . textContent . length :item . innerText . length ) ;
179+ else if ( / ^ ( I | A | S T R O N G | B | F O N T | P ) $ / . test ( item . tagName ) ) curNum += ( firefox ?item . textContent . length :item . innerText . length ) ;
181180 } ) ;
182181 }
183182 if ( curNum > largestNum ) {
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 && / ^ h t t p / i. test ( aEle . href ) && / P A R T \b | P r o l o g u e | C h a p t e r \s * \d + | 第 .+ [ 章 | 节 | 回 | 卷 | 折 | 篇 | 幕 | 集 ] | ^ 序 $ | 序 \s * 言 | 序 \s * 章 | 前 \s * 言 | 引 \s * 言 | 引 \s * 子 | 摘 \s * 要 | 楔 \s * 子 | 后 \s * 记 | 附 \s * 言 | 结 \s * 语 | [ \d | 〇 | 零 | 一 | 二 | 三 | 四 | 五 | 六 | 七 | 八 | 九 | 十 | 百 | 千 | 万 | 萬 | - ] + ( 、 | ) ) / i. test ( aEle . innerText ) ) {
240+ if ( aEle . href && / ^ h t t p / i. test ( aEle . href ) && / P A R T \b | P r o l o g u e | C h a p t e r \s * \d + | 第 .+ [ 章 | 节 | 回 | 卷 | 折 | 篇 | 幕 | 集 ] | ^ 序 $ | 序 \s * 言 | 序 \s * 章 | 前 \s * 言 | 引 \s * 言 | 引 \s * 子 | 摘 \s * 要 | 楔 \s * 子 | 后 \s * 记 | 附 \s * 言 | 结 \s * 语 | [ \d | 〇 | 零 | 一 | 二 | 三 | 四 | 五 | 六 | 七 | 八 | 九 | 十 | 百 | 千 | 万 | 萬 | - ] + ( 、 | ) | \. ) / i. test ( aEle . innerText ) ) {
242241 list . push ( aEle ) ;
243242 }
244243 }
You can’t perform that action at this time.
0 commit comments