aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-03-08 20:47:06 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2013-03-08 20:47:06 +0100
commit3d3423574d35a0fe71062f21dd57ada02a5225b4 (patch)
treeca3ac4bc579cbebbacd39f0bc7ee8f51fdce5cea /youtube_dl
parente5edd51de458d52f3824e6d8fc7c0713659694a4 (diff)
Fix Unicode handling GenericIE (Fixes #734)
Diffstat (limited to 'youtube_dl')
-rwxr-xr-xyoutube_dl/InfoExtractors.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py
index 6b03bf307..baba4a9a2 100755
--- a/youtube_dl/InfoExtractors.py
+++ b/youtube_dl/InfoExtractors.py
@@ -1281,7 +1281,8 @@ class GenericIE(InfoExtractor):
def report_download_webpage(self, video_id):
"""Report webpage download."""
- self._downloader.to_screen(u'WARNING: Falling back on generic information extractor.')
+ if not self._downloader.params.get('test', False):
+ self._downloader.to_screen(u'WARNING: Falling back on generic information extractor.')
self._downloader.to_screen(u'[generic] %s: Downloading webpage' % video_id)
def report_extraction(self, video_id):
@@ -1351,13 +1352,8 @@ class GenericIE(InfoExtractor):
if self._test_redirect(url): return
video_id = url.split('/')[-1]
- request = compat_urllib_request.Request(url)
try:
- self.report_download_webpage(video_id)
- webpage = compat_urllib_request.urlopen(request).read()
- except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
- self._downloader.trouble(u'ERROR: Unable to retrieve video webpage: %s' % compat_str(err))
- return
+ webpage = self._download_webpage(url, video_id)
except ValueError as err:
# since this is the last-resort InfoExtractor, if
# this error is thrown, it'll be thrown here