瀏覽代碼

Fix Escapist IE

Philipp Hagemeister 13 年之前
父節點
當前提交
9ab3406ddb
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      youtube_dl/InfoExtractors.py

+ 2 - 1
youtube_dl/InfoExtractors.py

@@ -2188,11 +2188,12 @@ class EscapistIE(InfoExtractor):
 
 
 		self.report_extraction(showName)
 		self.report_extraction(showName)
 		try:
 		try:
-			webPage = urllib2.urlopen(url).read()
+			webPageBytes = urllib2.urlopen(url).read()
 		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)