forked from DRMTalks/devine
Add support for JS-style 13-char timestamps to Cacher
This commit is contained in:
parent
ddf1c519e0
commit
36c530ccc6
|
@ -150,6 +150,8 @@ class Cacher:
|
|||
except ValueError:
|
||||
timestamp = float(timestamp)
|
||||
try:
|
||||
if len(str(int(timestamp))) == 13: # JS-style timestamp
|
||||
timestamp /= 1000
|
||||
timestamp = datetime.fromtimestamp(timestamp)
|
||||
except ValueError:
|
||||
raise ValueError(f"Unrecognized Timestamp value {timestamp!r}")
|
||||
|
|
Loading…
Reference in New Issue