]> gitweb @ CieloNegro.org - youtube-dl.git/blobdiff - youtube_dl/extractor/comedycentral.py
[roxwel] Modernize
[youtube-dl.git] / youtube_dl / extractor / comedycentral.py
index 346ecded62c9278e37f059afa5ab4f91f27b850d..60c0a4f5dbc3c98468a184195e03dd39da299e95 100644 (file)
@@ -8,7 +8,7 @@ from ..utils import (
     compat_str,
     compat_urllib_parse,
     ExtractorError,
-    int_or_none,
+    float_or_none,
     unified_strdate,
 )
 
@@ -46,7 +46,7 @@ class ComedyCentralShowsIE(InfoExtractor):
                               (the-colbert-report-(videos|collections)/(?P<clipID>[0-9]+)/[^/]*/(?P<cntitle>.*?))
                               |(watch/(?P<date>[^/]*)/(?P<tdstitle>.*)))|
                           (?P<interview>
-                              extended-interviews/(?P<interID>[0-9]+)/playlist_tds_extended_(?P<interview_title>.*?)/.*?)))
+                              extended-interviews/(?P<interID>[0-9a-z]+)/(?:playlist_tds_extended_)?(?P<interview_title>.*?)(/.*?)?)))
                      $'''
     _TEST = {
         'url': 'http://thedailyshow.cc.com/watch/thu-december-13-2012/kristen-stewart',
@@ -134,7 +134,7 @@ class ComedyCentralShowsIE(InfoExtractor):
             # a URL prefix; so extract the alternate reference
             # and then add the URL prefix manually.
 
-            altMovieParams = re.findall('data-mgid="([^"]*(?:episode|video).*?:.*?)"', webpage)
+            altMovieParams = re.findall('data-mgid="([^"]*(?:episode|video|playlist).*?:.*?)"', webpage)
             if len(altMovieParams) == 0:
                 raise ExtractorError('unable to find Flash URL in webpage ' + url)
             else:
@@ -159,7 +159,7 @@ class ComedyCentralShowsIE(InfoExtractor):
             thumbnail = itemEl.find('.//{http://search.yahoo.com/mrss/}thumbnail').attrib.get('url')
 
             content = itemEl.find('.//{http://search.yahoo.com/mrss/}content')
-            duration = int_or_none(content.attrib.get('duration'))
+            duration = float_or_none(content.attrib.get('duration'))
             mediagen_url = content.attrib['url']
             guid = itemEl.find('.//guid').text.rpartition(':')[-1]
 
@@ -191,7 +191,7 @@ class ComedyCentralShowsIE(InfoExtractor):
                 })
                 self._sort_formats(formats)
 
-            virtual_id = show_name + '-' + epTitle + ' part ' + compat_str(part_num + 1)
+            virtual_id = show_name + ' ' + epTitle + ' part ' + compat_str(part_num + 1)
             entries.append({
                 'id': guid,
                 'title': virtual_id,
@@ -206,6 +206,6 @@ class ComedyCentralShowsIE(InfoExtractor):
         return {
             '_type': 'playlist',
             'entries': entries,
-            'title': title,
+            'title': show_name + ' ' + title,
             'description': description,
         }