1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-05-19 11:39:28 +00:00

[rutube] Fix code style

This commit is contained in:
Alexander Nartov 2020-09-21 04:08:57 +10:00
parent f91625cd12
commit eba856318a

View file

@ -80,19 +80,16 @@ class RutubeBaseIE(InfoExtractor):
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json' 'Accept': 'application/json'
}, },
expected_status=400 expected_status=400)
)
if not login.get('success'): if not login.get('success'):
msg = login.get('message') msg = login.get('message')
raise ExtractorError( raise ExtractorError(
'Unable to log in. %s said: %s' % (self.IE_NAME, msg), 'Unable to log in. %s said: %s' % (self.IE_NAME, msg),
expected=True expected=True)
)
self._download_webpage( self._download_webpage(
'https://rutube.ru/social/auth/rupass/?callback_path=/social/login/rupass/', 'https://rutube.ru/social/auth/rupass/?callback_path=/social/login/rupass/',
None, False None, False)
)
def _download_and_extract_info(self, video_id, query=None): def _download_and_extract_info(self, video_id, query=None):
return self._extract_info( return self._extract_info(
@ -183,8 +180,7 @@ class RutubeIE(RutubeBaseIE):
if info['is_club']: if info['is_club']:
visitor_json, urlh = self._download_webpage_handle( visitor_json, urlh = self._download_webpage_handle(
'https://rutube.ru/api/accounts/visitor/', video_id, 'https://rutube.ru/api/accounts/visitor/', video_id,
'Downloading visitor JSON', 'Unable to download visitor JSON' 'Downloading visitor JSON', 'Unable to download visitor JSON')
)
if not visitor_json: if not visitor_json:
self.raise_login_required() self.raise_login_required()
@ -193,8 +189,7 @@ class RutubeIE(RutubeBaseIE):
ad = self._download_json( ad = self._download_json(
'https://mtr.rutube.ru/api/v3/interactive?%s&video_id=%s' % 'https://mtr.rutube.ru/api/v3/interactive?%s&video_id=%s' %
(club_params, video_id), (club_params, video_id),
video_id, 'Downloading AD JSON', 'Unable to download AD JSON' video_id, 'Downloading AD JSON', 'Unable to download AD JSON')
)
club_token = ad['award'] club_token = ad['award']
query.update({ query.update({