From 36c1754725834a2501310c8044dfa7d172387b54 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 15 Mar 2015 02:25:31 +0530 Subject: [PATCH] use video link if its mp4(ubu) --- ox/web/ubu.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ox/web/ubu.py b/ox/web/ubu.py index 2cbd39b..da90bad 100644 --- a/ox/web/ubu.py +++ b/ox/web/ubu.py @@ -47,6 +47,8 @@ def get_data(url): match = re.compile('''src=(.*?) type="video/mp4"''').findall(data) if match: m['mp4'] = match[0].strip('"').strip("'") + elif 'video' in m and m['video'].endswith('.mp4'): + m['mp4'] = m['video'] doc = lxml.html.document_fromstring(read_url(url)) desc = doc.xpath("//div[contains(@id, 'ubudesc')]")