diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-11-23 10:49:19 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-11-23 10:51:09 +0100 |
commit | 7d4111ed14848c3e72d55d47f11cd7e9fadea403 (patch) | |
tree | fd583582ca5caf291a12a18a9f9cb3fc61b1b1f8 /youtube_dl/__init__.py | |
parent | d37cab2a9d1da8056460613007f3099e7a9d8f7e (diff) |
Provide guidance when called with a YouTube ID starting with a dash.
Reported at https://news.ycombinator.com/item?id=8648121
Diffstat (limited to 'youtube_dl/__init__.py')
-rw-r--r-- | youtube_dl/__init__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index c1323b4f3..f519fae3e 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -334,11 +334,12 @@ def _real_main(argv=None): # Maybe do nothing if (len(all_urls) < 1) and (opts.load_info_filename is None): - if not (opts.update_self or opts.rm_cachedir): - parser.error('you must provide at least one URL') - else: + if opts.update_self or opts.rm_cachedir: sys.exit() + ydl.warn_if_short_id(sys.argv[1:] if argv is None else argv) + parser.error('you must provide at least one URL') + try: if opts.load_info_filename is not None: retcode = ydl.download_with_info_file(opts.load_info_filename) |