diff options
author | Jesús <heckyel@hyperbola.info> | 2022-03-22 00:48:28 +0800 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2022-03-22 00:48:28 +0800 |
commit | 7a74bc5d1e54299e51b73492e09c70da994f4b35 (patch) | |
tree | e59a64b5b386d2381906e99912153aabd5d4ab0d /yt_dlp/extractor/funimation.py | |
parent | 3c69360ec3cb4a951d7e37150c7cfae8a0491cd2 (diff) | |
parent | 84842aee2ba8dc50601c86dc6fbb12d0fa438449 (diff) | |
download | hypervideo-pre-7a74bc5d1e54299e51b73492e09c70da994f4b35.tar.lz hypervideo-pre-7a74bc5d1e54299e51b73492e09c70da994f4b35.tar.xz hypervideo-pre-7a74bc5d1e54299e51b73492e09c70da994f4b35.zip |
updated from upstream | 22/03/2022 at 00:48
Diffstat (limited to 'yt_dlp/extractor/funimation.py')
-rw-r--r-- | yt_dlp/extractor/funimation.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/yt_dlp/extractor/funimation.py b/yt_dlp/extractor/funimation.py index 96dad2ca3..36a9c4772 100644 --- a/yt_dlp/extractor/funimation.py +++ b/yt_dlp/extractor/funimation.py @@ -36,9 +36,8 @@ class FunimationBaseIE(InfoExtractor): note='Checking geo-location', errnote='Unable to fetch geo-location information'), 'region') or 'US' - def _login(self): - username, password = self._get_login_info() - if username is None: + def _perform_login(self, username, password): + if self._TOKEN: return try: data = self._download_json( @@ -47,7 +46,7 @@ class FunimationBaseIE(InfoExtractor): 'username': username, 'password': password, })) - return data['token'] + FunimationBaseIE._TOKEN = data['token'] except ExtractorError as e: if isinstance(e.cause, compat_HTTPError) and e.cause.code == 401: error = self._parse_json(e.cause.read().decode(), None)['error'] @@ -90,8 +89,6 @@ class FunimationPageIE(FunimationBaseIE): def _real_initialize(self): if not self._REGION: FunimationBaseIE._REGION = self._get_region() - if not self._TOKEN: - FunimationBaseIE._TOKEN = self._login() def _real_extract(self, url): locale, show, episode = self._match_valid_url(url).group('lang', 'show', 'episode') @@ -154,10 +151,6 @@ class FunimationIE(FunimationBaseIE): }, }] - def _real_initialize(self): - if not self._TOKEN: - FunimationBaseIE._TOKEN = self._login() - @staticmethod def _get_experiences(episode): for lang, lang_data in episode.get('languages', {}).items(): |