mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
fix ComedyCentral IE in Python3
This commit is contained in:
parent
7717ae19fa
commit
9314810243
1 changed files with 3 additions and 2 deletions
|
@ -2404,6 +2404,7 @@ def _real_extract(self, url):
|
|||
try:
|
||||
htmlHandle = compat_urllib_request.urlopen(req)
|
||||
html = htmlHandle.read()
|
||||
webpage = html.decode('utf-8')
|
||||
except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
|
||||
self._downloader.trouble(u'ERROR: unable to download webpage: %s' % compat_str(err))
|
||||
return
|
||||
|
@ -2418,14 +2419,14 @@ def _real_extract(self, url):
|
|||
return
|
||||
epTitle = mobj.group('episode')
|
||||
|
||||
mMovieParams = re.findall('(?:<param name="movie" value="|var url = ")(http://media.mtvnservices.com/([^"]*(?:episode|video).*?:.*?))"', html)
|
||||
mMovieParams = re.findall('(?:<param name="movie" value="|var url = ")(http://media.mtvnservices.com/([^"]*(?:episode|video).*?:.*?))"', webpage)
|
||||
|
||||
if len(mMovieParams) == 0:
|
||||
# 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|video).*?:.*?)"', html)
|
||||
altMovieParams = re.findall('data-mgid="([^"]*(?:episode|video).*?:.*?)"', webpage)
|
||||
if len(altMovieParams) == 0:
|
||||
self._downloader.trouble(u'ERROR: unable to find Flash URL in webpage ' + url)
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue