From 7d4111ed14848c3e72d55d47f11cd7e9fadea403 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Sun, 23 Nov 2014 10:49:19 +0100 Subject: Provide guidance when called with a YouTube ID starting with a dash. Reported at https://news.ycombinator.com/item?id=8648121 --- youtube_dl/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'youtube_dl/utils.py') diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 5be7cf992..c3d8bf8e9 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -41,6 +41,7 @@ from .compat import ( compat_urllib_parse_urlparse, compat_urllib_request, compat_urlparse, + shlex_quote, ) @@ -1433,3 +1434,8 @@ def ytdl_is_updateable(): from zipimport import zipimporter return isinstance(globals().get('__loader__'), zipimporter) or hasattr(sys, 'frozen') + + +def args_to_str(args): + # Get a short string representation for a subprocess command + return ' '.join(shlex_quote(a) for a in args) -- cgit v1.2.3