simplify search command code
This commit is contained in:
parent
9d7d8692ba
commit
9fe8053052
2 changed files with 5 additions and 9 deletions
|
|
@ -67,15 +67,8 @@ class Videoob(ConsoleApplication):
|
|||
results['BEFORE'] = u'Last videos'
|
||||
results['HEADER'] = ('ID', 'Title', 'Duration')
|
||||
for backend in self.weboob.iter_backends():
|
||||
try:
|
||||
iterator = backend.iter_search_results(pattern)
|
||||
except NotImplementedError:
|
||||
continue
|
||||
else:
|
||||
rows = []
|
||||
for video in iterator:
|
||||
rows.append((video.id, video.title, '%d:%02d:%02d' % (video.duration/3600, (video.duration%3600/60), video.duration%60)))
|
||||
results[backend.name] = rows
|
||||
results[backend.name] = [(video.id, video.title, video.formatted_duration) for video in
|
||||
backend.iter_search_results(pattern=pattern)]
|
||||
return results
|
||||
|
||||
@ConsoleApplication.command('Get video file URL from page URL')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue