[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
915 changed files with 7027 additions and 7246 deletions

View File

@@ -98,7 +98,7 @@ class URPlayIE(InfoExtractor):
file_http = v.get('location')
if file_http:
formats.extend(self._extract_wowza_formats(
'http://%s/%splaylist.m3u8' % (host, file_http),
f'http://{host}/{file_http}playlist.m3u8',
video_id, skip_protocols=['f4m', 'rtmp', 'rtsp']))
subtitles = {}
@@ -116,14 +116,14 @@ class URPlayIE(InfoExtractor):
for k, v in stream.items():
if (k in ('sd', 'hd') or not isinstance(v, dict)):
continue
lang, sttl_url = (v.get(kk) for kk in ('language', 'location', ))
lang, sttl_url = (v.get(kk) for kk in ('language', 'location'))
if not sttl_url:
continue
lang = parse_lang_code(lang)
if not lang:
continue
sttl = subtitles.get(lang) or []
sttl.append({'ext': k, 'url': sttl_url, })
sttl.append({'ext': k, 'url': sttl_url})
subtitles[lang] = sttl
image = urplayer_data.get('image') or {}
@@ -146,7 +146,7 @@ class URPlayIE(InfoExtractor):
return {
'id': video_id,
'title': '%s : %s' % (series_title, episode) if series_title else episode,
'title': f'{series_title} : {episode}' if series_title else episode,
'description': urplayer_data.get('description'),
'thumbnails': thumbnails,
'timestamp': unified_timestamp(urplayer_data.get('publishedAt')),