RicterZ / nhentai

nhentai doujinshi downloader
http://nhentai.net
MIT License
804 stars 112 forks source link

"NoneType" object is not iterable when trying to use --max-page #54

Closed MyNameIsPierre closed 5 years ago

MyNameIsPierre commented 5 years ago

Hello, First of all thanks for the downloader and the support you're offering. My goal is to download all the hentais of nhentai.net categories I'm interested in. For example I used :

nhentai --tag bukkake --login "myusername:mypassword" --output B:\ --download

However it only works for the first page so as you explained in another issue I added :

nhentai --tag bukkake --login "myusername:mypassword" --output B:\ --download --max-page 164

Now it doesn't download anything and gives me the error :

[14:40:43] [INFO] Using mirror: https://nhentai.net
[14:40:43] [INFO] Logging in to nhentai using credential pair '*****:************'
[14:40:43] [WARNING] No favorites found
[14:40:43] [DEBUG] Fetching page 1 for doujinshi with tag 'bukkake'
[14:40:44] [DEBUG] Fetching page 2 for doujinshi with tag 'bukkake'
[14:40:44] [DEBUG] Fetching page 3 for doujinshi with tag 'bukkake'
[14:40:44] [DEBUG] Fetching page 4 for doujinshi with tag 'bukkake'
[14:40:44] [DEBUG] Fetching page 5 for doujinshi with tag 'bukkake'
[14:40:44] [DEBUG] Fetching page 6 for doujinshi with tag 'bukkake'
[14:40:45] [ERROR] Cannot find doujinshi id of tag 'bukkake'
Traceback (most recent call last):
  File "C:\Users\*****\AppData\Local\Programs\Python\Python37-32\Scripts\nhentai-script.py", line 11, in <module>
    load_entry_point('nhentai==0.3.1', 'console_scripts', 'nhentai')()
  File "C:\Users\******\AppData\Local\Programs\Python\Python37-32\lib\site-packages\nhentai-0.3.1-py3.7.egg\nhentai\command.py", line 41, in main
    doujinshi_ids = map(lambda d: d['id'], doujinshis)
TypeError: 'NoneType' object is not iterable

Apparently I am not banned on the website and I even tried with a VPN, gives me the same error which makes me say it is not ban related. Do you know how to fix this ? Thanks !

MyNameIsPierre commented 5 years ago

No one ? :/

RicterZ commented 5 years ago

Sorry for the late response, I’m too busy in this week but I think I will fix it tormorrow. :(

BarneyGold notifications@github.com于2019年5月18日 周六上午5:20写道:

No one ? :/

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/RicterZ/nhentai/issues/54?email_source=notifications&email_token=ABIJXR6WYMKQJ3UJIFBWVODPV4OSVA5CNFSM4HLRNLAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVV4Q5I#issuecomment-493602933, or mute the thread https://github.com/notifications/unsubscribe-auth/ABIJXR6RZXRTZJMHL7YLEWLPV4OSVANCNFSM4HLRNLAA .

-- Regards, Ricter Zheng

RicterZ commented 5 years ago

@BarneyGold

nhentai --cookie 'XXX'
nhentai --tag bukkake 

Worked fine according my test.

RicterZ commented 5 years ago

pip install nhentai==0.3.2 to upgrade

MyNameIsPierre commented 5 years ago

Hi, Thanks for the answer. For some reason when trying to download via pip I have this error :

C:\WINDOWS\system32>pip install nhentai==0.3.2 Collecting nhentai==0.3.2 Using cached https://files.pythonhosted.org/packages/6b/68/02390efae3fb0252f5acaa990f91a01ee6065c23a4309fa77eb806ab160e/nhentai-0.3.2.tar.gz ERROR: Complete output from command python setup.py egg_info: ERROR: Traceback (most recent call last): File "", line 1, in File "C:\Users\USER~1\AppData\Local\Temp\pip-install-cg1ri1dw\nhentai\setup.py", line 26, in long_description=long_description(), File "C:\Users\USER~1\AppData\Local\Temp\pip-install-cg1ri1dw\nhentai\setup.py", line 15, in long_description return str(f.read()) File "c:\users\USER\appdata\local\programs\python\python37-32\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 248: character maps to

ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Users\USER~1\AppData\Local\Temp\pip-install-cg1ri1dw\nhentai\

I did a pip check and it works correctly. I searched for a bit but this error seems to come from many possible problems... Do you have any idea on how to fix it ? (I also tried in git bash and it does the same)

RicterZ commented 5 years ago

._. what's your python version?

MyNameIsPierre commented 5 years ago

python verison is 3.7.3 and pip verison is 19.1.1

RicterZ commented 5 years ago

I released 0.3.4, using pip install nhentai -U to install

MyNameIsPierre commented 5 years ago

It installed well, it works if I try your description examples but it still doesn't work with my custom command... i.e :

C:\WINDOWS\system32>nhentai --tag "big breasts" --output B:\ --download --max-page 250 [17:02:51] [INFO] nHentai ver 0.3.4: あなたも変態。 いいね?


| | | | _ | |_ () | ' | || |/ \ ' | / ` | | | | | | | _/ | | | || (| | | || ||| ||_|| ||__,||

[17:02:51] [INFO] Using mirror: https://nhentai.net [17:02:51] [DEBUG] Fetching page 1 for doujinshi with tag 'big-breasts' [17:02:51] [DEBUG] Fetching page 2 for doujinshi with tag 'big-breasts' [17:02:51] [DEBUG] Fetching page 3 for doujinshi with tag 'big-breasts' [17:02:51] [DEBUG] Fetching page 4 for doujinshi with tag 'big-breasts' [17:02:51] [DEBUG] Fetching page 5 for doujinshi with tag 'big-breasts' [17:02:51] [DEBUG] Fetching page 6 for doujinshi with tag 'big-breasts' [17:02:51] [ERROR] Cannot find doujinshi id of tag 'big-breasts' [17:02:51] [INFO] All done.

And it doesn't download anything. I already logged my cookie and it saved without problems. Sorry to still bother but I don't have a clue about what causes this...

RicterZ commented 5 years ago

Trying set your cookie first: nhentai --cookie 'YOUR NHENTAI COOKIE'. You can obtain your cookie from Chrome network tab.

MyNameIsPierre commented 5 years ago

Hi again, sorry for the late response. I first entered the cookie using the --cookie command and it worked however it still gives me the same error as stated above, I even tried with other random tags :

C:\WINDOWS\system32>nhentai --tag shotacon --output B:\ --download --max-page 250 [16:02:09] [INFO] nHentai ver 0.3.4: あなたも変態。 いいね?


| | | | _ | |_ () | ' | || |/ \ ' | / ` | | | | | | | _/ | | | || (| | | || ||| ||_|| ||__,||

[16:02:09] [INFO] Using mirror: https://nhentai.net [16:02:09] [DEBUG] Fetching page 1 for doujinshi with tag 'shotacon' [16:02:10] [DEBUG] Fetching page 2 for doujinshi with tag 'shotacon' [16:02:10] [DEBUG] Fetching page 3 for doujinshi with tag 'shotacon' [16:02:10] [DEBUG] Fetching page 4 for doujinshi with tag 'shotacon' [16:02:10] [DEBUG] Fetching page 5 for doujinshi with tag 'shotacon' [16:02:10] [DEBUG] Fetching page 6 for doujinshi with tag 'shotacon' [16:02:11] [DEBUG] Fetching page 7 for doujinshi with tag 'shotacon' [16:02:11] [DEBUG] Fetching page 8 for doujinshi with tag 'shotacon' [16:02:11] [DEBUG] Fetching page 9 for doujinshi with tag 'shotacon' [16:02:11] [DEBUG] Fetching page 10 for doujinshi with tag 'shotacon' [16:02:12] [ERROR] Cannot find doujinshi id of tag 'shotacon' [16:02:12] [INFO] All done.

RicterZ commented 5 years ago

I think you set a wrong cookie. Get your cookie here: image