ValueError exception
struzjos opened this issue · comments
Timecode('24', 72931)
is raising ValueError
exception.
>>> Timecode('24', 72931)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Python\pyenv-win\pyenv-win\versions\3.9.5\lib\site-packages\timecode\__init__.py", line 77, in __init__
self.frames = self.tc_to_frames(start_timecode)
File "D:\Python\pyenv-win\pyenv-win\versions\3.9.5\lib\site-packages\timecode\__init__.py", line 209, in tc_to_frames
hours, minutes, seconds, frames = map(int, self.parse_timecode(timecode))
File "D:\Python\pyenv-win\pyenv-win\versions\3.9.5\lib\site-packages\timecode\__init__.py", line 330, in parse_timecode
hrs, mins, secs, frs = tuple(map(int, [hex_repr[i:i + 2] for i in range(2, 10, 2)]))
ValueError: invalid literal for int() with base 10: '1c'
I am on Windows and I am using python 3.9.5. I have the latest timecode
package 1.3.1.
the second argument is interpreted as a timecode and it is not following the timecode format, I presume it is the number of frames, so use the following:
Timecode("24", frames=72931)
Thanks it works! Sorry for useless report... But mb it would be great to mention it in the README.md
Np... Yeah yeah exactly we should update the read me 👍