From 16a955f310e28ce24405b36b268805f7832b31ff Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 15 Mar 2015 02:21:56 +0530 Subject: [PATCH] better title --- ox/web/ubu.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ox/web/ubu.py b/ox/web/ubu.py index b14a7e4..4bc32cf 100644 --- a/ox/web/ubu.py +++ b/ox/web/ubu.py @@ -24,7 +24,7 @@ def get_data(url): 'url': url, 'type': re.compile('ubu.com/(.*?)/').findall(url)[0] } - for videourl, title in re.compile('(.*?)').findall(data): + for videourl, title in re.compile('href="(http://ubumexico.centro.org.mx/.*?)">(.*?)').findall(data): if videourl.endswith('.srt'): m['srt'] = videourl elif not 'video' in m: @@ -32,6 +32,7 @@ def get_data(url): m['video'] = m['video'].replace('/video/ ', '/video/').replace(' ', '%20') if m['video'] == 'http://ubumexico.centro.org.mx/video/': del m['video'] + if not 'title' in m: m['title'] = strip_tags(decode_html(title)).strip() if not 'url' in m: print(url, 'missing')