Closed vovanz closed 6 years ago
Try it with:
>>> import isodate
>>> t = 'PT1M33S'
>>> isodate.parse_duration(t)
Also, as far as I know, a duration string must start with 'P'.
I guess a video length could also be just a simple ISO 8601 time string like '01:30' or '0130', which the 'parse_time' function would be able to handle.
Hope that helps.
Hope that helps.
Yeah, thanks.
So, I was working on a tool to parse schema.org markup for videos as described here
The documentation for schema.org format says that
duration
is "The duration of the video in ISO 8601 format" and gives the following example:T1M33S
So, I've tried to parse it via the
isodate
lib, but it didn't work:I'm trying to understand what is the problem here: is there a bug in
isodate
or this string (T1M33S
) is not a valid ISO 8601 time?