示例#1
0
        class item(ItemElement):
            klass = BaseVideo

            obj_id = CSS('a') & Link & Regexp(pattern=r'viewkey=(.+)')
            obj_title = Attr('.//span[has-class("title")]/a', 'title') & CleanText
            obj_duration = CSS('var.duration') & CleanText & Duration | NotAvailable
            obj_nsfw = True

            def obj_thumbnail(self):
                thumbnail = Thumbnail(Attr('.//img[has-class("js-videoThumb")]', 'data-path')(self).replace('{index}', '1'))
                thumbnail.url = thumbnail.id
                return thumbnail
示例#2
0
文件: index.py 项目: linura/weboob
        class item(ItemElement):
            klass = BaseVideo

            obj_id = CSS('a') & Link & Regexp(pattern=r'/videos/(.+)\.html')
            obj_title = CSS('span#title1') & CleanText
            obj_duration = CSS(
                'span.thumbtime span') & CleanText & Duration | NotAvailable
            obj_nsfw = True

            def obj_thumbnail(self):
                thumbnail = Thumbnail(
                    self.xpath('.//img')[0].attrib['data-original'])
                thumbnail.url = thumbnail.id.replace('http://', 'https://')
                return thumbnail
示例#3
0
        class item(ItemElement):
            klass = YoupornVideo

            def obj_thumbnail(self):
                thumbnail_url = Attr('./img', 'src')(self)
                thumbnail = Thumbnail(thumbnail_url)
                thumbnail.url = thumbnail.id
                return thumbnail

            obj_author = NotAvailable
            obj_duration = CSS('span.duration') & CleanText() & Duration()
            obj_id = Attr('../..', 'data-video-id')
            obj_rating = CleanText('./span/i') & Regexp(
                pattern=r'(..)%') & Type(type=int)
            obj_rating_max = 100
            obj_title = CleanText('./p')
            obj_url = NotAvailable