nikkozu / nana-api

nHentai unofficial API
https://www.npmjs.com/package/nana-api
MIT License
27 stars 4 forks source link

Axios Error due to DDoS protection #5

Open Rannytheory opened 2 years ago

Rannytheory commented 2 years ago

Running any nana-api function returns a 503. This is likely due to the DDoS protection that nhentai has now.

Output

Error: Request failed with status code 503
    at createError (.../node_modules/nana-api/node_modules/axios/lib/core/createError.js:16:15)
    at settle (.../mockups/node_modules/nana-api/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (.../Code/mockups/node_modules/nana-api/node_modules/axios/lib/adapters/http.js:269:11)
    at IncomingMessage.emit (node:events:406:35)
    at endReadableNT (node:internal/streams/readable:1343:12)
Rannytheory commented 2 years ago

Found a workaround for the cloud flare protection. Just use google!

url = "https://nhentai.net/g/177013"
r = requests.get(f"https://translate.google.com/translate?sl=vi&tl=en&hl=vi&u={url}&client=webapp")
print(r.status_code)
print(r.content)