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(
'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']
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')
},
}]
- 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():