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

(node:28502) UnhandledPromiseRejectionWarning: Error: Request failed with status code 403 #50

Open
ArturiaPendragon opened this issue May 28, 2020 · 18 comments

Comments

@ArturiaPendragon
Copy link

ArturiaPendragon commented May 28, 2020

Hello here :

crunchyroll-dl -u xxxx -p xxxx -i https://www.crunchyroll.com/sing-yesterday-for-me/episode-3-what-is-love-794608 -l frFR -q 1080p -s soft --vilos -o test.mkv

(node:28502) UnhandledPromiseRejectionWarning: Error: Request failed with status code 403
    at createError (/usr/lib/node_modules/crunchyroll-dl/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/usr/lib/node_modules/crunchyroll-dl/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/usr/lib/node_modules/crunchyroll-dl/node_modules/axios/lib/adapters/http.js:236:11)
    at IncomingMessage.emit (events.js:322:22)
    at endReadableNT (_stream_readable.js:1187:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:28502) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:28502) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@AlexIsOK
Copy link
Contributor

AlexIsOK commented May 28, 2020

In most command line programs, arguments that are more than one character should start with two hyphens rather than one, so you should be able to fix this by changing -vilos to --vilos.

Hope this helps!

Edit: in most programs, if you have -vilos rather than --vilos, it will try to read it like -v -i -l -o -s instead of the intended behavior.

@ArturiaPendragon
Copy link
Author

Yes, I made a mistake in the command line, but the error remains the same (Captcha of Cloudflare)

@simplymemes
Copy link
Owner

I was debugging this for a bit today and couldn't seem to get around it, that's annoying

@ArturiaPendragon
Copy link
Author

ArturiaPendragon commented May 29, 2020

It's works on youtube-dl with cookie file (no captcha required), but all tools (cr-dl, crunchy-dl, cr-dl, crunchyroll-dl and others) doesn't work with login/password ... (I tried a lot of testing haha..)

Thx to Cloudflare 🥺

@AlexIsOK
Copy link
Contributor

AlexIsOK commented May 29, 2020

This does not seem to be happening to me (United States). Could this be a regional issue?

Edit: started happening to me on my Windows VM when trying this, but not on my main OS.

@AlexIsOK
Copy link
Contributor

AlexIsOK commented May 30, 2020

I found out what is most likely causing the issue, the package cloudscraper that this uses has been deprecated. The only other (updated) CF bypass I've seen is written in Python, but I'll look around and see if there's another library to use.

@ArturiaPendragon
Copy link
Author

This exist :
RyuzakiH/CloudflareSolverRe#29

@tomasdiaztoro
Copy link

tomasdiaztoro commented Jun 2, 2020

Im getting this error only when use -s soft

@AlexIsOK
Copy link
Contributor

AlexIsOK commented Jun 3, 2020

@ArturiaPendragon that library is made using C#, I'm not sure that you can port that to NodeJS.

I'm looking into libraries for this right now, I'll make a PR if I find anything.

@ArturiaPendragon
Copy link
Author

ArturiaPendragon commented Jun 3, 2020

@AlexIsOK He fixed this with change with TLSv1.3 (for login).

https://github.com/anidl/crunchyroll-downloader-nx/commit/8d853d0d8bdcc88b03a2d59ee6fb80fef9c038b9

Maybe this helps?

ytdl-org/youtube-dl#25437

--tls-min-v1.3 set default TLS minimum to TLSv1.3 (default: TLSv1.2)

@simplymemes
Copy link
Owner

Hmm, not sure if the library this uses supports the manual setting of TLS from first glance, will need more investigation

@DavCP
Copy link

DavCP commented Jun 19, 2020

This isn't solved yet, right? :(

@simplymemes
Copy link
Owner

Yeah :(
It's getting a lot harder now to work on this since I keep getting captchas from Cloudflare. Hopefully I'll have something but it's take a while

@AlexIsOK
Copy link
Contributor

AlexIsOK commented Jun 19, 2020

I'll look into this as well. I got it to (sort of) work by calling py3 from the Node runtime and having it use this Python cloudscraper but that requires the user to have Python3 installed and has to check to see if the PIP3 dependencies are met.

Edit: those changes are available here if you want to see.

Edit 2: I haven't committed the changes that work yet, so I'll do that right now.

@AlexIsOK
Copy link
Contributor

AlexIsOK commented Jun 19, 2020

@simplymemes on my fork on branch patch-2, I'm getting an error with this regex. CR may have changed the div class of what you're trying to match. Downloading single episodes works fine for me though.

I was able to make a (horrible) fix by running the Python cloudscraper I mentioned before (which works very well, but the user must have pip3 and python3 installed, and must have pip3 install cloudscraper).

Unless there's a cloudscraper for NodeJS that works, I don't see an easy way to do this, though I could easily be missing something.

PS. the cloudscraper can get the content of the CF page, but the regex doesn't match.

@Owyii
Copy link

Owyii commented Jul 2, 2020

I might be interested in the python solution, once i have pip3, python3 and pip3 install the only thing needed is running the cloudscraper?

@AlexIsOK
Copy link
Contributor

AlexIsOK commented Jul 3, 2020

@Owyii It doesn't work until the regex is fixed, and I found that the downloader works a lot better if you download the individual episode rather than all of them or series at a time. Maybe this could be helpful for a future patch?

@Owyii
Copy link

Owyii commented Jul 3, 2020

@AlexIsOK I am able to download the single episode if the subtitle are hardsubbed, however as soon i try to download with softsub I get error 403

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

6 participants