aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2012-11-27 15:07:10 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2012-11-27 15:07:10 +0100
commit46cbda0be4bed00122a5cf43e640808e6c32222d (patch)
treeddb5c4ad471bc7e593edfb4cb87ab8c3622a217a /youtube_dl/utils.py
parentfa59f4b6a9df03d1156dd2d274295a7b3d75c059 (diff)
Minor filename encoding improvement in a common case
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 3339f56ec..4ace22c2f 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -218,6 +218,9 @@ def sanitize_filename(s, restricted=False):
while '__' in result:
result = result.replace('__', '_')
result = result.strip('_')
+ # Common case of "Foreign band name - English song title"
+ if restricted and result.startswith('-_'):
+ result = result[2:]
if not result:
result = '_'
return result