yt-dlp: Crunchyroll cookie/login not working

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I remove or skip any mandatory* field

Checklist

  • I’m reporting a broken site
  • I’ve verified that I’m running yt-dlp version 2023.01.06 (update instructions) or later (specify commit)
  • I’ve checked that all provided URLs are playable in a browser with the same IP and same login details
  • I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
  • I’ve searched the bugtracker for similar issues including closed ones. DO NOT post duplicates
  • I’ve read the guidelines for opening an issue
  • I’ve read about sharing account credentials and I’m willing to share it if required

Region

France

Provide a description that is worded well enough to be understood

My usual method to download on crunchyroll is not working anymore, I’ve tried passing the cookie through a file instead from the browser and using -u <login> but I still get the message “This video is for premium members only.” My account has an active subscription and I can access the episode on the website

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

[debug] Command-line config: ['-vU', '--write-sub', '--sub-lang', 'fr-FR', '--cookies-from-browser', 'chrome', 'https://www.crunchyroll.com/fr/watch/G0DUN8EN7/the-great-spirit-mother-and-the-demon-kings-right-hand-man']
[debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.01.06 [6becd25] (pip)
[debug] Python 3.10.8 (CPython AMD64 64bit) - Windows-10-10.0.19044-SP0 (OpenSSL 1.1.1q  5 Jul 2022)
[debug] exe versions: ffmpeg 5.1.2-full_build-www.gyan.dev (setts), ffprobe 5.1.2-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.09.24, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.3
[Cookies] Extracting cookies from chrome
[debug] Extracting cookies from: "C:\Users\login\AppData\Local\Google\Chrome\User Data\Default\Network\Cookies"
[debug] Found local state file at "C:\Users\login\AppData\Local\Google\Chrome\User Data\Local State"
[Cookies] Extracted 3237 cookies from chrome
[debug] cookie version breakdown: {'v10': 3237, 'other': 0, 'unencrypted': 0}
[debug] Proxy map: {}
[debug] Loaded 1760 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.01.06, Current version: 2023.01.06
yt-dlp is up to date (2023.01.06)
[crunchyroll] Extracting URL: https://www.crunchyroll.com/fr/watch/G0DUN8EN7/the-great-spirit-mother-and-the-demon-kings-right-hand-man
[crunchyroll] Retrieving main page
[crunchyroll] Authenticating with grant_type=etp_rt_cookie
[crunchyroll] Retrieving signed policy
[crunchyroll] the-great-spirit-mother-and-the-demon-kings-right-hand-man: Retrieving episode metadata
ERROR: [crunchyroll] G0DUN8EN7: This video is for premium members only.
  File "D:\Program Files\Python310\lib\site-packages\yt_dlp\extractor\common.py", line 680, in extract
    ie_result = self._real_extract(url)
  File "D:\Program Files\Python310\lib\site-packages\yt_dlp\extractor\crunchyroll.py", line 158, in _real_extract
    raise ExtractorError('This video is for premium members only.', expected=True)

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 23 (10 by maintainers)

Commits related to this issue

Most upvoted comments

The playback key does not exist anymore in episode json if the content is premium only, even if the person is logged in and has premium.

An alternate solution to check the premium state early would be to switch the mentioned check with not bucket.endswith("crunchyroll") (or maybe bucket.endswith("-")), but I cannot test these further. I have tried with 2 free accounts so far where it worked, but it might not be a stable solution.

diff --git a/yt_dlp/extractor/crunchyroll.py b/yt_dlp/extractor/crunchyroll.py
index 7d356d673..6dccdd883 100644
--- a/yt_dlp/extractor/crunchyroll.py
+++ b/yt_dlp/extractor/crunchyroll.py
@@ -160,7 +160,7 @@ def _real_extract(self, url):
         episode_response = self._download_json(
             f'{api_domain}/cms/v2{bucket}/episodes/{internal_id}', display_id,
             note='Retrieving episode metadata', query=params)
-        if episode_response.get('is_premium_only') and not episode_response.get('playback'):
+        if episode_response.get('is_premium_only') and not bucket.endswith('crunchyroll'):
             if self.is_logged_in:
                 raise ExtractorError('This video is for premium members only', expected=True)
             else:

As a side note, the requests in the browser use the objects endpoint now (https://www.crunchyroll.com/content/v2/cms/objects/{display_id}?locale={locale}). Maybe it would make sense to migrate to using that as well?

I went into the extractor and commented out the lines 157-158

if episode_response.get('is_premium_only') and not episode_response.get('playback'):
raise ExtractorError('This video is for premium members only.', expected=True)

now it works.

I also have this issue when I try to use my cookie file and when I pass my login information to yt-dlp. Austria Output:

[debug] Command-line config: ['-vU', '-u', 'PRIVATE', '-p', 'PRIVATE', '-o', '%(title)s.%(ext)s', '--skip-download', '--get-filename', 'https://www.crunchyroll.com/watch/GEVUZE024/excitement-the-halloween-costume-contest']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.01.06 [6becd25] (zip)
[debug] Python 3.8.10 (CPython x86_64 64bit) - Linux-5.4.0-139-generic-x86_64-with-glibc2.29 (OpenSSL 1.1.1f  31 Mar 2020, glibc 2.31)
[debug] exe versions: ffmpeg 4.2.7, ffprobe 4.2.7
[debug] Optional libraries: Cryptodome-3.17, certifi-2019.11.28, secretstorage-2.3.1, sqlite3-2.6.0
[debug] Proxy map: {}
[debug] Loaded 1760 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.01.06, Current version: 2023.01.06
yt-dlp is up to date (2023.01.06)
[crunchyroll] Getting session id
[crunchyroll] Logging in
[crunchyroll] Extracting URL: https://www.crunchyroll.com/watch/GEVUZE024/excitement-the-halloween-costume-contest
[crunchyroll] Retrieving main page
[crunchyroll] Authenticating with grant_type=etp_rt_cookie
[crunchyroll] Retrieving signed policy
[crunchyroll] excitement-the-halloween-costume-contest: Retrieving episode metadata
ERROR: [crunchyroll] GEVUZE024: This video is for premium members only.
  File "/usr/local/bin/yt-dlp/yt_dlp/extractor/common.py", line 680, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/yt-dlp/yt_dlp/extractor/crunchyroll.py", line 158, in _real_extract
    raise ExtractorError('This video is for premium members only.', expected=True)

I do indeed have premium and I am willing to share the account for testing purposes.

I have the same issue, but it only happens with some episodes.