helpmeplsfortheloveofgod / hentaifetch

GNU General Public License v3.0
18 stars 3 forks source link

The package is broken now #6

Open quincynyan opened 2 years ago

quincynyan commented 2 years ago

It's not working anymore

JeppeX commented 2 years ago

curl: (22) The requested URL returned error: 503 curl: (3) URL using bad/illegal format or missing URL I just wanted hentaifetch bro...

Tendocat commented 1 year ago

bruh

Miou-zora commented 1 year ago

bruh

Adrian400811 commented 1 year ago

That is a 403(Forbidden) not 503.

Why 403: nhentai is protected by cloudflare and curl can't pass the javascript challenge. without -fsSL it returns the cloudflare challenge page in plain text html.

What works: curl is able to download the cover image from the image server.

The reason we need to access the main site is the numbers aren't same in the main site and the image server. Lets take 450773, in the image server it is 2523415. If we know how the numbers are related then we can do it in math, but we don't.

What I tried: Did some google, added a bunch of http headers to act as a browser and try bypass cloudflare:

    -H 'Host: nhentai.net' \
    -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0' \ 
    -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
    -H 'Accept-Language: en-US,en;q=0.5' \
    -H 'Referer: https://nhentai.net' \
    -H 'Connection: keep-alive'\
    --compressed

Absolutely no luck :(

What I mean image server works: Just run curl -fsSLo "cover.jpg" "https://t3.nhentai.net/galleries/2523396/cover.jpg". Image downloaded without any cloudflare bullshit (╯°□°)╯︵ ┻━┻

What would potentially fix this: If you ever use Tachiyomi, remember how it tells you to open in the browser and pass the challenge, and it works after that. We could use the same thing to bypass cloudflare. However we need to grab cookies from the browsers.

or, use curl-impersonate instead of curl, but that requires user to install more dependencies, and we will have multiple files instead of one

Also this repository hasn't been touched since exactly 2 years ago

And here comes the easiest way: Grab the image from wholesomelist.com instead, which at least 2 forks did.

quincynyan commented 1 year ago

But 177013 isn't in the wholesomelist :(

quincynyan commented 12 months ago

I have a (sorto) working version of this package for those who are still following this thread! The package isn't complete yet so feel free to PR. I'm still trying to work out chafa and w3m's image offsets, but due to neofetch's dev going on a haitus, these features aren't implemented yet. Hopefully that package will replace the current one on the AUR with an orphan request or something.

https://github.com/quincynyan/hentaifetch