Handle '.' as a time value separator (#301)

This commit is contained in:
Ritiek Malhotra
2018-07-04 18:27:14 +05:30
committed by GitHub
parent 0a3b7bd7d8
commit eb96aa8c13
2 changed files with 39 additions and 2 deletions

View File

@@ -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