diff --git a/yt_dlp/extractor/crunchyroll.py b/yt_dlp/extractor/crunchyroll.py index 5253e7e4ba..ffe2910982 100644 --- a/yt_dlp/extractor/crunchyroll.py +++ b/yt_dlp/extractor/crunchyroll.py @@ -35,7 +35,6 @@ sanitized_Request, traverse_obj, try_get, - urlencode_postdata, xpath_text, ) from ..aes import ( @@ -44,8 +43,8 @@ class CrunchyrollBaseIE(InfoExtractor): - _LOGIN_URL = 'https://www.crunchyroll.com/login' - _LOGIN_FORM = 'login_form' + _LOGIN_URL = 'https://www.crunchyroll.com/welcome/login' + _API_BASE = 'https://api.crunchyroll.com' _NETRC_MACHINE = 'crunchyroll' def _call_rpc_api(self, method, video_id, note=None, data=None): @@ -62,50 +61,33 @@ def _login(self): username, password = self._get_login_info() if username is None: return - - login_page = self._download_webpage( - self._LOGIN_URL, None, 'Downloading login page') - - def is_logged(webpage): - return 'href="/logout"' in webpage - - # Already logged in - if is_logged(login_page): + if self._get_cookies(self._LOGIN_URL).get('etp_rt'): return - login_form_str = self._search_regex( - r'(?P