[Crunchyroll] Log In support

See original GitHub issue

Checklist

Region

No response

Example URLs

https://beta.crunchyroll.com/it/watch/G8WUN2ND8/La-citt-delle-bestie-magiche-coperta-di-neve https://beta.crunchyroll.com/watch/GJWU2J7Z8/Clash-Class-A-vs-Class-B

Description

Like I said the in site support issue https://github.com/yt-dlp/yt-dlp/issues/915

It is possible to not only support the website but also the login for crunchyroll. Access to beta crunchyroll should be default in US for free and paid account (so you should be able to test this with a free account). Like I said in the support site issue we already got two example on how to implement the log in support https://github.com/hyugogirubato/Kamyroll-Python the old basic script (really easy to understand) https://github.com/hyugogirubato/Kamyroll-Python/blob/ffba19ec6f8c81dae4e5f35e368748fe2fca6494/kamyroll.py and my own C# implementation (based on that old kamyroll python version, easier to understand at least for me) https://github.com/federicorosso1993/Kamyroll-CSharp

I think the old crunchyroll log in support was already half broken (it required a cookies.txt file and the user agent), my own script and kamyroll-python do not require anything like that (my own implementation and the old version of kamyroll used this kind of code

var cookie = cookieContainer.GetCookies(uri).Cast().FirstOrDefault(x => x.Name == "etp_rt"); in C# and a code like this

r = requests.get(endpoint)
etp_rt = r.cookies.get("etp_rt") 

in python

So it should be possible to avoid the request of a cookie file from the user. I know that the new kamyroll implemetation in python don’t even need that since it use the mobile api to log in. The old implementation use the desktop app api. My own implementation got also a comment with the web API implementation to log in (I made it as a comment because the desktop app api it’s already working as an alternative). You can use this page https://www.crunchyroll.com/welcome/login and this page https://www.crunchyroll.com/originals/it/index.html

to find the basic auth code (in a get with this url https://api.crunchyroll.com/start_session.0.json?sess_id=1&device_type=com.crunchyroll.static&device_id=whatvalueshouldbeforweb&access_token=giKq5eY27ny3cqz ) It’s always the same value and it will work to start the log in.

Not sure how to implement it in a large python app like yt-dlp (I’m not really skilled with python) but the code it’s already done and it’s working in another app (made just to fix youtube-dl and now yt-dlp).

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:21 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
tejing1commented, Jan 29, 2022

Ah, I realized I misunderstood you. self._download_json is a wrapper around urllib that parses the response as json before returning it, and becomes a GET in this case because I used query=. data= would produce a POST instead.

My process starts with a session id from a GET to get_upsell_data.0.json, then logs in with a POST to login.1.json, which sets the etp_rt cookie needed for the beta extractor’s call to auth/v1/token on the beta api (and presumably also the non-beta mechanism works on the same cookie).

I wanted to start with a GET of https://www.crunchyroll.com/welcome/login, so that I didn’t need to hardcode anything at all, but was stymied by cloudflare.

0reactions
tejing1commented, Jan 29, 2022

Cloudflare probably just thinks that specific IP is suspicious

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I contact Crunchyroll Customer Service?
Customer Service does not have phone support yet, but we do have email support through the service links that you can use to...
Read more >
Submit a request - Knowledge Base
General Questions, Technical, E-Commerce, Billing, Membership, Account/Login. Knowledge Base Privacy Policy Terms of Service. English (US)
Read more >
Login - Crunchyroll
Email or Username. Password. Show. FORGOT PASSWORD? LOG IN. No account? CREATE ONE · Terms of Service · Privacy Policy; Cookie Consent Tool;...
Read more >
Contact Us - Crunchyroll Store
We're Social ; HELP & CUSTOMER SERVICE · FAQ · Delayed Pre-Orders List ; ABOUT CRUNCHYROLL · Your Privacy Choices; AdChoices ; HELPFUL...
Read more >
About - Contact Us - Crunchyroll
Customer Service. Crunchyroll Help Center · Funimation Help Center · Partner With Us. business@crunchyroll.com · Press & Company Information. press@crunchyroll.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found