mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-10 17:18:01 +01:00
Only skip download if files exists; convert audio
This commit is contained in:
parent
ba5059dd66
commit
a5647b79ce
1 changed files with 13 additions and 14 deletions
|
@ -759,10 +759,6 @@ def process_info(self, info_dict):
|
||||||
if filename is None:
|
if filename is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.params.get('nooverwrites', False) and os.path.exists(filename):
|
|
||||||
self.to_stderr(u'WARNING: file exists and will be skipped')
|
|
||||||
return
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dn = os.path.dirname(filename)
|
dn = os.path.dirname(filename)
|
||||||
if dn != '' and not os.path.exists(dn):
|
if dn != '' and not os.path.exists(dn):
|
||||||
|
@ -804,16 +800,19 @@ def process_info(self, info_dict):
|
||||||
return
|
return
|
||||||
|
|
||||||
if not self.params.get('skip_download', False):
|
if not self.params.get('skip_download', False):
|
||||||
try:
|
if self.params.get('nooverwrites', False) and os.path.exists(filename):
|
||||||
success = self._do_download(filename, info_dict)
|
success = True
|
||||||
except (OSError, IOError), err:
|
else:
|
||||||
raise UnavailableVideoError
|
try:
|
||||||
except (urllib2.URLError, httplib.HTTPException, socket.error), err:
|
success = self._do_download(filename, info_dict)
|
||||||
self.trouble(u'ERROR: unable to download video data: %s' % str(err))
|
except (OSError, IOError), err:
|
||||||
return
|
raise UnavailableVideoError
|
||||||
except (ContentTooShortError, ), err:
|
except (urllib2.URLError, httplib.HTTPException, socket.error), err:
|
||||||
self.trouble(u'ERROR: content too short (expected %s bytes and served %s)' % (err.expected, err.downloaded))
|
self.trouble(u'ERROR: unable to download video data: %s' % str(err))
|
||||||
return
|
return
|
||||||
|
except (ContentTooShortError, ), err:
|
||||||
|
self.trouble(u'ERROR: content too short (expected %s bytes and served %s)' % (err.expected, err.downloaded))
|
||||||
|
return
|
||||||
|
|
||||||
if success:
|
if success:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue