1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-31 22:55: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

@@ -38,7 +38,7 @@ class GettrIE(GettrBaseIE):
'timestamp': 1632782451.058,
'duration': 58.5585,
'tags': ['hornofafrica', 'explorations'],
}
},
}, {
'url': 'https://gettr.com/post/p4iahp',
'info_dict': {
@@ -53,7 +53,7 @@ class GettrIE(GettrBaseIE):
'timestamp': 1626594455.017,
'duration': 23,
'tags': 'count:12',
}
},
}, {
# quote post
'url': 'https://gettr.com/post/pxn5b743a9',
@@ -76,7 +76,7 @@ class GettrIE(GettrBaseIE):
def _real_extract(self, url):
post_id = self._match_id(url)
webpage = self._download_webpage(url, post_id)
api_data = self._call_api('post/%s?incl="poststats|userinfo"' % post_id, post_id)
api_data = self._call_api(f'post/{post_id}?incl="poststats|userinfo"', post_id)
post_data = api_data.get('data')
user_data = try_get(api_data, lambda x: x['aux']['uinf'][post_data['uid']], dict) or {}
@@ -106,7 +106,7 @@ class GettrIE(GettrBaseIE):
or self._search_regex(r'^(.+?) on GETTR', self._og_search_title(webpage, default=''), 'uploader', fatal=False))
if uploader:
title = '%s - %s' % (uploader, title)
title = f'{uploader} - {title}'
formats, subtitles = self._extract_m3u8_formats_and_subtitles(
urljoin(self._MEDIA_BASE_URL, vid), post_id, 'mp4',
@@ -157,7 +157,7 @@ class GettrStreamingIE(GettrBaseIE):
'title': 'Day 1: Opening Session of the Grand Jury Proceeding',
'timestamp': 1644080997.164,
'upload_date': '20220205',
}
},
}, {
'url': 'https://gettr.com/streaming/psfmeefcc1',
'info_dict': {
@@ -172,12 +172,12 @@ class GettrStreamingIE(GettrBaseIE):
'duration': 21872.507,
'timestamp': 1643976662.858,
'upload_date': '20220204',
}
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
video_info = self._call_api('live/join/%s' % video_id, video_id, data={})
video_info = self._call_api(f'live/join/{video_id}', video_id, data={})
live_info = video_info['broadcast']
live_url = url_or_none(live_info.get('url'))