ttdyce / NHentai-NHViewer

(NSFW) NHViewer is a simple third-party nhentai client for Android
https://ttdyce.com/apps/nhviewer/
MIT License
189 stars 7 forks source link

The application might not work from time to time (API issue) #24

Open ttdyce opened 2 years ago

ttdyce commented 2 years ago

Seems nhentai has changed their site (added DDoS protection?) and the API client is not working now.
Would need to update this application to fix this issue.

Tested with the api endpoint: curl https://nhentai.net/api/galleries/search\?query\=language:chinese

Screen Shot 2022-05-17 at 01 10 11

Expected to receive JSON response, currently some html for redirect after 5s

ttdyce commented 2 years ago

after some research, should be fixable. Briefly tested ok with @zhkrb's repo, will focus on his solution. 😵‍💫

https://github.com/zhkrb/cloudflare-scrape-Android

ttdyce commented 2 years ago

At the time, the ddos protection is gone and the api is back to work. Though, I think the ddos protection page may pop up again from time to time.

image

API resumed normal now

afterDarkInvalid commented 2 years ago

The idea that NHentai puts DDoS protection like this on their API just feels bizarre to me. I mean I kinda get why but it just feels silly

afterDarkInvalid commented 2 years ago

I also tried a wget command and it gave me a 503 Service Temporarily Unavailable error. Same as with your NHAPI repo:

~$ wget https://nhentai.net/api/galleries/search -O /tmp/index.html
--2022-07-01 13:39:04--  https://nhentai.net/api/galleries/search
Resolving nhentai.net (nhentai.net)... 172.67.159.231, 104.21.66.123
Connecting to nhentai.net (nhentai.net)|172.67.159.231|:443... connected.
HTTP request sent, awaiting response... 503 Service Temporarily Unavailable
2022-07-01 13:39:04 ERROR 503: Service Temporarily Unavailable.
ttdyce commented 2 years ago

Some update for those who are interested: My local dev is almost done for this issue (by adding a hidden WebView), I will soon release the new version after some testing.

ttdyce commented 2 years ago

Should be fixed in 3.3.0, see: https://install.appcenter.ms/users/ttdyce/apps/nhviewer-1/distribution_groups/public

ttdyce commented 1 year ago

Current not working, checked from app log: Unexpected response code 403

checked the actual behavior in chrome:

  1. GET https://nhentai.net/api/ return 403
  2. some javascript triggered to POST the same url, returned 200 and the data in the response body. The process takes ~3.5s

Required further check for the issue

ttdyce commented 1 year ago

Currently not working, server API returned code 404, with content = {"error": "does not exist"} tested url = https://nhentai.net/api/galleries/search?query=chinese

ttdyce commented 1 year ago

Currently not working, server API returned code 404, with content = {"error": "does not exist"} tested url = https://nhentai.net/api/galleries/search?query=chinese

Checked again that API is back to working now.

ttdyce commented 9 months ago

Currently not working again, 404 with {"error": "does not exist"} tested url = https://nhentai.net/api/galleries/search?query=chinese but https://nhentai.net/api/galleries/search?query=english works

is it checking the query keywords? need to come up with some alternative keywords for it.