Tsuk1ko / nhentai-helper

🔞 A user script make it easy for you to download nHentai manga as zip (or cbz), also support some mirror sites. 一个可以让你轻松打包下载 nHentai 本子的用户脚本,并支持一些镜像站
https://greasyfork.org/scripts/375992
GNU General Public License v3.0
557 stars 45 forks source link

Option to add artist names to filename #36

Closed Haregata closed 1 year ago

Haregata commented 1 year ago

Something like {{artist}} And maybe if the doujin has more than 3 artists replace it with "various" to not clog the filename

Tsuk1ko commented 1 year ago

This may not work as you think. nHentai don't provide an artist field.

The only way to get the artists is to separate from the title (use regular expression) or get from the artists tag.

Getting from title is unstable, and the text in the artists tag is different from the real artists name.

image

Haregata commented 1 year ago

I have used the nhentai api and it did have a list of artists image Alternatively, getting data from the html tags on doujin's page should also be possible

Tsuk1ko commented 1 year ago

Yes, you are getting artists tag from this api.

image

If you accept that the tag name is slightly different from the real artist name (e.g. lowercase), it's fine.

If there are multiple artists, how do you want to combine them, for example, separated by commas? a, b, c

Haregata commented 1 year ago

Yea, the slight inconsistency with the names shouldn't be a big deal I think the best would be to give an option to select which separator the user wants. Otherwise, just make it commas You are free to judge when you want to draw the line when there are too many artists and simply put a "various" instead Another thing: formatting the names so there are no illegal characters in the filename

image For example, in this one the artist is shown as suga hideo | maa-kun, even though the actual artist name should be just suga hideo Best course of action is probably just remove the unwanted character and let it be saved as suga hideo maa-kun

Haregata commented 1 year ago

Oh and there are doujins with no artists listed I guess none would do, up to you

Tsuk1ko commented 1 year ago

ok