From eb976292149135d1e351dfc94e5a0e554647bbaa Mon Sep 17 00:00:00 2001 From: Justin Mai <9123665+justinTM@users.noreply.github.com> Date: Tue, 12 Dec 2017 03:08:05 -0800 Subject: [PATCH] fixed --addtofile duplicate artists (#233) checks for '-' in the title, to avoid adding the uploader before the pre-existing artist eg. avoid this: "uploader - artist - song" --- scdl/scdl.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scdl/scdl.py b/scdl/scdl.py index 215acee..c13cae8 100755 --- a/scdl/scdl.py +++ b/scdl/scdl.py @@ -390,8 +390,9 @@ def try_utime(path, filetime): def get_filename(track, title, is_original = False): invalid_chars = '\/:*?|<>"' username = track['user']['username'] - if username not in title and arguments['--addtofile']: - title = '{0} - {1}'.format(username, title) + if arguments['--addtofile']: + if username not in title and '-' not in title + title = '{0} - {1}'.format(username, title) if arguments['--addtimestamp']: # created_at sample: 2017/03/03 09:29:33 +0000