use the new URL.id2url decorator
This commit is contained in:
parent
9724dcf461
commit
2db4646779
6 changed files with 22 additions and 57 deletions
|
|
@ -25,8 +25,7 @@ from weboob.tools.browser2 import HTMLPage
|
|||
from weboob.tools.browser2.page import ListElement, method, ItemElement
|
||||
from weboob.tools.browser2.filters import Filter, Link, CleanText
|
||||
from weboob.capabilities.image import BaseImage
|
||||
|
||||
from ..video import YoujizzVideo
|
||||
from weboob.capabilities.video import BaseVideo
|
||||
|
||||
|
||||
__all__ = ['IndexPage']
|
||||
|
|
@ -40,7 +39,7 @@ class IndexPage(HTMLPage):
|
|||
next_page = Link(u'//a[text()="Next »"]')
|
||||
|
||||
class item(ItemElement):
|
||||
klass = YoujizzVideo
|
||||
klass = BaseVideo
|
||||
|
||||
class Id(Filter):
|
||||
def filter(self, link):
|
||||
|
|
@ -66,6 +65,7 @@ class IndexPage(HTMLPage):
|
|||
obj_id = Id(Link('.//a'))
|
||||
obj_title = CleanText('.//span[@id="title1"]')
|
||||
obj_duration = Duration(CleanText('.//span[@class="thumbtime"]//span'))
|
||||
obj_nsfw = True
|
||||
|
||||
def obj_thumbnail(self):
|
||||
thumbnail = BaseImage(self.xpath('.//img')[0].attrib['data-original'])
|
||||
|
|
|
|||
|
|
@ -25,10 +25,9 @@ from weboob.tools.browser2 import HTMLPage
|
|||
from weboob.tools.browser2.page import method, ItemElement
|
||||
from weboob.tools.browser2.filters import CleanText, Env
|
||||
from weboob.capabilities.base import NotAvailable
|
||||
from weboob.capabilities.video import BaseVideo
|
||||
from weboob.tools.misc import to_unicode
|
||||
|
||||
from ..video import YoujizzVideo
|
||||
|
||||
|
||||
__all__ = ['VideoPage']
|
||||
|
||||
|
|
@ -36,10 +35,12 @@ __all__ = ['VideoPage']
|
|||
class VideoPage(HTMLPage):
|
||||
@method
|
||||
class get_video(ItemElement):
|
||||
klass = YoujizzVideo
|
||||
klass = BaseVideo
|
||||
|
||||
obj_id = Env('id')
|
||||
obj_title = CleanText('//title')
|
||||
obj_nsfw = True
|
||||
obj_ext = u'flv'
|
||||
|
||||
def obj_duration(self):
|
||||
# youjizz HTML is crap, we must parse it with regexps
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue