mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-08-28 20:15:10 +02:00
Improve error message on invalid output template and abort execution
This commit is contained in:
parent
8a9f53bebf
commit
38ed13444a
@ -404,7 +404,8 @@ class FileDownloader(object):
|
|||||||
template_dict['ord'] = unicode('%05d' % self._num_downloads)
|
template_dict['ord'] = unicode('%05d' % self._num_downloads)
|
||||||
filename = self.params['outtmpl'] % template_dict
|
filename = self.params['outtmpl'] % template_dict
|
||||||
except (ValueError, KeyError), err:
|
except (ValueError, KeyError), err:
|
||||||
self.trouble('ERROR: invalid output template or system charset: %s' % str(err))
|
self.trouble(u'ERROR: invalid system charset or erroneous output template')
|
||||||
|
return
|
||||||
if self.params.get('nooverwrites', False) and os.path.exists(filename):
|
if self.params.get('nooverwrites', False) and os.path.exists(filename):
|
||||||
self.to_stderr(u'WARNING: file exists: %s; skipping' % filename)
|
self.to_stderr(u'WARNING: file exists: %s; skipping' % filename)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user