Godzil / Crunchy

Crunchy is capable of downloading anime episodes from the popular CrunchyRoll streaming service.
MIT License
95 stars 19 forks source link

Not being able to login #103

Closed Oujiii closed 4 years ago

Oujiii commented 5 years ago

Describe the bug If I tried to only login, without downloading anything, it works. The second I put a series or an episode to download, it doesn't work anymore

Expected behavior Except it to login and download the episode

Please fill theses informations: (Add a X between brackets to make them ticked if relevant)

johnfigs commented 5 years ago

This is also happening for me.

Godzil commented 5 years ago

I’m currently away and can’t look at that or test it.

But if you run in the same folder I don’t see why it should not work. It you use the default login method, it is fidly and need couple or retry to work (I never figured what’s happening on CR side probably something stupid but I never managed to get proper infos)

So use the —retry command with more than three to make sure then launch again with a single series it should log at some point (or just rerun it a couple of time until it log properly)

All the information that crunchy store are in the folder you are running it, so if you change the folder it is not going to work.

Oujiii commented 5 years ago

CR probably changed the way they handle logins, as none of the tools that I tested to download from CR worked. Probably something on their side.

I hope you could please look at it when you have the time and availability. Thank you.

Godzil commented 5 years ago

I will don’t worry as I’m using the tool too :)

Kitt3120 commented 5 years ago

Same :( <>@kellerarbeitskrafteinheit:~$ crunchy -u <> -p <> -l de --retry 10 -o ./Anime/ https://www.crunchyroll.com/de/mob-psycho-100

johnfigs commented 5 years ago

Mine worked randomly on saturday on the first try. Maybe continue spamming it.

On Tue, Feb 5, 2019, 7:57 AM Kitt3120 <notifications@github.com wrote:

Same :( <>@kellerarbeitskrafteinheit:~$ crunchy -u <> -p <> -l de --retry 10 -o ./Anime/ https://www.crunchyroll.com/de/mob-psycho-100

  • INFO : Crunchy version 1.4.5
  • WARN : Authentication failed:
  • INFO : Seems we are not currently logged. Let's login!
  • WARN : Authentication failed:
  • ERROR: Authentication failed: Done!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Godzil/Crunchy/issues/103#issuecomment-460692173, or mute the thread https://github.com/notifications/unsubscribe-auth/ATt5m35yklN3eO8PUOXh1SBLTFb4frpJks5vKanbgaJpZM4adjm- .

Kitt3120 commented 5 years ago

I am using anime-dl right now and it works perfectly! Maybe look into and see how they did it? Cause I would really like to use crunchy as it has more options.

Edit: Can't get crunchy to work :/ Still failing after several attempts. I think they changed something on their side.

Godzil commented 5 years ago

Anime-dl is in python and use the same login mecanism, the main difference, the cloud flare lib is really different and I suspect that some issues we have are due to that lib I’m using. I will check if there is any update (I doubt) or a new lib for that, that probably would fix some issues.

I’m surprised it try just once, does your config JSON file state 1 for retry?

Kitt3120 commented 5 years ago

So, I tested another tool called crunchyroll-dl (https://github.com/simplymemes/crunchyroll-dl), which is written in JavaScript. It tells me that the login worked but the media file is not found, but it doesn't matter, just wanted to check if it's able to log me in.

Nope, in my config.json file it states 10 for retry. { "format": "ass", "tag": "CrunchyRoll", "resolution": "1080", "retry": "10", "user": "////", "pass": "////", "crlang": "de", "output": "./", "nametmpl": "{SERIES_TITLE} - s{SEASON_NUMBER}e{EPISODE_NUMBER} - {EPISODE_TITLE} - [{TAG}]" }

Also, the login of crunchyroll-dl really seems to work, cause it detects that my account is premium. What I found out on anime-dl is that it tells you that it successfully logged in, even tho if it was not successful. I tried logging in with my username, but an invalid password and it said that it was successful, but just downloaded in normal "free" quality. So that's a bug in anime-dl, I guess.

Godzil commented 5 years ago

Crunchyroll-dl use the token auth method which crunchy support but I don’t and can’t put the token and other values needed in crunchy code because there are some CR related project project that was taken down because of that.

Crunchy support that method of login, it is somewhat documented (probably should be done better) but as I said I will not give api token and URLs and leave that to the user to find them, i could explain but same as for giving them it could put the project at risk, i would prefer to leave that to someone else not linked with that project to explain how it work.

Kitt3120 commented 5 years ago

Oh yeah, I understand. I would not give out a token in one of my projects, too. A friend of mine made his Discord bot open source, which ended up in a group of kids stealing discord bot tokens from github and running a script, which destroys all the servers the bot is on.

Godzil commented 5 years ago

Good news though, it seems that the cloud flare lib I’m using has been updated a lot since the last update of crunchy, it may solve some of the issues!

Kitt3120 commented 5 years ago

Looking forward to an update then :D

Kitt3120 commented 5 years ago

A quick guess: Could the login fail because my password has some special characters in, that are not escaped and messes up the request? Going to change my password and see how it goes... crunchy -u '/////' -p 'test12345' --retry 10 https://www.crunchyroll.com/de/mob-psycho-100/

Nope

Godzil commented 5 years ago

Well it is still good to know, that would have been a big if it was an issue, thanks for testing

KamiSamaKun commented 5 years ago

You have alternate solution ?

Godzil commented 5 years ago

Updated dependencies and released 1.4.6, I can't test right now, and can't promise it will fix anything, but cloudscraper had a lot of changed recently so it may works better.

KamiSamaKun commented 5 years ago

Great :)

Godzil commented 5 years ago

Does not seems to fix anything. Not sure what is happening there, it's like if nothing happened and load the login page for the first time after we sent the credential.

I probably miss something in the form, but don't really have the time to look further on that for the next couple of days.

Sorry about the inconvenience, hope to find a solution soon

Jimm1432 commented 5 years ago

same issue, really hope you fix it because i love this for keeping my library up to date.

also i can never get the resolution option to work. it always downloads in 1080p if i'm logged in and changing res in config or using -R 720 etc doesn't work.

Godzil commented 5 years ago

I'm currently clueless on what is happening with web login. It is like something is missing and it send me back to the login page, but I send the exact same thing as the variables the web browser is sending. I hope it is not linked with the recaptcha embedded in the page, if it is, I fear I will have no solution for that on that point.

The only way would be to use an alternative way of login. And they are "dangerous" to explain publicly, at least for me the project maintainer.

I need to do a bit more instrumenting on their website to see what is happening, but for now, it is really not clear.

Oujiii commented 5 years ago

I don't know if this might help, but I saw someone else mentioning on the youtube-dl repo that to bypass captcha would be logging into the site and exporting the cookies in a Netscape txt format and then passing the cookies using youtube-dl.

Godzil commented 5 years ago

Crunchy already support that method, in theory, but prooved to not work as it is right now.

storm134 commented 5 years ago

just letting you know i am using windows 10 version 1.4.6 and have no issue logging in or downloading (1080p only right now but that's fine). i think you might be on the right track with a lib issue. as much as i love linux (fedora fan myself) sometime's the lib are not the best.

Godzil commented 5 years ago

@storm134 What login method are you using? (and in which area of the world are you or VPN exit point if using a VPN ?)

storm134 commented 5 years ago

I am in canada, no vpn, not sure what you mean buy login method, using dos prompt and C:\Drivers\crunchy>crunchy -u [username] -p [password] --output c:\drivers\crunchy @https://www.crunchyroll.com/fight-league-gear-gadget-generators/episode-14-g-wrench-maximum-g-785953

just tested and still works

Godzil commented 5 years ago

Interesting.

Thanks I will check some more thing

storm134 commented 5 years ago

Just wanted to let you know, did a virtualbox of fedora 30 (64bit). and have no problem login in or downloading same video as before.

storm134 commented 5 years ago

Little more info, had some time this afternoon so did a mint 19 setup worked fine for me.

crunchy -u [username] -p [password] --output /home/user/ @https://www.crunchyroll.com/hinamatsuri/episode-1-arrival-of-the-psychokinetic-girl-768969

Oujiii commented 5 years ago

Still the same issue for me in Mint 19.1 Just reinstalled it, the config is right, the cookies are set, but I still get the same issue. I set the .cookies.json manually and it "logged on", but I still can't download any episodes.

Error if I try to download a single episode:

$ crunchy https://www.crunchyroll.com/a-centaurs-life/episode-1-when-all-is-said-and-done-everyone-loves-kisses-did-you-know-that-a-marathon-is-a-microcosm-of-life-742023
 * INFO : Crunchy version 1.4.6
 * INFO : You have a premium account! Good!
 * INFO : Checking availability for NarutoNatsume YuujinchouGintamaHayate the Combat Butler! (S1 e S2)
 * WARN : No episodes found for NarutoNatsume YuujinchouGintamaHayate the Combat Butler! (S1 e S2). Could it be a movie?
Done!

Error if I try to download a series:

$ crunchy https://www.crunchyroll.com/a-centaurs-life
 * INFO : Crunchy version 1.4.6
 * INFO : You have a premium account! Good!
 * WARN : Retrying to fetch episodes list from5 / 5
 * WARN : Retrying to fetch episodes list from4 / 5
 * WARN : Retrying to fetch episodes list from3 / 5
 * WARN : Retrying to fetch episodes list from2 / 5
 * WARN : Retrying to fetch episodes list from1 / 5
 * ERROR: {}
 * ERROR: Cannot get episodes from "https://www.crunchyroll.com/a-centaurs-life", please rerun later
Done!
Godzil commented 5 years ago

@oujiii for the direct episode link, you have to put a @ in front of the URL, for the second, it could be something else, they could have change the page layout. As it says you are logged that’s a different problem as this bug. Could you please run it again with the debug switch set, and create a new bug ticket? Thanks

Oujiii commented 5 years ago

@Godzil Yeah, I realized about the @ and it worked. I will open a new ticket regarding the download issue itself.

But the issue here still persists, in order for it to work, I had to get the cookies myself and manually insert them in the .json file.

Oujiii commented 5 years ago

Just an update, I think the login issue might be related to the fact that at least for my language, the website now appends a /pt-br/ for every page. So, the home page is https://www.crunchyroll.com/pt-br/ An example of a series page: https://www.crunchyroll.com/pt-br/the-rising-of-the-shield-hero/ An episode page: https://www.crunchyroll.com/pt-br/the-rising-of-the-shield-hero/episode-16-filolial-queen-783053

I installed Crunchy in an Ubuntu 18.04 VPS and I was able to log in sucessfully. The VPS is located in the US. I also tried in a VPS located in Germany and it didn't work. If you change the website to German, it will append a "de" to the website linkpages. That's might be causing the issue.

Also god damn Cloudflare is rate limiting me everytime

Kitt3120 commented 5 years ago

@Oujiii This might be why I can't login, I am from Germany and it is using the German Website for me, cause Crunchyroll blocks my VPN.

Godzil commented 5 years ago

I think I've done test in that regards, and haven't seen any improvment there. Will try more tests.

Godzil commented 5 years ago

So thanks to @Ronserruya, this is maybe fixed. I keep this ticket open for now, so please complain here if you still have issues

Jimm1432 commented 5 years ago

Logs in but doesn't download premium only videos and all downloads are in 320p.

Godzil commented 4 years ago

as seen in many other reported bugs, this shows that “we are logged” but something get wrong after as it no longer consider us as being logged.

Godzil commented 4 years ago

Just published version 1.5.1 which should properly fix the login issue, and all other related (resolution, can't download premium etc..)

Please update and test.

Ruke805 commented 4 years ago

I tried with the new version and the login still not working

Godzil commented 4 years ago

Could you explain a bit more what's happening on your side? That's not really helpful as is.

Ruke805 commented 4 years ago

I updated normally, and run this command: crunchy -u username@hotmail.com -p password --output C:\Anime https://www.crunchyroll.com/pt-br/digimon-adventure-2020 --verbose

And the result is:

Could you explain a bit more what's happening on your side? That's not really helpful as is.

Godzil commented 4 years ago

Try deleting the config.json file in your Anime folder and run crunchy once with the -u option to clear up the stored cookies, you need to pass the —output option else it will not work.

Ruke805 commented 4 years ago

Not worked, I remove the path from the command, deleted the config.json and the same error:

crunchy -u user@gmail.com -p password https://www.crunchyroll.com/nisekoi --verbose

I opened the json file, and was changed normally

Godzil commented 4 years ago

I'm closing this ticket. If anyone still have issue with login, please open a new one.