show page url in videoob search results

This commit is contained in:
Roger Philibert 2010-04-20 23:53:56 +02:00
commit 4cc065e05f
3 changed files with 6 additions and 3 deletions

View file

@ -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,

View file

@ -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

View file

@ -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