implement ICapVideoProvider.get_video()

This commit is contained in:
Romain Bignon 2010-04-16 16:46:17 +02:00
commit 6327e73b3a
3 changed files with 82 additions and 12 deletions

View file

@ -44,11 +44,15 @@ class YoupornBackend(Backend, ICapVideoProvider):
def need_url(func):
def inner(self, *args, **kwargs):
url = args[0]
if u'youporn.com' not in url:
if isinstance(url, (str,unicode)) and not url.isdigit() and u'youporn.com' not in url:
return None
return func(self, *args, **kwargs)
return inner
@need_url
def get_video(self, _id):
return self.browser.get_video(_id)
@need_url
def iter_page_urls(self, mozaic_url):
raise NotImplementedError()