From f39b2ddf3f82b76d5bb4be93944081d4a1cadeb2 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 23 Sep 2012 10:32:35 +0200 Subject: [PATCH] allow formated time for clip extraction too --- pandora/item/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora/item/views.py b/pandora/item/views.py index d4ea3e1d0..0f4d18f8b 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -796,7 +796,11 @@ def video(request, id, resolution, format, index=None): #FIXME: this needs to join segments if needed t = request.GET.get('t') if t: - t = map(float, t.split(',')) + def parse_timestamp(s): + if ':' in s: + s = ox.time2ms(s) / 1000 + return float(s) + t = map(parse_timestamp, t.split(',')) ext = '.%s' % format content_type = mimetypes.guess_type(path)[0] if len(t) == 2 and t[1] > t[0] and stream.info['duration']>=t[1]: