aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2015-02-24 11:38:01 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2015-02-24 11:38:01 +0100
commit5a42414b9c4718f83f28fbc0e5a4a01ab67f23f6 (patch)
tree1e4720981c77330b73f491e5c7b4b9f2d304b562 /youtube_dl/utils.py
parent9c665ab72e5fc99989800109cdada5acc3af56c5 (diff)
[utils] Prevent hyphen at beginning of filename (Fixes #5035)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 475fad3c9..e2631dccd 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -304,6 +304,8 @@ def sanitize_filename(s, restricted=False, is_id=False):
# Common case of "Foreign band name - English song title"
if restricted and result.startswith('-_'):
result = result[2:]
+ if result.startswith('-'):
+ result = '_' + result[len('-'):]
if not result:
result = '_'
return result