From a03f98ff3e2f14251752e22925a7f16d1eca6eee Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Fri, 16 Apr 2010 16:46:34 +0200 Subject: [PATCH] call ICapVideoProvider.get_video() --- weboob/frontends/videoob/application.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/weboob/frontends/videoob/application.py b/weboob/frontends/videoob/application.py index 90133eb7..ad456082 100644 --- a/weboob/frontends/videoob/application.py +++ b/weboob/frontends/videoob/application.py @@ -1,7 +1,7 @@ # -*- 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 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) 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') def command_file_url(self, url): for backend in self.weboob.iter_backends(ICapVideoProvider):