mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-24 05:36:56 +01:00
[extractor/common] Support HTML media elements without child nodes
This commit is contained in:
parent
55642487f0
commit
cea364f70c
@ -1,6 +1,7 @@
|
||||
version <unreleased>
|
||||
|
||||
Core
|
||||
+ Support HTML media elements without child nodes
|
||||
* [Makefile] Support for GNU make < 4 is fixed; BSD make dropped (#9387)
|
||||
|
||||
Extractors
|
||||
|
@ -1802,7 +1802,11 @@ def _media_formats(src, cur_media_type):
|
||||
return is_plain_url, formats
|
||||
|
||||
entries = []
|
||||
for media_tag, media_type, media_content in re.findall(r'(?s)(<(?P<tag>video|audio)[^>]*>)(.*?)</(?P=tag)>', webpage):
|
||||
media_tags = [(media_tag, media_type, '')
|
||||
for media_tag, media_type
|
||||
in re.findall(r'(?s)(<(video|audio)[^>]*/>)', webpage)]
|
||||
media_tags.extend(re.findall(r'(?s)(<(?P<tag>video|audio)[^>]*>)(.*?)</(?P=tag)>', webpage))
|
||||
for media_tag, media_type, media_content in media_tags:
|
||||
media_info = {
|
||||
'formats': [],
|
||||
'subtitles': {},
|
||||
|
Loading…
Reference in New Issue
Block a user