aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-11-23 10:49:19 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-11-23 10:51:09 +0100
commit7d4111ed14848c3e72d55d47f11cd7e9fadea403 (patch)
treefd583582ca5caf291a12a18a9f9cb3fc61b1b1f8 /youtube_dl/utils.py
parentd37cab2a9d1da8056460613007f3099e7a9d8f7e (diff)
downloadyoutube-dl-7d4111ed14848c3e72d55d47f11cd7e9fadea403.tar.xz
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/utils.py')
-rw-r--r--youtube_dl/utils.py6
1 files changed, 6 insertions, 0 deletions
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)