s/ICapVideoProvider/ICapVideo
This commit is contained in:
parent
0780c5ac17
commit
076a4f44b9
7 changed files with 17 additions and 17 deletions
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
|
||||
from weboob.backend import BaseBackend
|
||||
from weboob.capabilities.video import ICapVideoProvider
|
||||
from weboob.capabilities.video import ICapVideo
|
||||
|
||||
from .browser import YoujizzBrowser
|
||||
from .video import YoujizzVideo
|
||||
|
|
@ -26,7 +26,7 @@ from .video import YoujizzVideo
|
|||
__all__ = ['YoujizzBackend']
|
||||
|
||||
|
||||
class YoujizzBackend(BaseBackend, ICapVideoProvider):
|
||||
class YoujizzBackend(BaseBackend, ICapVideo):
|
||||
NAME = 'youjizz'
|
||||
MAINTAINER = 'Roger Philibert'
|
||||
EMAIL = 'roger.philibert@gmail.com'
|
||||
|
|
@ -43,7 +43,7 @@ class YoujizzBackend(BaseBackend, ICapVideoProvider):
|
|||
def iter_page_urls(self, mozaic_url):
|
||||
return self.browser.iter_page_urls(mozaic_url)
|
||||
|
||||
def iter_search_results(self, pattern=None, sortby=ICapVideoProvider.SEARCH_RELEVANCE, nsfw=False):
|
||||
def iter_search_results(self, pattern=None, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
if not nsfw:
|
||||
return iter(set())
|
||||
return self.browser.iter_search_results(pattern)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
|
||||
from weboob.backend import BaseBackend
|
||||
from weboob.capabilities.video import ICapVideoProvider
|
||||
from weboob.capabilities.video import ICapVideo
|
||||
|
||||
from .browser import YoupornBrowser
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ from .browser import YoupornBrowser
|
|||
__all__ = ['YoupornBackend']
|
||||
|
||||
|
||||
class YoupornBackend(BaseBackend, ICapVideoProvider):
|
||||
class YoupornBackend(BaseBackend, ICapVideo):
|
||||
NAME = 'youporn'
|
||||
MAINTAINER = 'Romain Bignon'
|
||||
EMAIL = 'romain@peerfuse.org'
|
||||
|
|
@ -41,7 +41,7 @@ class YoupornBackend(BaseBackend, ICapVideoProvider):
|
|||
return self.browser.get_video(_id)
|
||||
|
||||
SORTBY = ['relevance', 'rating', 'views', 'time']
|
||||
def iter_search_results(self, pattern=None, sortby=ICapVideoProvider.SEARCH_RELEVANCE, nsfw=False):
|
||||
def iter_search_results(self, pattern=None, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
if not nsfw:
|
||||
return iter(set())
|
||||
return self.browser.iter_search_results(pattern, self.SORTBY[sortby])
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
import logging
|
||||
|
||||
from weboob.backend import BaseBackend
|
||||
from weboob.capabilities.video import ICapVideoProvider
|
||||
from weboob.capabilities.video import ICapVideo
|
||||
|
||||
from .browser import YoutubeBrowser
|
||||
from .video import YoutubeVideo
|
||||
|
|
@ -28,7 +28,7 @@ from .video import YoutubeVideo
|
|||
__all__ = ['YoutubeBackend']
|
||||
|
||||
|
||||
class YoutubeBackend(BaseBackend, ICapVideoProvider):
|
||||
class YoutubeBackend(BaseBackend, ICapVideo):
|
||||
NAME = 'youtube'
|
||||
MAINTAINER = 'Christophe Benz'
|
||||
EMAIL = 'christophe.benz@gmail.com'
|
||||
|
|
@ -42,7 +42,7 @@ class YoutubeBackend(BaseBackend, ICapVideoProvider):
|
|||
def get_video(self, _id):
|
||||
return self.browser.get_video(_id)
|
||||
|
||||
def iter_search_results(self, pattern=None, sortby=ICapVideoProvider.SEARCH_RELEVANCE, nsfw=False):
|
||||
def iter_search_results(self, pattern=None, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
try:
|
||||
import gdata.youtube.service
|
||||
except ImportError:
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
from .cap import ICap
|
||||
|
||||
|
||||
__all__ = ['BaseVideo', 'ICapVideoProvider']
|
||||
__all__ = ['BaseVideo', 'ICapVideo']
|
||||
|
||||
|
||||
class BaseVideo(object):
|
||||
|
|
@ -54,7 +54,7 @@ class BaseVideo(object):
|
|||
return self.id.split('@')[0]
|
||||
|
||||
|
||||
class ICapVideoProvider(ICap):
|
||||
class ICapVideo(ICap):
|
||||
def iter_page_urls(self, mozaic_url):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
"""
|
||||
|
||||
from weboob.capabilities.video import ICapVideoProvider
|
||||
from weboob.capabilities.video import ICapVideo
|
||||
from weboob.tools.application import QtApplication
|
||||
|
||||
from .main_window import MainWindow
|
||||
|
|
@ -34,7 +34,7 @@ class QVideoob(QtApplication):
|
|||
}
|
||||
}
|
||||
def main(self, argv):
|
||||
self.load_modules(ICapVideoProvider)
|
||||
self.load_modules(ICapVideo)
|
||||
self.load_config()
|
||||
|
||||
self.main_window = MainWindow(self.config, self.weboob)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
"""
|
||||
|
||||
from weboob.capabilities.video import ICapVideoProvider
|
||||
from weboob.capabilities.video import ICapVideo
|
||||
from weboob.tools.application import ConsoleApplication
|
||||
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ class Videoob(ConsoleApplication):
|
|||
group.add_option('--nsfw', action='store_true', help='enable non-suitable for work videos')
|
||||
|
||||
def main(self, argv):
|
||||
self.load_modules(ICapVideoProvider)
|
||||
self.load_modules(ICapVideo)
|
||||
return self.process_command(*argv[1:])
|
||||
|
||||
@ConsoleApplication.command('Get video information (accept ID or URL)')
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ from webob.dec import wsgify
|
|||
from webob import exc
|
||||
from wsgiref.simple_server import make_server
|
||||
|
||||
from weboob.capabilities.video import ICapVideoProvider
|
||||
from weboob.capabilities.video import ICapVideo
|
||||
from weboob.tools.application import BaseApplication
|
||||
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ class VideoobWeb(BaseApplication):
|
|||
|
||||
def main(self, argv):
|
||||
self.load_config()
|
||||
self.weboob.load_modules(ICapVideoProvider)
|
||||
self.weboob.load_modules(ICapVideo)
|
||||
print 'Web server created. Listening on http://%s:%s' % (
|
||||
self.config.get('host'), int(self.config.get('port')))
|
||||
srv = make_server(self.config.get('host'), int(self.config.get('port')), self.make_app)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue