Coder Social home page Coder Social logo

tsuk1ko / nhentai-helper Goto Github PK

View Code? Open in Web Editor NEW
510.0 13.0 45.0 2.82 MB

🔞 A user script make it easy for you to download nHentai manga as zip (or cbz), also support some mirror sites. 一个可以让你轻松打包下载 nHentai 本子的用户脚本,并支持一些镜像站

Home Page: https://greasyfork.org/scripts/375992

License: GNU General Public License v3.0

JavaScript 4.12% HTML 0.46% TypeScript 76.73% Vue 17.75% Less 0.94%
nhentai cbz download manga tampermonkey userscript violentmonkey zip commic doujinshi

nhentai-helper's Introduction

nHentai Helper

中文说明

GitHub

Support Tampermonkey and Violentmonkey. Not and will not support Greasemonkey.

Installation

Via Greasy Fork (login required due to adult content)

Via Sleazy Fork (no login required)

Via GitHub Pages

Main features

  • You can download manga as zip (or cbz). You must keep the page in the foreground when downloading.
  • You will be warned when you are going to download an already downloaded manga.
  • For manga list page:
    • Add pjax support. Changing pages will not interrupt downloads.
    • Download queue support.
    • The caption of downloaded manga will be marked with grey color.

preview1

preview2

Settings

settings

  • Download thread
    If you think the download speed is too slow, you can try to increase the number of download threads from this setting.

  • Open on new tab
    Gallery page will be open on a new window by default, turn off it if you don't like it.

  • Compression filename
    Default is {{japanese}}.zip. You can custom the naming of downloaded compression file, including the file extension, such as {{english}}.cbz.
    If the compressed filename contains illegal characters, they will be automatically replaced with spaces. You can also use the Title replacement setting to perform custom replacement.
    Available placeholders:

    • {{english}} - English name of manga
    • {{japanese}} - Japanese name of manga
    • {{pretty}} - English simple title of manga
    • {{id}} - Gallery ID
    • {{pages}} - Number of pages
    • {{artist}} - Artist tags of manga
      • Maximum number: The default is 3, exceeding will become "various". Can be modify in settings. 0 means infinity.
      • Separator: The default is , . Can be modify in settings.
  • Compression level
    Accept a numer in 0-9, default is 0.
    0 means "no compression", 1 means "best speed", 9 means "best compression".
    Actually, for manga, compression output size of 0 and 9 usually differ by less than 1%.

  • Filename length
    Zeros will be padded to the start of image filename when its length lower than the value you specified. This can avoid the sorting confusion caused by sorting only by string in some cases.

  • Auto cancel downloaded manga
    When you are going to download an already downloaded manga, it will be canceled automatically instead of pop-up a confirmation box.

  • Auto retry when error occurs
    Automatically retry when an error occurs, instead of pop-up a confirmation box.

  • Auto show all
    Help you to click the "Show all" button on manga detail page automatically.

  • Show ignore button
    Show an button that allow you to mark or unmark the manga as downloaded.

  • Judge downloaded manga by title
    You can specify the title used to judge whether the manga has been downloaded. If nothing selected, the script will never warn you when a manga has been downloaded.
    Note that Pretty is not available in most mirror sites.

  • Add metadata file
    These metadata files is currently supported:

    If you choose to add ComicInfo.xml, you need to specify the title language (english or japanese).

Advance Settings

  • nHentai download host
    Choose a host for downloading nHentai images. Only available on nHentai.
  • Custom download URL
    WARNING: Please don't set this if you don't know what it does.
    Provide a URL containing the following placeholder:
    • {{mid}} - Media ID
    • {{index}} - Page index, starting from 1
    • {{ext}} - Image file extension
  • Compression "streamFiles"
    Enable this option will use less memory but some program might not support the generated zip file.
    See here for more information.
  • Series mode
    Enable this option will make downloading and compression become series tasks but not parallel to reduce memory usage.
    If RangeError: Array buffer allocation failed occurs frequently, you can try to enable it.
  • Stream download
    Use StreamSaver.js to download zip stream to reduce memory usage.
    But this not work on Safari and Firefox, and the download process is extremely slow. So not recommended unless you really have memory usage issues.
  • Prevent console clearing
    Only available on nHentai official site. It is useful when you need to submit console log for debugging.
  • Title replacement
    Character replacement can be performed on the title in the compressed filename, and regular expressions are supported.

Other features

nHentai mirror sites support

This script also support some nHentai mirror sites. See the script's @match and @include.

If the script does not run on some domains, you can add them to User matches.

When you are on a mirror site, a prompt "A userscript wants to access a cross-origin resource" may pop up, please select "Always allow domain" or "Always allow all domain".

connect

Language filter

You can select a language in the navigation bar to filter mangas.

langFilter

100% view height

Effective when reading online, only for mirror sites (now nHentai official site already has this feature).

viewMode

Recommended scripts

  • Super-preloader
    A userscript for auto loading paginated web pages. It will join pages together, which is useful on manga list page.

nhentai-helper's People

Contributors

tsuk1ko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nhentai-helper's Issues

Script suddenly stopped working

Been using nHentai Helper for years, never a single issue. I just realized the download generates an error, and that's in 100% of cases. I just hit the 'Download' button, looks like it tries to do something, then the text on the button itself becomes 'Error'.

No recent changes in configuration (macOS, Firefox [currently version 117], Tampermonkey) or settings.

Snap_20230907-131237

I can provide extra info if needed, thanks.

[Feature Request] Replace a specific special character with a custom valid character

An option to replace "|" the japanese/romaji and english title separator with "-" instead of making it blank like this " " or removing the created extra spaces altogether.

for example:
[Input] English title | Romaji title ---> [Output] English title - Romaji title
(instead of it being like this "[Output] English title Romaji title" or this "[Output] English title(2 spaces)Romaji title")

not all special characters should be replace with "-" like ":" (so it would be "Title: Another title" ---> "Title Another title"), only this "|" separator should be changed.

you can use these for testing:
https://nhentai.net/g/504598/
https://nhentai.net/g/504561/
https://nhentai.net/g/257326/

i.nhentai.net:443下载缓慢

04.19日,从i.nhentai.net来源下载漫画变得十分缓慢(只有50-70KB).在油猴的脚本编辑页里手动将所有的i.nhentai.net改为i3.nhentai.net后下载恢复了,不知道是不是网站本身的问题。
大大也许可以把i3.nhentai.net作为一个低速时的备选链接或者切换选项?以下是截图。
这是使用i.nhentai.net时的下载速度
image
这是使用i3.nhentai.net时的下载速度
image

能否增加 自动取消下载过的本子 的识别范围

新年快乐。

在使用中注意到自动取消的识别似乎只针对一种“语言”,不知道能不能将识别的范围扩大到包含同一本书的其他语言译本。

比如下图同一语言的同一本会判定为已下载,并自动取消
屏幕截图 2023-01-06 184535
而对于不同语言的同一本则会重复下载
屏幕截图 2023-01-06 184528
是否能够在下载时,让图2的也能像图1一样识别并取消下载?

期待你的回复。

希望改变一下命名方式

现在的命名方式是1.jpg、2.jpg、3.jpg.......10.jpg、11.jpg,在电脑上显示正常,
但是在我的群晖nas或是ios上排序就会变成1.jpg、10.jpg、11.jpg、2.jpg、20.jpg......3.jpg、4.jpg,类似的排列错误,每次下好本子之后都要一个一个重新命名,
希望下载的默认文件名能变成0001.jpg、0002.jpg、0003.jpg......0010.jpg、0011.jpg类似这样的前面加几个零来避免,
插件很方便,我就指望这个插件来下本子了,希望能看到

Page download.

Is it possible to add a feature where you can download N-number of pages of a certain tag or search query?
If not, question, is there any way to either download the entire manga from the currently open page?

What url does it download from?

Hello,

I am trying to use this script with Download Router for Chrome where based on the domain, it puts the downloaded ZIP in a specific folder. I am using the domain nhentai.net right now but that's not working so I don't think that is the domain that this script downloads from. Any help would be appreciated. Thanks!

语言过滤器问题

大佬你好,感谢你的脚本让我能够方便地浏览nhentai,我在使用过程中发现一些小bug,以及有一个小请求,希望能得到你的帮助

1.语言过滤器选择中文后,进入某漫画详情页,再从此处选择某标签或者选择作者进入二级菜单,语言过滤器并没有记住中文选择

2.由于安装过多的nhentai脚本,且某些脚本只会用到某一个功能,我想将其整合为一个脚本为个人所用。对于nhentai-helper,语言过滤器十分好用,我想将这个功能代码单独提取出来,奈何水平有限无法做到(文科生),请问大佬能够帮忙提取一下吗?无论怎样,都先谢谢大佬了。

[Feature Request] 手动标记漫画的“已下载”状态

场景:

  • 大量重复的漫画(譬如不同的字幕组、不同的翻译),由于标题不一致,会导致【置灰】效果无法命中,可能会导致部分漫画重复下载
  • 此时需要有一个功能 手动标记【已下载】状态

功能点:

  • 列表页 每个漫画的下载按钮右侧 添加按钮【标记为“已下载”】(或叫【忽略】)
  • 漫画详细页 下载按钮右侧 添加按钮【标记为“已下载”】(或叫【忽略】)

搭配自动翻页插件时过滤失效

如题 列表页自动翻页后 后续页面的过滤功能就失效了

我尝试
$('#lang-filter').change()执行时再运行一次 $('.gallery').each() 不完美解决(需手动触发change),不造作者大大有没有建议 :)

能否添加自动重试功能

在网络不太流畅的时候(大概),总是会反复出现是否重试的按钮,能否设置自动重试,以及重复队列那个功能自动取消下载。

how to setup

解壓縮後將[script.user]丟入Edge的擴充插件裡並開啟後,nhentai沒有出現任何改變。
想請教從安裝到設置的完整步驟。謝謝
After decompressing and throwing [script.user] into the extension plug-in of Edge and opening it, there is no change in nhentai.
Would like to ask the complete steps from installation to setup. Thanks

详情页内下载功能无法使用

chrome:76.0.3809.132
Tampermonkey:4.8.41
script:2.0.0
具体表现为设置多少线程就卡几张图片
image
实际上我也没看到有nhentai相关的数据传输

关于镜像站的一些问题

请问像nyahentai这种网站,您的脚本是否还是可以下载?我在nya上面没有看到下载方式但是脚本显示已经运行了

经常下载出错无法取消或删除

4DM )6M~$V2$40K0_W{8BBL
$SVMCAR}BGCHHTM}M7NPYN8
如图,经常会出现下载打包100%后卡住不动的情况
此时无法取消或删除任务,并且出现这种情况的时候刷新也无法解决,只能完全关闭当前标签页
下载过程中的任务无法单击一次就取消,需要连续不断的点×直至任务取消

Select page (feature request)

Coud you add something that sort the images number to something like this: 001.png , 002.png, ... ,100.png and so on. (Since I'm using ComicRack to read, if the image contain one number it will mess up the file order...)

And if possible a feature that download selected images would be nice, like download: 109.png - 125.png only.

【说明】目前 violentmonkey 无法在 nhentai 上运行任何非 @run-at document-start 的脚本

nhentai 在其页面 js 中将Date类进行了封装

这一操作的后果就是Date.now()方法没了,而 violentmonkey 在注入脚本的时候恰好会用到这一方法,应该是取时间戳做 ID 之类的,结果就会出错

也就是说目前所有的站点都可以通过删除Date.now()方法来反 violentmonkey

@run-at document-start虽然可以避免注入出错,但会对脚本逻辑造成影响,而且我改了很久也没能让它正常的跑起来,要不然就还是会出Date.now()错误

小建议

希望能将前九个图片的编号前面加上0 (例如第二张 2.jpg 变成02.jpg). 不然有的时候系统排序会混乱

[Feature Request] 导入导出 IndexedDB 中存储的数据

场景:

  • 用于手动 跨浏览器同步、备份 等目的

功能点:

  • 油猴脚本的设置项中添加操作【导入已下载本子的数据】
    • 导入 是否为 全量地覆盖所有本地数据,还是 增量地 merge 已有数据
    • 视情况,可能还需要额外添加第三个操作【清空所有本地数据】
  • 油猴脚本的设置项中添加操作【导出已下载本子的数据】

Imhentai support

Could you make the same extension, just for Imhentai? It's just more convenient in terms of finding "content" and I would like to be able to download from it more conveniently. Yes it has an official download, but it only works with an account and by timeout, which is not very nice

无法下载最后一页

我不知道为什么但是本子最后一页总是不见
如果是有意设置建议加个可选项

crash while metadata contains "&"

& is illegal in xml context and will crash the process.

crash in line 41534

el.innerHTML = String(value);

mitigation measures can be the code as follow:

      if (!isNil(value)) {
        let regex = /^.*\&.*$/
        if (regex.test(value)) {
          value = value.replace(/\&/, " and ")
          el.innerHTML = String(value);
        } else {
          el.innerHTML = String(value);
        }
      }

expected formal fix of the program

zh-cn:

&在xml中会被错误的转义,通过添加一些判断可以缓解这一错误,临时缓解代码如上,期待正式的修复。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.