show page url in videoob search results
This commit is contained in:
parent
0bcf72c08f
commit
4cc065e05f
3 changed files with 6 additions and 3 deletions
|
|
@ -67,6 +67,7 @@ class IndexPage(PornPage):
|
||||||
|
|
||||||
yield Video(int(_id),
|
yield Video(int(_id),
|
||||||
title=title,
|
title=title,
|
||||||
|
page_url=self.browser.id2url(_id),
|
||||||
rating=rating,
|
rating=rating,
|
||||||
rating_max=rating_max,
|
rating_max=rating_max,
|
||||||
duration=duration,
|
duration=duration,
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,12 @@ __all__ = ['ICapVideoProvider', 'Video']
|
||||||
|
|
||||||
|
|
||||||
class Video(object):
|
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.id = _id
|
||||||
self.title = title
|
self.title = title
|
||||||
self.url = url
|
self.url = url
|
||||||
|
self.page_url = page_url
|
||||||
self.author = author
|
self.author = author
|
||||||
self.duration = duration
|
self.duration = duration
|
||||||
self.date = date
|
self.date = date
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ class Videoob(ConsoleApplication):
|
||||||
results['BEFORE'] = u'Search pattern: %s' % pattern
|
results['BEFORE'] = u'Search pattern: %s' % pattern
|
||||||
else:
|
else:
|
||||||
results['BEFORE'] = u'Last videos'
|
results['BEFORE'] = u'Last videos'
|
||||||
|
results['HEADER'] = ('ID', 'Title', 'Page URL')
|
||||||
for backend in self.weboob.iter_backends():
|
for backend in self.weboob.iter_backends():
|
||||||
try:
|
try:
|
||||||
iterator = backend.iter_search_results(pattern)
|
iterator = backend.iter_search_results(pattern)
|
||||||
|
|
@ -71,8 +72,7 @@ class Videoob(ConsoleApplication):
|
||||||
else:
|
else:
|
||||||
rows = []
|
rows = []
|
||||||
for video in iterator:
|
for video in iterator:
|
||||||
rows.append(('ID', video.id))
|
rows.append((video.id, video.title, video.page_url))
|
||||||
rows.append(('Title', video.title))
|
|
||||||
results[backend.name] = rows
|
results[backend.name] = rows
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue