mirror of
https://github.com/glomatico/gamdl.git
synced 2025-01-22 11:18:39 +00:00
round lrc time
This commit is contained in:
parent
f5696fee3e
commit
83496c5df8
9
gamdl.py
9
gamdl.py
@ -202,9 +202,12 @@ class Gamdl:
|
||||
m = int(unformatted_time.split('.')[-2].split(':')[-2]) * 60000
|
||||
except:
|
||||
m = 0
|
||||
ms = int(f'{unformatted_time.split(".")[-1]}')
|
||||
ms = int((round(float(f'1.{ms:03d}'), 2) - 1) * 1000)
|
||||
formated_time = datetime.datetime.fromtimestamp((s + m + ms) / 1000.0)
|
||||
ms = f'{int(unformatted_time.split(".")[-1]):03d}'
|
||||
if int(ms[2]) >= 5:
|
||||
ms = int(f'{int(ms[:2]) + 1}') * 10
|
||||
else:
|
||||
ms = int(ms)
|
||||
formated_time = datetime.datetime.fromtimestamp((s + m + ms)/1000.0)
|
||||
return formated_time.strftime('%M:%S.%f')[:-4]
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user