From a251a82a9a501f43b346128d5df86bdfe37b4ab0 Mon Sep 17 00:00:00 2001 From: George Pchelkin Date: Sun, 15 Dec 2019 20:24:12 +0200 Subject: [PATCH] Fix --addtimestamp and already downloaded fail (#295) * fix addtimestamp option strptime template (same as other strptime occurences) * fix already_downloaded behaviour for hls (same as in other functions) --- scdl/scdl.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scdl/scdl.py b/scdl/scdl.py index 7920e68..6abbbc8 100755 --- a/scdl/scdl.py +++ b/scdl/scdl.py @@ -416,9 +416,9 @@ def get_filename(track, original_filename=None): logger.debug('Adding "{0}" to filename'.format(username)) if arguments['--addtimestamp']: - # created_at sample: 2017/03/03 09:29:33 +0000 + # created_at sample: 2019-01-30T11:11:37Z ts = datetime\ - .strptime(track['created_at'], "%Y/%m/%d %H:%M:%S %z")\ + .strptime(track['created_at'], "%Y-%m-%dT%H:%M:%SZ")\ .timestamp() title = str(int(ts)) + "_" + title @@ -506,7 +506,7 @@ def download_hls_mp3(track, title): # Skip if file ID or filename already exists if already_downloaded(track, title, filename): - return + return filename # Get the requests stream url = get_track_m3u8(track)