mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-12-23 12:40:11 +09:00
Fix EscapistMagazine IE
This commit is contained in:
parent
cca4828ac9
commit
3210735c49
@ -2193,12 +2193,14 @@ class EscapistIE(InfoExtractor):
|
|||||||
|
|
||||||
self.report_extraction(showName)
|
self.report_extraction(showName)
|
||||||
try:
|
try:
|
||||||
webPageBytes = urllib2.urlopen(url).read()
|
webPage = urllib2.urlopen(url)
|
||||||
|
webPageBytes = webPage.read()
|
||||||
|
m = re.match(r'text/html; charset="?([^"]+)"?', webPage.headers['Content-Type'])
|
||||||
|
webPage = webPageBytes.decode(m.group(1) if m else 'utf-8')
|
||||||
except (urllib2.URLError, httplib.HTTPException, socket.error), err:
|
except (urllib2.URLError, httplib.HTTPException, socket.error), err:
|
||||||
self._downloader.trouble(u'ERROR: unable to download webpage: ' + unicode(err))
|
self._downloader.trouble(u'ERROR: unable to download webpage: ' + unicode(err))
|
||||||
return
|
return
|
||||||
|
|
||||||
webPage = webPageBytes.decode('utf-8')
|
|
||||||
descMatch = re.search('<meta name="description" content="([^"]*)"', webPage)
|
descMatch = re.search('<meta name="description" content="([^"]*)"', webPage)
|
||||||
description = unescapeHTML(descMatch.group(1))
|
description = unescapeHTML(descMatch.group(1))
|
||||||
imgMatch = re.search('<meta property="og:image" content="([^"]*)"', webPage)
|
imgMatch = re.search('<meta property="og:image" content="([^"]*)"', webPage)
|
||||||
|
Loading…
Reference in New Issue
Block a user