[extractor/common] Support HTML media elements without child nodes

pull/8/head
Yen Chi Hsuan 2016-10-12 01:40:28 +08:00
rodzic 55642487f0
commit cea364f70c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 3FDDD575826C5C30
2 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -1802,7 +1802,11 @@ class InfoExtractor(object):
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': {},