handle duration: N/A from ffprobe

This commit is contained in:
boyska 2024-11-02 23:15:38 +01:00
parent a09f28b34f
commit e25bf292ca

3
feed
View file

@ -380,7 +380,10 @@ def get_duration(url):
raise DurationNotFound(url) from exc
duration = next(l for l in lineout if l.startswith(b"duration="))
value = duration.split(b"=")[1]
try:
return int(float(value))
except ValueError as exc:
raise DurationNotFound(url) from exc
HELP = """