aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorChristopher Neugebauer <chrisjrn@gmail.com>2012-11-27 23:54:43 +1100
committerChristopher Neugebauer <chrisjrn@gmail.com>2012-11-27 23:54:43 +1100
commit4a702f381924476511d1d73d2de15b272332f27b (patch)
tree75d4a018207b6ab4884e47bb308ce8409ef5d13e /youtube_dl
parentfeb22fe5fe55f51a72af6ef4207dba95c6da1fda (diff)
Fixes the InfoExtractor for the Colbert Report.
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/InfoExtractors.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py
index 64383fea4..e9d8ad5b3 100644
--- a/youtube_dl/InfoExtractors.py
+++ b/youtube_dl/InfoExtractors.py
@@ -2332,10 +2332,19 @@ class ComedyCentralIE(InfoExtractor):
epTitle = mobj.group('episode')
mMovieParams = re.findall('(?:<param name="movie" value="|var url = ")(http://media.mtvnservices.com/([^"]*episode.*?:.*?))"', html)
+
if len(mMovieParams) == 0:
- self._downloader.trouble(u'ERROR: unable to find Flash URL in webpage ' + url)
- return
+ # The Colbert Report embeds the information in a without
+ # a URL prefix; so extract the alternate reference
+ # and then add the URL prefix manually.
+ altMovieParams = re.findall('data-mgid="([^"]*episode.*?:.*?)"', html)
+ if len(altMovieParams) == 0:
+ self._downloader.trouble(u'ERROR: unable to find Flash URL in webpage ' + url)
+ return
+ else:
+ mMovieParams = [("http://media.mtvnservices.com/" + altMovieParams[0], altMovieParams[0])]
+
playerUrl_raw = mMovieParams[0][0]
self.report_player_url(epTitle)
try: