mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-24 13:46:53 +01:00
Avoid using Unicode strings when forming URL requests (fixes issue #50)
This commit is contained in:
parent
f94b636c3e
commit
f5a5bec351
@ -309,7 +309,7 @@ class FileDownloader(object):
|
|||||||
# Do nothing else if in simulate mode
|
# Do nothing else if in simulate mode
|
||||||
if self.params.get('simulate', False):
|
if self.params.get('simulate', False):
|
||||||
try:
|
try:
|
||||||
info_dict['url'] = self.verify_url(info_dict['url'])
|
info_dict['url'] = self.verify_url(info_dict['url'].encode('utf-8')).decode('utf-8')
|
||||||
except (OSError, IOError, urllib2.URLError, httplib.HTTPException, socket.error), err:
|
except (OSError, IOError, urllib2.URLError, httplib.HTTPException, socket.error), err:
|
||||||
raise UnavailableFormatError
|
raise UnavailableFormatError
|
||||||
|
|
||||||
@ -338,7 +338,7 @@ class FileDownloader(object):
|
|||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
success = self._do_download(filename, info_dict['url'])
|
success = self._do_download(filename, info_dict['url'].encode('utf-8'))
|
||||||
except (OSError, IOError), err:
|
except (OSError, IOError), err:
|
||||||
raise UnavailableFormatError
|
raise UnavailableFormatError
|
||||||
except (urllib2.URLError, httplib.HTTPException, socket.error), err:
|
except (urllib2.URLError, httplib.HTTPException, socket.error), err:
|
||||||
|
Loading…
Reference in New Issue
Block a user