[teamcoco] Use determine_ext to determine the video type
authorYen Chi Hsuan <yan12125@gmail.com>
Wed, 27 May 2015 06:51:18 +0000 (14:51 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Wed, 27 May 2015 06:51:18 +0000 (14:51 +0800)
Some videos does not contain a 'type' field (#5798)

youtube_dl/extractor/teamcoco.py

index 56be526383b590d9b00759400a269d5164beef2f..b2a4b1fc05430558ad9b33a9aa3ce834107dc6e3 100644 (file)
@@ -10,6 +10,7 @@ from .common import InfoExtractor
 from ..utils import (
     ExtractorError,
     qualities,
+    determine_ext,
 )
 from ..compat import compat_ord
 
@@ -108,7 +109,7 @@ class TeamcocoIE(InfoExtractor):
         formats = []
         get_quality = qualities(['500k', '480p', '1000k', '720p', '1080p'])
         for filed in data['files']:
-            if filed['type'] == 'hls':
+            if determine_ext(filed['url']) == 'm3u8':
                 formats.extend(self._extract_m3u8_formats(
                     filed['url'], video_id, ext='mp4'))
             else: