RicterZ / nhentai

nhentai doujinshi downloader
http://nhentai.net
MIT License
846 stars 120 forks source link

Title being cut #336

Closed myussu closed 2 months ago

myussu commented 2 months ago

I already have some folders created from manually downloading mirrors so i wanted to format the new downloads in a way i wouldn't create a duplicate, however it seems that when a title is too long it is being shortened followed by 3 dots at the end. I was wondering if there was a way to write the whole name without it being shortened in the folder.

JasonWS123 commented 2 months ago

In _get_title_and_id(), you can edit this to remove the file name limiter that cuts off the title after 85th character and replaces the rest with ... title = title if len(title) < 85 else title[:82] + '...'

myussu commented 2 months ago

sorry, its been a big while since i fiddled with code, could you tell me where is that variable? I downloaded through pip

xifutang commented 2 months ago

I tried deleting the line and change the number to be higher and yet no luck

JasonWS123 commented 2 months ago

Make sure to build the codes you edit. The nhentai command is being run from the built version, NOT the primary codes you edit. You have to run python setup.py install to rebuild the project after you make any changes.

xifutang commented 2 months ago

I mean, I've reinstalled everything even deleting Python caches & site-packages and still don't do anything. The code in the site-packages are changed to new one, yet it is still cutting the title..

Is it depends on pip version or something?

EDIT: Nevermind, found it that just deleting

if len(filename) >= length:
filename = filename[:length - 1] + u'…'

inside utils.py solved the problem.. i guess.

I use nhentai 0.5.5 btw

myussu commented 2 months ago

Same, i also solved it, in the utils.py i just edited the max field length to 1000, its working as i expected now, thank you.

RicterZ commented 2 months ago

added a config item max_filename in config file located at ~/.nhentai/config.json