implement ICapVideoProvider.get_video()
This commit is contained in:
parent
f02f0ec717
commit
6327e73b3a
3 changed files with 82 additions and 12 deletions
|
|
@ -36,10 +36,20 @@ class YoupornBrowser(Browser):
|
|||
# Disallow arguments
|
||||
Browser.__init__(self)
|
||||
|
||||
def get_video_title(self, page_url):
|
||||
self.location(page_url)
|
||||
return self.page.title
|
||||
def id2url(self, _id):
|
||||
if isinstance(_id, int) or isinstance(_id, (str,unicode)) and _id.isdigit():
|
||||
return 'http://www.youporn.com/watch/%d' % _id
|
||||
else:
|
||||
return str(_id)
|
||||
|
||||
def get_video_url(self, page_url):
|
||||
self.location(page_url)
|
||||
return self.page.url
|
||||
def get_video(self, _id):
|
||||
self.location(self.id2url(_id))
|
||||
return self.page.video
|
||||
|
||||
def get_video_title(self, _id):
|
||||
self.location(self.id2url(_id))
|
||||
return self.page.video.title
|
||||
|
||||
def get_video_url(self, _id):
|
||||
self.location(self.id2url(_id))
|
||||
return self.page.video.url
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue