From: Jaime Marquínez Ferrándiz Date: Fri, 20 Sep 2013 11:26:03 +0000 (+0200) Subject: Catch socket.error before IOError X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=c40c6aaaaa80db619459be3bd7f93853da70be0d;p=youtube-dl Catch socket.error before IOError Since python 2.6 it's a child class. --- diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index de2b133e0..d999099fe 100644 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -544,11 +544,11 @@ class YoutubeDL(object): else: try: success = self.fd._do_download(filename, info_dict) - except (OSError, IOError) as err: - raise UnavailableVideoError(err) except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err: self.report_error(u'unable to download video data: %s' % str(err)) return + except (OSError, IOError) as err: + raise UnavailableVideoError(err) except (ContentTooShortError, ) as err: self.report_error(u'content too short (expected %s bytes and served %s)' % (err.expected, err.downloaded)) return