mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-12-23 04:30:10 +09:00
[chelseafc] improve regex
This commit is contained in:
parent
b478a0ac3f
commit
ceaa2c78fa
@ -43,12 +43,17 @@ class ChelseafcIE(InfoExtractor):
|
|||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
raw_data = self._html_search_regex(
|
video_details_div = self._search_regex(
|
||||||
# TODO improve regex
|
r'(<div[^>]*\sdata-component\s*=\s*(?:"|\')\s*VideoDetails\s*(?:"|\')[^>]*>)',
|
||||||
r'(?:<div[^>]+(?:data-component="VideoDetails".*?)+data-props="([^"]*))',
|
|
||||||
webpage,
|
webpage,
|
||||||
|
'div'
|
||||||
|
)
|
||||||
|
raw_data = self._html_search_regex(
|
||||||
|
r'<div[^>]*\sdata-props\s*=\s*(?:"|\')\s*([^"\']*)\s*(?:"|\')[^>]*>',
|
||||||
|
video_details_div,
|
||||||
'data'
|
'data'
|
||||||
)
|
)
|
||||||
|
|
||||||
data = json.loads(raw_data)['videoDetail']
|
data = json.loads(raw_data)['videoDetail']
|
||||||
|
|
||||||
manifest_url = data['signedUrl']
|
manifest_url = data['signedUrl']
|
||||||
|
Loading…
Reference in New Issue
Block a user