mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-11-21 17:05:13 +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:
@@ -1,7 +1,6 @@
|
||||
import re
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..compat import compat_str
|
||||
from ..utils import (
|
||||
float_or_none,
|
||||
try_get,
|
||||
@@ -167,17 +166,17 @@ class CCTVIE(InfoExtractor):
|
||||
if isinstance(video, dict):
|
||||
for quality, chapters_key in enumerate(('lowChapters', 'chapters')):
|
||||
video_url = try_get(
|
||||
video, lambda x: x[chapters_key][0]['url'], compat_str)
|
||||
video, lambda x: x[chapters_key][0]['url'], str)
|
||||
if video_url:
|
||||
formats.append({
|
||||
'url': video_url,
|
||||
'format_id': 'http',
|
||||
'quality': quality,
|
||||
# Sample clip
|
||||
'preference': -10
|
||||
'preference': -10,
|
||||
})
|
||||
|
||||
hls_url = try_get(data, lambda x: x['hls_url'], compat_str)
|
||||
hls_url = try_get(data, lambda x: x['hls_url'], str)
|
||||
if hls_url:
|
||||
hls_url = re.sub(r'maxbr=\d+&?', '', hls_url)
|
||||
formats.extend(self._extract_m3u8_formats(
|
||||
|
||||
Reference in New Issue
Block a user