fix windows special characters

master
e2del 2016-04-24 16:42:41 +00:00
parent a117ff4d2e
commit 3484679002
1 changed files with 3 additions and 2 deletions

View File

@ -357,13 +357,14 @@ def download_track(track, playlist_name=None, playlist_file=None):
d = r.headers['content-disposition']
filename = re.findall("filename=(.+)", d)[0][1:-1]
else:
invalid_chars = '\/:*?|<>"'
username = track['user']['username']
if username not in title and arguments['--addtofile']:
title = '{0} - {1}'.format(username, title)
title = ''.join(c for c in title if c not in invalid_chars)
filename = title + '.mp3'
invalid_chars = '\/:*?|<>"'
filename = ''.join(c for c in filename if c not in invalid_chars)
logger.debug("filename : {0}".format(filename))
# Add the track to the generated m3u playlist file
if playlist_file: