Skip to content

Commit 7bdf6d2

Browse files
committed
Update DownloadAllContentSavaAsZIP.user.js
1 parent 5b3db53 commit 7bdf6d2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

DownloadAllContent/DownloadAllContentSavaAsZIP.user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @name:zh-CN 怠惰小说下载器 ZIP 扩展
44
// @name:zh-TW 怠惰小説下載器 ZIP 擴充
55
// @namespace hoothin
6-
// @version 0.1
6+
// @version 0.2
77
// @description Save content as ZIP for DownloadAllContent
88
// @description:zh-CN 下载时分章节保存 TXT 并打包为 ZIP
99
// @description:zh-TW 下載時分章節儲存 TXT 並打包為 ZIP
@@ -36,7 +36,7 @@
3636
let catTitle = cat.match(/.*?\r\n/);
3737
if (!catTitle) return;
3838
catTitle = catTitle[0].trim();
39-
zip.file(index++ + " - " + catTitle.replace(/[\*\/:<>\?\\\|\r\n]/g, "") + ".txt", cat.replace(catTitle, "").trim());
39+
zip.file(index++ + " - " + catTitle.replace(/[\*\/:<>\?\\\|\r\n]/g, "").slice(0, 50) + ".txt", cat.replace(catTitle, "").trim());
4040
});
4141
zip.generateAsync({type: "blob", compression: "DEFLATE"}, meta => {zipTips.innerText = "percent: " + ((meta && meta.percent && meta.percent.toFixed(2)) || "100") + "%"}).then(function(content){
4242
callback(content);

0 commit comments

Comments
 (0)