mirror of https://github.com/yt-dlp/yt-dlp.git
Use unicode strings for several error messages that were missing the "u"
This commit is contained in:
parent
d67e097462
commit
db7e31b853
14
youtube-dl
14
youtube-dl
|
@ -413,7 +413,7 @@ class FileDownloader(object):
|
||||||
try:
|
try:
|
||||||
self.pmkdir(filename)
|
self.pmkdir(filename)
|
||||||
except (OSError, IOError), err:
|
except (OSError, IOError), err:
|
||||||
self.trouble('ERROR: unable to create directories: %s' % str(err))
|
self.trouble(u'ERROR: unable to create directories: %s' % str(err))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -421,17 +421,17 @@ class FileDownloader(object):
|
||||||
except (OSError, IOError), err:
|
except (OSError, IOError), err:
|
||||||
raise UnavailableVideoError
|
raise UnavailableVideoError
|
||||||
except (urllib2.URLError, httplib.HTTPException, socket.error), err:
|
except (urllib2.URLError, httplib.HTTPException, socket.error), err:
|
||||||
self.trouble('ERROR: unable to download video data: %s' % str(err))
|
self.trouble(u'ERROR: unable to download video data: %s' % str(err))
|
||||||
return
|
return
|
||||||
except (ContentTooShortError, ), err:
|
except (ContentTooShortError, ), err:
|
||||||
self.trouble('ERROR: content too short (expected %s bytes and served %s)' % (err.expected, err.downloaded))
|
self.trouble(u'ERROR: content too short (expected %s bytes and served %s)' % (err.expected, err.downloaded))
|
||||||
return
|
return
|
||||||
|
|
||||||
if success:
|
if success:
|
||||||
try:
|
try:
|
||||||
self.post_process(filename, info_dict)
|
self.post_process(filename, info_dict)
|
||||||
except (PostProcessingError), err:
|
except (PostProcessingError), err:
|
||||||
self.trouble('ERROR: postprocessing: %s' % str(err))
|
self.trouble(u'ERROR: postprocessing: %s' % str(err))
|
||||||
return
|
return
|
||||||
|
|
||||||
def download(self, url_list):
|
def download(self, url_list):
|
||||||
|
@ -456,7 +456,7 @@ class FileDownloader(object):
|
||||||
break
|
break
|
||||||
|
|
||||||
if not suitable_found:
|
if not suitable_found:
|
||||||
self.trouble('ERROR: no suitable InfoExtractor: %s' % url)
|
self.trouble(u'ERROR: no suitable InfoExtractor: %s' % url)
|
||||||
|
|
||||||
return self._download_retcode
|
return self._download_retcode
|
||||||
|
|
||||||
|
@ -496,7 +496,7 @@ class FileDownloader(object):
|
||||||
self.to_stdout(u'\r[rtmpdump] %s bytes' % os.path.getsize(filename))
|
self.to_stdout(u'\r[rtmpdump] %s bytes' % os.path.getsize(filename))
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
self.trouble('\nERROR: rtmpdump exited with code %d' % retval)
|
self.trouble(u'\nERROR: rtmpdump exited with code %d' % retval)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _do_download(self, filename, url, player_url):
|
def _do_download(self, filename, url, player_url):
|
||||||
|
@ -589,7 +589,7 @@ class FileDownloader(object):
|
||||||
(stream, filename) = sanitize_open(filename, open_mode)
|
(stream, filename) = sanitize_open(filename, open_mode)
|
||||||
self.report_destination(filename)
|
self.report_destination(filename)
|
||||||
except (OSError, IOError), err:
|
except (OSError, IOError), err:
|
||||||
self.trouble('ERROR: unable to open for writing: %s' % str(err))
|
self.trouble(u'ERROR: unable to open for writing: %s' % str(err))
|
||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
stream.write(data_block)
|
stream.write(data_block)
|
||||||
|
|
Loading…
Reference in New Issue