mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-17 01:48:29 +00:00
style: Fix ruff linting errors in southpark extractor
This commit is contained in:
parent
25cb416876
commit
7dd2ee0072
@ -1,5 +1,5 @@
|
||||
from .mtv import MTVServicesInfoExtractor
|
||||
from ..utils import random_uuidv4, traverse_obj, ExtractorError
|
||||
from .mtv import MTVServicesInfoExtractor
|
||||
|
||||
|
||||
class SouthParkIE(MTVServicesInfoExtractor):
|
||||
@ -107,10 +107,15 @@ def _real_extract(self, url):
|
||||
data = self._parse_json(self._search_regex(
|
||||
r'window\.__DATA__\s*=\s*({.+?});', webpage, 'data'), display_id)
|
||||
|
||||
video_detail = traverse_obj(data, (
|
||||
'children', lambda _, v: v.get('type') == 'MainContainer',
|
||||
'children', 0, 'children', 0, 'props', 'videoDetail'
|
||||
), ('children', 0, 'videoDetail'), get_all=False,)
|
||||
video_detail = traverse_obj(
|
||||
data,
|
||||
# Path for regular episodes
|
||||
('children', lambda _, v: v.get('type') == 'MainContainer',
|
||||
'children', 0, 'children', 0, 'props', 'videoDetail'),
|
||||
# Fallback path for special episodes
|
||||
('children', 0, 'videoDetail'),
|
||||
get_all=False,
|
||||
)
|
||||
|
||||
if not video_detail:
|
||||
raise ExtractorError('Could not find video data in page')
|
||||
|
Loading…
Reference in New Issue
Block a user