call ICapVideoProvider.get_video()
This commit is contained in:
parent
6327e73b3a
commit
a03f98ff3e
1 changed files with 18 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Copyright(C) 2010 Christophe Benz
|
Copyright(C) 2010 Christophe Benz, Romain Bignon
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -29,6 +29,23 @@ class Videoob(ConsoleApplication):
|
||||||
self.weboob.load_backends(ICapVideoProvider)
|
self.weboob.load_backends(ICapVideoProvider)
|
||||||
return self.process_command(*argv[1:])
|
return self.process_command(*argv[1:])
|
||||||
|
|
||||||
|
@ConsoleApplication.command('Get video information')
|
||||||
|
def command_info(self, _id):
|
||||||
|
for backend in self.weboob.iter_backends(ICapVideoProvider):
|
||||||
|
try:
|
||||||
|
video = backend.get_video(_id)
|
||||||
|
except NotImplementedError:
|
||||||
|
continue
|
||||||
|
print u'.------------------------------------------------------------------------------.'
|
||||||
|
print u'| %-76s |' % (u'%s: %s' % (backend.name, video.title))
|
||||||
|
print u"+-----------------.------------------------------------------------------------'"
|
||||||
|
print u"| Duration | %d:%02d:%02d" % (video.duration/3600, (video.duration%3600)/60, video.duration%60)
|
||||||
|
print u"| URL | %s" % video.url
|
||||||
|
print u"| Author | %s" % video.author
|
||||||
|
print u"| Date | %s" % video.date
|
||||||
|
print u"| Rating | %s" % video.rating
|
||||||
|
print u"'-----------------' "
|
||||||
|
|
||||||
@ConsoleApplication.command('Get video file URL from page URL')
|
@ConsoleApplication.command('Get video file URL from page URL')
|
||||||
def command_file_url(self, url):
|
def command_file_url(self, url):
|
||||||
for backend in self.weboob.iter_backends(ICapVideoProvider):
|
for backend in self.weboob.iter_backends(ICapVideoProvider):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue