projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
feb22fe
)
Fixes the InfoExtractor for the Colbert Report.
author
Christopher Neugebauer
<chrisjrn@gmail.com>
Tue, 27 Nov 2012 12:54:43 +0000
(23:54 +1100)
committer
Christopher Neugebauer
<chrisjrn@gmail.com>
Tue, 27 Nov 2012 12:54:43 +0000
(23:54 +1100)
youtube_dl/InfoExtractors.py
patch
|
blob
|
history
diff --git
a/youtube_dl/InfoExtractors.py
b/youtube_dl/InfoExtractors.py
index 64383fea41ba0a14e132f5200e7675b048528bb4..e9d8ad5b3968966630a72e25ba5e1b36f2a50e53 100644
(file)
--- 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)
epTitle = mobj.group('episode')
mMovieParams = re.findall('(?:<param name="movie" value="|var url = ")(http://media.mtvnservices.com/([^"]*episode.*?:.*?))"', html)
+
if len(mMovieParams) == 0:
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:
playerUrl_raw = mMovieParams[0][0]
self.report_player_url(epTitle)
try: