diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2012-11-27 15:07:10 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2012-11-27 15:07:10 +0100 |
commit | 46cbda0be4bed00122a5cf43e640808e6c32222d (patch) | |
tree | ddb5c4ad471bc7e593edfb4cb87ab8c3622a217a /youtube_dl/utils.py | |
parent | fa59f4b6a9df03d1156dd2d274295a7b3d75c059 (diff) |
Minor filename encoding improvement in a common case
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 3 |
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 |