[mtv] Fix non-hls extraction
authorSergey M․ <dstftw@gmail.com>
Tue, 10 Jan 2017 15:27:23 +0000 (22:27 +0700)
committerSergey M․ <dstftw@gmail.com>
Tue, 10 Jan 2017 15:27:23 +0000 (22:27 +0700)
method attribute may not be present

youtube_dl/extractor/mtv.py

index 49c192e1aaaba786e032169e242ee7b08c0a36a7..7c45c77386f594bd3e3e589d9a8e57d5c332ab9c 100644 (file)
@@ -88,7 +88,7 @@ class MTVServicesInfoExtractor(InfoExtractor):
 
         formats = []
         for rendition in mdoc.findall('.//rendition'):
-            if rendition.attrib['method'] == 'hls':
+            if rendition.get('method') == 'hls':
                 hls_url = rendition.find('./src').text
                 formats.extend(self._extract_m3u8_formats(hls_url, video_id, ext='mp4'))
             else: