diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py
index 7ce84fe79..6328332a7 100755
--- a/youtube_dl/InfoExtractors.py
+++ b/youtube_dl/InfoExtractors.py
@@ -388,13 +388,13 @@ class YoutubeIE(InfoExtractor):
self.report_age_confirmation()
age_results = compat_urllib_request.urlopen(request).read().decode('utf-8')
except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
- self._downloader.trouble(u'ERROR: unable to confirm age: %s' % compat_str(err))
+ self._downloader.report_error(u'unable to confirm age: %s' % compat_str(err))
return
def _extract_id(self, url):
mobj = re.match(self._VALID_URL, url, re.VERBOSE)
if mobj is None:
- self._downloader.trouble(u'ERROR: invalid URL: %s' % url)
+ self._downloader.report_error(u'invalid URL: %s' % url)
return
video_id = mobj.group(2)
return video_id
@@ -413,7 +413,7 @@ class YoutubeIE(InfoExtractor):
try:
video_webpage_bytes = 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 download video webpage: %s' % compat_str(err))
+ self._downloader.report_error(u'unable to download video webpage: %s' % compat_str(err))
return
video_webpage = video_webpage_bytes.decode('utf-8', 'ignore')
@@ -438,18 +438,18 @@ class YoutubeIE(InfoExtractor):
if 'token' in video_info:
break
except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
- self._downloader.trouble(u'ERROR: unable to download video info webpage: %s' % compat_str(err))
+ self._downloader.report_error(u'unable to download video info webpage: %s' % compat_str(err))
return
if 'token' not in video_info:
if 'reason' in video_info:
- self._downloader.trouble(u'ERROR: YouTube said: %s' % video_info['reason'][0])
+ self._downloader.report_error(u'YouTube said: %s' % video_info['reason'][0])
else:
- self._downloader.trouble(u'ERROR: "token" parameter not in video info for unknown reason')
+ self._downloader.report_error(u'"token" parameter not in video info for unknown reason')
return
# Check for "rental" videos
if 'ypc_video_rental_bar_text' in video_info and 'author' not in video_info:
- self._downloader.trouble(u'ERROR: "rental" videos not supported')
+ self._downloader.report_error(u'"rental" videos not supported')
return
# Start extracting information
@@ -457,7 +457,7 @@ class YoutubeIE(InfoExtractor):
# uploader
if 'author' not in video_info:
- self._downloader.trouble(u'ERROR: unable to extract uploader name')
+ self._downloader.report_error(u'unable to extract uploader name')
return
video_uploader = compat_urllib_parse.unquote_plus(video_info['author'][0])
@@ -471,7 +471,7 @@ class YoutubeIE(InfoExtractor):
# title
if 'title' not in video_info:
- self._downloader.trouble(u'ERROR: unable to extract video title')
+ self._downloader.report_error(u'unable to extract video title')
return
video_title = compat_urllib_parse.unquote_plus(video_info['title'][0])
@@ -537,7 +537,7 @@ class YoutubeIE(InfoExtractor):
format_list = available_formats
existing_formats = [x for x in format_list if x in url_map]
if len(existing_formats) == 0:
- self._downloader.trouble(u'ERROR: no known formats available for video')
+ self._downloader.report_error(u'no known formats available for video')
return
if self._downloader.params.get('listformats', None):
self._print_formats(existing_formats)
@@ -558,10 +558,10 @@ class YoutubeIE(InfoExtractor):
video_url_list = [(rf, url_map[rf])]
break
if video_url_list is None:
- self._downloader.trouble(u'ERROR: requested format not available')
+ self._downloader.report_error(u'requested format not available')
return
else:
- self._downloader.trouble(u'ERROR: no conn or url_encoded_fmt_stream_map information found in video info')
+ self._downloader.report_error(u'no conn or url_encoded_fmt_stream_map information found in video info')
return
results = []
@@ -624,7 +624,7 @@ class MetacafeIE(InfoExtractor):
self.report_disclaimer()
disclaimer = 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 disclaimer: %s' % compat_str(err))
+ self._downloader.report_error(u'unable to retrieve disclaimer: %s' % compat_str(err))
return
# Confirm age
@@ -637,14 +637,14 @@ class MetacafeIE(InfoExtractor):
self.report_age_confirmation()
disclaimer = 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 confirm age: %s' % compat_str(err))
+ self._downloader.report_error(u'unable to confirm age: %s' % compat_str(err))
return
def _real_extract(self, url):
# Extract id and simplified title from URL
mobj = re.match(self._VALID_URL, url)
if mobj is None:
- self._downloader.trouble(u'ERROR: invalid URL: %s' % url)
+ self._downloader.report_error(u'invalid URL: %s' % url)
return
video_id = mobj.group(1)
@@ -661,7 +661,7 @@ class MetacafeIE(InfoExtractor):
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 retrieve video webpage: %s' % compat_str(err))
+ self._downloader.report_error(u'unable retrieve video webpage: %s' % compat_str(err))
return
# Extract URL, uploader and title from webpage
@@ -681,15 +681,15 @@ class MetacafeIE(InfoExtractor):
else:
mobj = re.search(r' name="flashvars" value="(.*?)"', webpage)
if mobj is None:
- self._downloader.trouble(u'ERROR: unable to extract media URL')
+ self._downloader.report_error(u'unable to extract media URL')
return
vardict = compat_parse_qs(mobj.group(1))
if 'mediaData' not in vardict:
- self._downloader.trouble(u'ERROR: unable to extract media URL')
+ self._downloader.report_error(u'unable to extract media URL')
return
mobj = re.search(r'"mediaURL":"(http.*?)","key":"(.*?)"', vardict['mediaData'][0])
if mobj is None:
- self._downloader.trouble(u'ERROR: unable to extract media URL')
+ self._downloader.report_error(u'unable to extract media URL')
return
mediaURL = mobj.group(1).replace('\\/', '/')
video_extension = mediaURL[-3:]
@@ -697,13 +697,13 @@ class MetacafeIE(InfoExtractor):
mobj = re.search(r'(?im)
(.*) - Video', webpage)
if mobj is None:
- self._downloader.trouble(u'ERROR: unable to extract title')
+ self._downloader.report_error(u'unable to extract title')
return
video_title = mobj.group(1).decode('utf-8')
mobj = re.search(r'submitter=(.*?);', webpage)
if mobj is None:
- self._downloader.trouble(u'ERROR: unable to extract uploader nickname')
+ self._downloader.report_error(u'unable to extract uploader nickname')
return
video_uploader = mobj.group(1)
@@ -735,7 +735,7 @@ class DailymotionIE(InfoExtractor):
# Extract id and simplified title from URL
mobj = re.match(self._VALID_URL, url)
if mobj is None:
- self._downloader.trouble(u'ERROR: invalid URL: %s' % url)
+ self._downloader.report_error(u'invalid URL: %s' % url)
return
video_id = mobj.group(1).split('_')[0].split('?')[0]
@@ -751,7 +751,7 @@ class DailymotionIE(InfoExtractor):
self.report_extraction(video_id)
mobj = re.search(r'\s*var flashvars = (.*)', webpage)
if mobj is None:
- self._downloader.trouble(u'ERROR: unable to extract media URL')
+ self._downloader.report_error(u'unable to extract media URL')
return
flashvars = compat_urllib_parse.unquote(mobj.group(1))
@@ -761,12 +761,12 @@ class DailymotionIE(InfoExtractor):
self._downloader.to_screen(u'[dailymotion] Using %s' % key)
break
else:
- self._downloader.trouble(u'ERROR: unable to extract video URL')
+ self._downloader.report_error(u'unable to extract video URL')
return
mobj = re.search(r'"' + max_quality + r'":"(.+?)"', flashvars)
if mobj is None:
- self._downloader.trouble(u'ERROR: unable to extract video URL')
+ self._downloader.report_error(u'unable to extract video URL')
return
video_url = compat_urllib_parse.unquote(mobj.group(1)).replace('\\/', '/')
@@ -775,7 +775,7 @@ class DailymotionIE(InfoExtractor):
mobj = re.search(r'', webpage)
if mobj is None:
- self._downloader.trouble(u'ERROR: unable to extract title')
+ self._downloader.report_error(u'unable to extract title')
return
video_title = unescapeHTML(mobj.group('title'))
@@ -827,7 +827,7 @@ class PhotobucketIE(InfoExtractor):
# Extract id from URL
mobj = re.match(self._VALID_URL, url)
if mobj is None:
- self._downloader.trouble(u'ERROR: Invalid URL: %s' % url)
+ self._downloader.report_error(u'Invalid URL: %s' % url)
return
video_id = mobj.group(1)
@@ -840,14 +840,14 @@ class PhotobucketIE(InfoExtractor):
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))
+ self._downloader.report_error(u'Unable to retrieve video webpage: %s' % compat_str(err))
return
# Extract URL, uploader, and title from webpage
self.report_extraction(video_id)
mobj = re.search(r'', webpage)
if mobj is None:
- self._downloader.trouble(u'ERROR: unable to extract media URL')
+ self._downloader.report_error(u'unable to extract media URL')
return
mediaURL = compat_urllib_parse.unquote(mobj.group(1))
@@ -855,7 +855,7 @@ class PhotobucketIE(InfoExtractor):
mobj = re.search(r'(.*) video by (.*) - Photobucket', webpage)
if mobj is None:
- self._downloader.trouble(u'ERROR: unable to extract title')
+ self._downloader.report_error(u'unable to extract title')
return
video_title = mobj.group(1).decode('utf-8')
@@ -896,7 +896,7 @@ class YahooIE(InfoExtractor):
# Extract ID from URL
mobj = re.match(self._VALID_URL, url)
if mobj is None:
- self._downloader.trouble(u'ERROR: Invalid URL: %s' % url)
+ self._downloader.report_error(u'Invalid URL: %s' % url)
return
video_id = mobj.group(2)
@@ -909,18 +909,18 @@ class YahooIE(InfoExtractor):
try:
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))
+ self._downloader.report_error(u'Unable to retrieve video webpage: %s' % compat_str(err))
return
mobj = re.search(r'\("id", "([0-9]+)"\);', webpage)
if mobj is None:
- self._downloader.trouble(u'ERROR: Unable to extract id field')
+ self._downloader.report_error(u'Unable to extract id field')
return
yahoo_id = mobj.group(1)
mobj = re.search(r'\("vid", "([0-9]+)"\);', webpage)
if mobj is None:
- self._downloader.trouble(u'ERROR: Unable to extract vid field')
+ self._downloader.report_error(u'Unable to extract vid field')
return
yahoo_vid = mobj.group(1)
@@ -933,34 +933,34 @@ class YahooIE(InfoExtractor):
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))
+ self._downloader.report_error(u'Unable to retrieve video webpage: %s' % compat_str(err))
return
# Extract uploader and title from webpage
self.report_extraction(video_id)
mobj = re.search(r'', webpage)
if mobj is None:
- self._downloader.trouble(u'ERROR: unable to extract video title')
+ self._downloader.report_error(u'unable to extract video title')
return
video_title = mobj.group(1).decode('utf-8')
mobj = re.search(r'