{"id":14988847,"url":"https://github.com/tsuk1ko/nhentai-helper","last_synced_at":"2026-06-06T08:01:16.238Z","repository":{"id":39909724,"uuid":"163194460","full_name":"Tsuk1ko/nhentai-helper","owner":"Tsuk1ko","description":"🔞 A user script make it easy for you to download nHentai manga as zip (or cbz), also support some mirror sites. 一个可以让你轻松打包下载 nHentai 本子的用户脚本，并支持一些镜像站","archived":false,"fork":false,"pushed_at":"2025-02-19T12:21:55.000Z","size":3374,"stargazers_count":644,"open_issues_count":0,"forks_count":47,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-07T22:07:16.593Z","etag":null,"topics":["cbz","commic","doujinshi","download","manga","nhentai","tampermonkey","userscript","violentmonkey","zip"],"latest_commit_sha":null,"homepage":"https://greasyfork.org/scripts/375992","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tsuk1ko.png","metadata":{"files":{"readme":"README-ZH.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"jindaikirin","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://afdian.net/@jindaikirin"]}},"created_at":"2018-12-26T15:41:00.000Z","updated_at":"2025-04-06T02:50:22.000Z","dependencies_parsed_at":"2023-02-10T10:31:04.794Z","dependency_job_id":"4478b5fa-6e15-4b12-af42-bdebc9ef8df9","html_url":"https://github.com/Tsuk1ko/nhentai-helper","commit_stats":{"total_commits":164,"total_committers":1,"mean_commits":164.0,"dds":0.0,"last_synced_commit":"ec175b9b7e504d71e85c385acb5654f71b11d013"},"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tsuk1ko%2Fnhentai-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tsuk1ko%2Fnhentai-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tsuk1ko%2Fnhentai-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tsuk1ko%2Fnhentai-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tsuk1ko","download_url":"https://codeload.github.com/Tsuk1ko/nhentai-helper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247737788,"owners_count":20987721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cbz","commic","doujinshi","download","manga","nhentai","tampermonkey","userscript","violentmonkey","zip"],"created_at":"2024-09-24T14:17:18.573Z","updated_at":"2026-01-17T23:25:33.166Z","avatar_url":"https://github.com/Tsuk1ko.png","language":"TypeScript","funding_links":["https://ko-fi.com/jindaikirin","https://afdian.net/@jindaikirin"],"categories":[],"sub_categories":[],"readme":"# nHentai 助手\n\n[GitHub](https://github.com/Tsuk1ko/nhentai-helper)\n\n支持 [Tampermonkey](https://www.tampermonkey.net/) 和 [Violentmonkey](https://violentmonkey.github.io/)，不支持也不会支持 Greasemonkey\n\n## 安装\n\n[从 Greasy Fork 安装](https://greasyfork.org/scripts/375992)（由于成人内容，需要登录才能安装）\n\n[从 Sleazy Fork 安装](https://sleazyfork.org/scripts/375992)（不需要登录）\n\n[从 GitHub Release 安装](https://github.com/Tsuk1ko/nhentai-helper/releases/latest/download/script.user.js)\n\n[从 GitHub Pages 安装](https://nhelper.lolicon.app/script.user.js)\n\n## 主要功能\n\n- 为 nHentai 增加 zip (cbz) 打包下载方式，**下载时必须保持页面处于前台**\n- 当你下载了一个之前下载过的**同名**本子时将会弹出提醒，此时你可以选择不下载\n- 本子列表页相关\n  - 支持 pjax，翻页不会中断本子下载\n  - 下载队列功能\n  - 下载过的本子标题会置灰\n  - 标记上次下载过的最新位置\n\n![preview1](https://raw.githubusercontent.com/Tsuk1ko/nhentai-helper/master/docs/preview1.png)\n\n![preview2](https://raw.githubusercontent.com/Tsuk1ko/nhentai-helper/master/docs/preview2.png)\n\n## 设置\n\n![settings](https://raw.githubusercontent.com/Tsuk1ko/nhentai-helper/master/docs/settings.png)\n\n在设置面板中，带星号`*`的设置项需要刷新页面才能生效\n\n- **下载线程数**  \n  如果你觉得下载太慢，可以适当提高线程数，不过你得清楚，挂（一个好一点的）代理才是拯救辣鸡网络的实在方法\n- **在新选项卡打开**  \n  本子详情页会默认变为在新选项卡中打开，如果不喜欢就关掉它\n- **压缩文件名**  \n  默认是`{{japanese}}.zip`，可自定义下载下来的压缩文件的文件名，包括扩展名，比如`{{english}}.cbz`  \n  如果压缩文件名中含有文件名非法字符则会自动被替换成空格，你也可以利用「标题替换」设置进行自定义替换  \n  支持的占位符：  \n  - `{{english}}` - 本子英文名\n  - `{{japanese}}` - 本子日文名\n  - `{{pretty}}` - 本子英文简略标题\n  - `{{id}}` - 本子 ID\n  - `{{pages}}` - 本子页数\n  - `{{artist}}` - 作者 tag\n    - 最大数量：默认 `3`，`0` 代表不限制，超出将变为“various”，可在设置中修改\n    - 分隔符：默认 `, `，可在设置中修改\n- **压缩等级**  \n  范围为`0-9`，`0`是无压缩，`1`是最快压缩，`9`是最好压缩，默认为`0`  \n  其实对于本子，`0`和`9`压出来的文件大小差别通常不到 **1%**\n- **文件名长度**  \n  图片文件名小于这个长度时会自动补 0，可以避免某些场景下只按字符串排序所导致的排序混乱问题\n- **转换 webp 为**  \n  nHentai 已经陆续开始启用 webp 格式的图片，若你的图片查看器或漫画阅读器不支持 webp 格式，则可以设置该项将 webp 转换为 jpg 或 png  \n  该设置项默认开启，默认转换为 85% 质量的 jpg\n- **移除广告页**  \n  尝试检测并移除广告页，原理是检测页面上是否存在广告二维码，正常网址的二维码例如 fanbox 不会被判定为广告  \n  主要代码来自 [hymbz/ComicReadScript](https://github.com/hymbz/ComicReadScript)，感谢如此出色的项目，相关代码以 [AGPL-3.0](https://github.com/hymbz/ComicReadScript/blob/master/LICENSE) 开源\n- **自动取消下载过的本子**  \n  当你下载了一个之前下载过的**同名**本子时将会自动取消下载，而不是弹出选择对话框\n- **发生错误时自动重试**  \n  当错误发生时自动重试，而不是弹出选择对话框\n- **自动显示全部**  \n  本子详情页自动帮你点击“Show all”按钮\n- **显示忽略按钮**  \n  会显示一个忽略按钮，能让你手动标记或取消标记这个本子为已下载的\n- **右击预览**  \n  在本子列表页右击本子可以直接预览本子信息和内容缩略图\n- **用标题判断本子是否下载过**  \n  你可以指定用来判断本子是否下载过所使用的标题，如果全不选则可以关闭提醒本子下载过的功能；需要注意 `简略` 在大部分镜像站是无效的\n- **已下载本子的标题颜色**  \n  自定义已下载本子的标题颜色\n- **添加元数据文件**  \n  目前支持添加这些元数据文件：\n  - ComicInfo.xml (v2.1 from [anansi-project/comicinfo](https://github.com/anansi-project/comicinfo))\n  - info.json (eze 样式，不保证能正常工作)\n\n  若添加 ComicInfo.xml 则需要指定标题语言（英语或日语）\n\n### 进阶设置\n\n- **nHentai 下载节点**  \n  可以切换下载 nHentai 图片的节点，仅在 nHentai 有效  \n  目前 nHentai 各 CDN 间并不完全同步，建议维持“自动”\n- **自定义下载地址**  \n  一般情况下不需要填写这个，除非有特殊需求，或者脚本无法在镜像站上自动获取图片下载地址  \n  提供一个包含以下占位符的 URL：\n  - `{{mid}}` - Media ID\n  - `{{index}}` - 页号\n  - `{{ext}}` - 图片扩展名\n\n  例如你自行找到的图片地址为这样的形式 `https://example.com/galleries/123456/1.jpg`  \n  那么自定义下载地址通常为 `https://example.com/galleries/{{mid}}/{{index}}.{{ext}}`\n- **压缩 \"streamFiles\" 选项**  \n  启用这个选项可以减少内存消耗，但可能导致某些压缩软件不支持生成的压缩文件，详见[说明](https://stuk.github.io/jszip/documentation/api_jszip/generate_async.html#streamfiles-option)\n- **串行模式**  \n  启用这个选项可以使下载和压缩变为串行任务以减少内存消耗  \n  如果经常出现 `RangeError: Array buffer allocation failed` 错误，可以尝试启用它\n- **流式下载**  \n  利用 [StreamSaver.js](https://github.com/jimmywarting/StreamSaver.js) 直接下载压缩流来减少内存占用  \n  在 Safari 和 Firefox 上无法使用，且下载速度**极慢**，因此不推荐启用除非真的有内存消耗问题\n- **阻止控制台清空**  \n  只在 nHentai 官方站点可用（需要），当你需要提交控制台日志来定位问题的时候请启用它\n- **标题替换**  \n  可以对压缩文件名中的标题进行字符替换，支持正则表达式\n- **自定义文件名函数**  \n  你可以编写一个 JavaScript 函数来自定义最终的压缩文件名  \n  该函数必须返回一个非空字符串，否则脚本会抛出错误  \n  该函数接受两个参数\n  - `filename` - 原始文件名字符串，由 *压缩文件名* 和 *标题替换* 作用得到\n  - `gallery` - 本子信息对象，[查看定义](https://github.com/Tsuk1ko/nhentai-helper/blob/df00acb0d5ad8244d408561410b3c647d5af7ed4/src/utils/nhentai.ts#L57-L75)\n\n## 其他功能\n\n### 镜像站支持\n\n该脚本支持部分镜像站，具体见脚本的 `@match` 与 `@include`\n\n如脚本没有在你使用的域名上运行，可自行将网址加入 *用户匹配*（脚本编辑-设置-包括/排除-用户匹配-添加）\n\n并不是所有镜像站都支持，脚本仅支持跟 nHentai 官方站点使用同一套 UI（页面结构、元素类名基本一致）的镜像站，不符合的站点不支持\n\n在镜像站使用时，可能会弹出“一个用户脚本试图访问跨源资源”的提示，请选择“**总是允许此域名**”或“**总是允许全部域名**”\n\n![connect](https://raw.githubusercontent.com/Tsuk1ko/nhentai-helper/master/docs/connect.zh.png)\n\n### 筛选\n\n你可以在导航栏的此处进行筛选，语言之间为“或”，其他为“且”\n\n![filter](https://raw.githubusercontent.com/Tsuk1ko/nhentai-helper/master/docs/filter.zh.png)\n\n### 100% 视图高度\n\n在线阅读时可开启或关闭，只在第三方镜像站生效，nHentai 官方已经有这个功能了\n\n![viewMode](https://raw.githubusercontent.com/Tsuk1ko/nhentai-helper/master/docs/viewMode.png)\n\n## 推荐脚本\n\n- [Super-preloader](https://github.com/machsix/Super-preloader)  \n  支持在本子列表页无限下拉翻页\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsuk1ko%2Fnhentai-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsuk1ko%2Fnhentai-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsuk1ko%2Fnhentai-helper/lists"}