[cleanup] Add more ruff rules (#10149)

Authored by: seproDev

Reviewed-by: bashonly <88596187+bashonly@users.noreply.github.com>
Reviewed-by: Simon Sawicki <contact@grub4k.xyz>
This commit is contained in:
sepro 2024-06-12 01:09:58 +02:00 committed by GitHub
parent db50f19d76
commit add96eb9f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
915 changed files with 7027 additions and 7246 deletions

View file

@ -89,10 +89,10 @@ class YandexVideoIE(InfoExtractor):
title
views_count
}
}''' % video_id).encode(), fatal=False)), lambda x: x['player']['content'])
}''' % video_id).encode(), fatal=False)), lambda x: x['player']['content']) # noqa: UP031
if not player or player.get('error'):
player = self._download_json(
'https://frontend.vh.yandex.ru/v23/player/%s.json' % video_id,
f'https://frontend.vh.yandex.ru/v23/player/{video_id}.json',
video_id, query={
'stream_options': 'hires',
'disable_trackings': 1,
@ -179,10 +179,10 @@ class YandexVideoPreviewIE(InfoExtractor):
}]
def _real_extract(self, url):
id = self._match_id(url)
webpage = self._download_webpage(url, id)
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
data_raw = self._search_regex(r'window.Ya.__inline_params__\s*=\s*JSON.parse\(\'([^"]+?\\u0022video\\u0022:[^"]+?})\'\);', webpage, 'data_raw')
data_json = self._parse_json(data_raw, id, transform_source=lowercase_escape)
data_json = self._parse_json(data_raw, video_id, transform_source=lowercase_escape)
return self.url_result(data_json['video']['url'])
@ -196,7 +196,7 @@ class ZenYandexIE(InfoExtractor):
'title': 'ВОТ ЭТО Focus. Деды Морозы на гидроциклах',
'description': 'md5:8684912f6086f298f8078d4af0e8a600',
'thumbnail': 're:^https://avatars.dzeninfra.ru/',
'uploader': 'AcademeG DailyStream'
'uploader': 'AcademeG DailyStream',
},
'params': {
'skip_download': 'm3u8',