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)master
parent
30968bc5a1
commit
a251a82a9a
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue