[comedycentral] Add support for /videos URLs (Fixes #2660)
authorPhilipp Hagemeister <phihag@phihag.de>
Mon, 31 Mar 2014 22:02:29 +0000 (00:02 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Mon, 31 Mar 2014 22:02:32 +0000 (00:02 +0200)
test/test_all_urls.py
youtube_dl/extractor/comedycentral.py

index 5b6d18a8296da5d9584cf585ef0cd495eef6a2b2..dffe3f95854d965bac5746cd7f741fd5cc4601da 100644 (file)
@@ -144,7 +144,12 @@ class TestAllURLsMatching(unittest.TestCase):
         self.assertMatch('http://video.pbs.org/widget/partnerplayer/980042464/', ['PBS'])
 
     def test_ComedyCentralShows(self):
-        self.assertMatch('http://thedailyshow.cc.com/extended-interviews/xm3fnq/andrew-napolitano-extended-interview', ['ComedyCentralShows'])
+        self.assertMatch(
+            'http://thedailyshow.cc.com/extended-interviews/xm3fnq/andrew-napolitano-extended-interview',
+            ['ComedyCentralShows'])
+        self.assertMatch(
+            'http://thecolbertreport.cc.com/videos/29w6fx/-realhumanpraise-for-fox-news',
+            ['ComedyCentralShows'])
 
 if __name__ == '__main__':
     unittest.main()
index 60c0a4f5dbc3c98468a184195e03dd39da299e95..cbc212065cf9635a2b23fe8d5536f88fcb2f05ea 100644 (file)
@@ -43,7 +43,8 @@ class ComedyCentralShowsIE(InfoExtractor):
                           (?P<showname>thedailyshow|thecolbertreport)\.(?:cc\.)?com/
                          (full-episodes/(?P<episode>.*)|
                           (?P<clip>
-                              (the-colbert-report-(videos|collections)/(?P<clipID>[0-9]+)/[^/]*/(?P<cntitle>.*?))
+                              (?:videos/[^/]+/(?P<videotitle>[^/?#]+))
+                              |(the-colbert-report-(videos|collections)/(?P<clipID>[0-9]+)/[^/]*/(?P<cntitle>.*?))
                               |(watch/(?P<date>[^/]*)/(?P<tdstitle>.*)))|
                           (?P<interview>
                               extended-interviews/(?P<interID>[0-9a-z]+)/(?:playlist_tds_extended_)?(?P<interview_title>.*?)(/.*?)?)))
@@ -102,7 +103,9 @@ class ComedyCentralShowsIE(InfoExtractor):
             assert mobj is not None
 
         if mobj.group('clip'):
-            if mobj.group('showname') == 'thedailyshow':
+            if mobj.group('videotitle'):
+                epTitle = mobj.group('videotitle')
+            elif mobj.group('showname') == 'thedailyshow':
                 epTitle = mobj.group('tdstitle')
             else:
                 epTitle = mobj.group('cntitle')