RicterZ / nhentai

nhentai doujinshi downloader
http://nhentai.net
MIT License
854 stars 121 forks source link

How to set cookie? #245

Closed Criarino closed 2 years ago

Criarino commented 2 years ago

I want to download my favorites, so I followed the instructions in the readme file to set a cookie, but I can't find the cf_chl_2 and cf_chl_prog fields in my cookie. I've tried everything but can't seem to make it work

Kayot commented 2 years ago

Same, I only have cf_clearance, csrftoken, and sessionid.

Edit: There are some hidden cookies like _ga_PHVG60J2FD, _gid, and _gcl_au, and _ga.

Poseid00 commented 2 years ago

I want to download my favorites, so I followed the instructions in the readme file to set a cookie, but I can't find the cf_chl_2 and cf_chl_prog fields in my cookie. I've tried everything but can't seem to make it work

You can clear your cookies of this website from you web browser and log in to the website again then you could see these cookies, I did it but still couldn't download the comics because of the blocks of cloudflare.

Kayot commented 2 years ago

I cleared my cookies, but the only extra cookie I got was cf_chl_seq_c6d364a6d3b242d. Maybe I'm doing it wrong? I cleared it under Dev Tools->Application->Cookies->nHentai->right-click Clear Cookies -> Relog in.

Maybe I should try using Firefox?

Poseid00 commented 2 years ago

I deleted cookies of this website in the setting option of Chrome, after deleting them and relog in the website, the cookies appeared, you could have a try.

Kayot commented 2 years ago

cookies I deleted, closed browser, and relogged in. This is what I get.

Poseid00 commented 2 years ago

I cleared cookies on this page then

image

when you browsed this website, these cookies appeared.

image
Kayot commented 2 years ago

That's so weird. I did the same cookies2

cookies3

And it's still not showing up. However I did manage to get the values using Postman which tells me that Chrome is hiding the cookies from me.

cookies4

Why would it do this?

Spoke too soon, now it's not giving me cf_chl_prog :/

Poseid00 commented 2 years ago

Maybe you could try using other browsers.

Kayot commented 2 years ago

Heh, figured it out...

First, changing browsers didn't do squat. The cookie times out and dies too fast. I was able to capture the cookie with Postman's Interceptor debug session tool. But I still couldn't get it to work. Then I read the options and notices a new option:

--useragent

I set mine;

nhentai --useragent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"

And now nHentai works.

Kayot commented 2 years ago

246 This should solve that ticket as well, please test and confirm

Poseid00 commented 2 years ago

246 This should solve that ticket as well, please test and confirm

It works for me, many thanks.

Criarino commented 2 years ago

thanks for the answer, but do I really need to use postman? Isn't there any other way ( at least one where I don't need to create yet another account I will never again use)? EDIT: nvm I've made it