move id2url to tools
This commit is contained in:
parent
735b79a75d
commit
0667774952
12 changed files with 119 additions and 18 deletions
|
|
@ -22,6 +22,7 @@ import urllib
|
|||
|
||||
from weboob.tools.browser import BaseBrowser
|
||||
|
||||
from . import tools
|
||||
from .pages import VideoPage
|
||||
|
||||
__all__ = ['YoutubeBrowser']
|
||||
|
|
@ -30,9 +31,6 @@ class YoutubeBrowser(BaseBrowser):
|
|||
PAGES = {'.*youtube\.com/watch\?v=(.+)': VideoPage,
|
||||
}
|
||||
|
||||
def id2url(self, _id):
|
||||
return _id if 'youtube.com' in _id else 'http://www.youtube.com/watch?v=%s' % _id
|
||||
|
||||
def get_video(self, _id):
|
||||
self.location(self.id2url(_id))
|
||||
self.location(tools.id2url(_id))
|
||||
return self.page.video
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue