Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The package is broken now #6

Open
quincynyan opened this issue May 8, 2022 · 6 comments
Open

The package is broken now #6

quincynyan opened this issue May 8, 2022 · 6 comments

Comments

@quincynyan
Copy link

It's not working anymore

@JeppeX
Copy link

JeppeX commented May 27, 2022

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

@Tendocat
Copy link

Tendocat commented Oct 8, 2022

bruh

1 similar comment
@Miou-zora
Copy link

bruh

@Adrian400811
Copy link

Adrian400811 commented Apr 16, 2023

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
Copy link
Author

But 177013 isn't in the wholesomelist :(

@quincynyan
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants