RicterZ / nhentai

nhentai doujinshi downloader
http://nhentai.net
MIT License
828 stars 115 forks source link

ascii encoding issues #16

Closed trevor229 closed 6 years ago

trevor229 commented 6 years ago

When downloading, I get the following error: Traceback (most recent call last): File "/usr/local/bin/nhentai", line 11, in <module> load_entry_point('nhentai==0.2.8', 'console_scripts', 'nhentai')() File "/usr/local/lib/python2.7/dist-packages/nhentai-0.2.8-py2.7.egg/nhentai/command.py", line 67, in main data = html.format(TITLE=doujinshi.name, IMAGES=image_html) UnicodeEncodeError: 'ascii' codec can't encode characters in position 100-102: ordinal not in range(128) I did a quick google search and found that StackOverflow says:

Basically, stop using str to convert from unicode to encoded text / bytes. Instead, properly use .encode() to encode the string or work entirely in unicode

And I believe the code should be updated to work in unicode or use the .encode() method.

RicterZ commented 6 years ago

Please provide your command, thanks.

trevor229 commented 6 years ago

Sure, its nhentai --search="alice margatroid" --download --output /data/Anime/L-lewd\!/Ecchi/touhou\ project/alice\ margatroid/

RicterZ commented 6 years ago

Sorry, I cannot reproduce on Ubuntu. You can try this: download the latest version from github and install it.

mentaterasmus commented 6 years ago

I have sent you a pull request solving this problem

RicterZ commented 6 years ago

fix at #21