1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2026-01-05 22:41:18 +00:00

[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

@@ -77,13 +77,13 @@ class MGTVIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
tk2 = base64.urlsafe_b64encode(
f'did={str(uuid.uuid4())}|pno=1030|ver=0.3.0301|clit={int(time.time())}'.encode())[::-1]
f'did={uuid.uuid4()}|pno=1030|ver=0.3.0301|clit={int(time.time())}'.encode())[::-1]
try:
api_data = self._download_json(
'https://pcweb.api.mgtv.com/player/video', video_id, query={
'tk2': tk2,
'video_id': video_id,
'type': 'pch5'
'type': 'pch5',
}, headers=self.geo_verification_headers())['data']
except ExtractorError as e:
if isinstance(e.cause, HTTPError) and e.cause.status == 401:
@@ -160,6 +160,6 @@ class MGTVIE(InfoExtractor):
subtitles.setdefault(locale.lower(), []).append({
'url': sub_url,
'name': sub.get('name'),
'ext': 'srt'
'ext': 'srt',
})
return subtitles