From 4cc065e05fb6825afd0fcba771d90a9d1200cbb5 Mon Sep 17 00:00:00 2001 From: Roger Philibert Date: Tue, 20 Apr 2010 23:53:56 +0200 Subject: [PATCH] show page url in videoob search results --- weboob/backends/youporn/pages/index.py | 1 + weboob/capabilities/video.py | 4 +++- weboob/frontends/videoob/application.py | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/weboob/backends/youporn/pages/index.py b/weboob/backends/youporn/pages/index.py index d8369d3d..011ca3bb 100644 --- a/weboob/backends/youporn/pages/index.py +++ b/weboob/backends/youporn/pages/index.py @@ -67,6 +67,7 @@ class IndexPage(PornPage): yield Video(int(_id), title=title, + page_url=self.browser.id2url(_id), rating=rating, rating_max=rating_max, duration=duration, diff --git a/weboob/capabilities/video.py b/weboob/capabilities/video.py index fd902f48..2383b545 100644 --- a/weboob/capabilities/video.py +++ b/weboob/capabilities/video.py @@ -25,10 +25,12 @@ __all__ = ['ICapVideoProvider', 'Video'] class Video(object): - def __init__(self, _id, title=u'', url=u'', author=u'', duration=0, date=None, rating=0, rating_max=0, preview_url=None, nsfw=False): + def __init__(self, _id, title=u'', url=u'', page_url=u'', author=u'', duration=0, date=None, + rating=0, rating_max=0, preview_url=None, nsfw=False): self.id = _id self.title = title self.url = url + self.page_url = page_url self.author = author self.duration = duration self.date = date diff --git a/weboob/frontends/videoob/application.py b/weboob/frontends/videoob/application.py index 8390d1e1..287ef94a 100644 --- a/weboob/frontends/videoob/application.py +++ b/weboob/frontends/videoob/application.py @@ -63,6 +63,7 @@ class Videoob(ConsoleApplication): results['BEFORE'] = u'Search pattern: %s' % pattern else: results['BEFORE'] = u'Last videos' + results['HEADER'] = ('ID', 'Title', 'Page URL') for backend in self.weboob.iter_backends(): try: iterator = backend.iter_search_results(pattern) @@ -71,8 +72,7 @@ class Videoob(ConsoleApplication): else: rows = [] for video in iterator: - rows.append(('ID', video.id)) - rows.append(('Title', video.title)) + rows.append((video.id, video.title, video.page_url)) results[backend.name] = rows return results