diff options
author | Sergey M․ <dstftw@gmail.com> | 2016-02-06 19:35:32 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-02-06 19:35:32 +0600 |
commit | 1b840245bdcc7789f996c9bb163af79efbebc813 (patch) | |
tree | 228f5e84dae55f3cd983d839608320a501179d1d /youtube_dl | |
parent | 6a3828fddd6f6cec28ec8676bcc3918d583db77c (diff) |
[extractor/generic] Detect DASH manifests and extract mpd formats
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/generic.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index 4c2c76dc5..6b52e75dc 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -1291,7 +1291,7 @@ class GenericIE(InfoExtractor): self.report_extraction(video_id) - # Is it an RSS feed, a SMIL file or a XSPF playlist? + # Is it an RSS feed, a SMIL file, an XSPF playlist or a MPD manifest? try: doc = compat_etree_fromstring(webpage.encode('utf-8')) if doc.tag == 'rss': @@ -1300,6 +1300,12 @@ class GenericIE(InfoExtractor): return self._parse_smil(doc, url, video_id) elif doc.tag == '{http://xspf.org/ns/0/}playlist': return self.playlist_result(self._parse_xspf(doc, video_id), video_id) + elif re.match(r'(?i)^(?:{[^}]+})?MPD$', doc.tag): + return { + 'id': video_id, + 'title': compat_urllib_parse_unquote(os.path.splitext(url_basename(url))[0]), + 'formats': self._parse_mpd_formats(doc, video_id), + } except compat_xml_parse_error: pass |