mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
Handle '.' as a time value separator (#301)
This commit is contained in:
@@ -129,7 +129,14 @@ def videotime_from_seconds(time):
|
||||
|
||||
|
||||
def get_sec(time_str):
|
||||
v = time_str.split(':', 3)
|
||||
if ':' in time_str:
|
||||
splitter = ':'
|
||||
elif '.' in time_str:
|
||||
splitter = '.'
|
||||
else:
|
||||
raise ValueError("No expected character found in {} to split"
|
||||
"time values.".format(time_str))
|
||||
v = time_str.split(splitter, 3)
|
||||
v.reverse()
|
||||
sec = 0
|
||||
if len(v) > 0: # seconds
|
||||
|
||||
Reference in New Issue
Block a user