pax_global_header 0000666 0000000 0000000 00000000064 13434577234 0014526 g ustar 00root root 0000000 0000000 52 comment=80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd
woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-youjizz/ 0000775 0000000 0000000 00000000000 13434577234 0023255 5 ustar 00root root 0000000 0000000 woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-youjizz/modules/ 0000775 0000000 0000000 00000000000 13434577234 0024725 5 ustar 00root root 0000000 0000000 woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-youjizz/modules/youjizz/ 0000775 0000000 0000000 00000000000 13434577234 0026450 5 ustar 00root root 0000000 0000000 woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-youjizz/modules/youjizz/__init__.py 0000664 0000000 0000000 00000001515 13434577234 0030563 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Roger Philibert
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This weboob module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this weboob module. If not, see .
from .module import YoujizzModule
__all__ = ['YoujizzModule']
woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-youjizz/modules/youjizz/browser.py 0000664 0000000 0000000 00000003620 13434577234 0030506 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2010-2014 Roger Philibert
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This weboob module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this weboob module. If not, see .
from weboob.browser import PagesBrowser, URL
from weboob.capabilities.base import UserError
from .pages.index import IndexPage
from .pages.video import VideoPage
__all__ = ['YoujizzBrowser']
class YoujizzBrowser(PagesBrowser):
BASEURL = 'https://www.youjizz.com'
index = URL(r'/?(index.php)?$',
r'/page/\d+.html',
IndexPage)
search = URL(r'/search/(?P.+)-(?P\d+).html', IndexPage)
video = URL(r'/videos/(?P.*).html', VideoPage)
video_url = URL(r'/videos/embed/\d+', VideoPage)
@video.id2url
def get_video(self, url, video=None):
self.location(url)
assert self.video.is_here()
return self.page.get_video(video)
def search_videos(self, pattern):
if len(pattern) < 3:
raise UserError('Pattern to short (min length : 3 characters)')
self.search.go(pattern=pattern, pagenum=1)
assert self.search.is_here(pattern=pattern, pagenum=1)
return self.page.iter_videos()
def latest_videos(self):
self.index.go()
assert self.index.is_here()
return self.page.iter_videos()
woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-youjizz/modules/youjizz/favicon.png 0000664 0000000 0000000 00000006164 13434577234 0030612 0 ustar 00root root 0000000 0000000 PNG
IHDR @ @ iq sRGB pHYs tIME-i IDATx]l[>c'M|M(!!ka#㣄$h(EBH`Lf傋EUҤ!MH6X+R2Z6)K&M{';'c;Yd|}yW]g~]]j@[;K2s!s?}83S- fC-h"@5fmyX,ex~E`tum~+/;`bTUqTQ<&0jKdR(
XUU4ݮ醑JR] dҧ뺠=sIS I֬lZO߿o! d>yrp|Ju0 !I2YDѭz\8@Jݪʂ(ɤ[uO}.c713$Β 08phTD߯z;7m]
un3 H1(+0 %)0E ɹ&u &t'`rǎY_E0is`YNǁ
@Za9MR\j-Mx@vknmHO1MץQEm DqIE+zWZ3l965屼b
d2ùܮW0f4TV^47!^p$R)`y3= Zv[fW]zok1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.py 0000664 0000000 0000000 00000005265 13434577234 0030317 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2010-2014 Roger Philibert
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This weboob module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this weboob module. If not, see .
from weboob.capabilities.video import CapVideo, BaseVideo
from weboob.capabilities.collection import CapCollection, CollectionNotFound
from weboob.tools.backend import Module
from .browser import YoujizzBrowser
__all__ = ['YoujizzModule']
class YoujizzModule(Module, CapVideo, CapCollection):
NAME = 'youjizz'
MAINTAINER = u'Roger Philibert'
EMAIL = 'roger.philibert@gmail.com'
VERSION = '1.5'
DESCRIPTION = 'YouJizz pornographic video streaming website'
LICENSE = 'AGPLv3+'
BROWSER = YoujizzBrowser
def get_video(self, _id):
video = self.browser.get_video(_id)
return video
def search_videos(self, pattern, sortby=CapVideo.SEARCH_RELEVANCE, nsfw=False):
if not nsfw:
return set()
return self.browser.search_videos(pattern)
def fill_video(self, video, fields):
if fields != ['thumbnail']:
# if we don't want only the thumbnail, we probably want also every fields
video = self.browser.get_video(video.id, video)
if 'thumbnail' in fields and video.thumbnail:
video.thumbnail.data = self.browser.open(video.thumbnail.url).content
return video
def iter_resources(self, objs, split_path):
if BaseVideo in objs:
collection = self.get_collection(objs, split_path)
if collection.path_level == 0:
yield self.get_collection(objs, [u'latest_nsfw'])
if collection.split_path == [u'latest_nsfw']:
for video in self.browser.latest_videos():
yield video
def validate_collection(self, objs, collection):
if collection.path_level == 0:
return
if BaseVideo in objs and collection.split_path == [u'latest_nsfw']:
collection.title = u'Latest Youjizz videos (NSFW)'
return
raise CollectionNotFound(collection.split_path)
OBJECTS = {BaseVideo: fill_video}
woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-youjizz/modules/youjizz/pages/ 0000775 0000000 0000000 00000000000 13434577234 0027547 5 ustar 00root root 0000000 0000000 woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-youjizz/modules/youjizz/pages/__init__.py 0000664 0000000 0000000 00000000000 13434577234 0031646 0 ustar 00root root 0000000 0000000 woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-youjizz/modules/youjizz/pages/index.py 0000664 0000000 0000000 00000003575 13434577234 0031242 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2010-2014 Roger Philibert
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This weboob module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this weboob module. If not, see .
from weboob.browser.pages import HTMLPage, pagination
from weboob.browser.elements import ListElement, ItemElement, method
from weboob.browser.filters.standard import CleanText, Duration, Regexp
from weboob.browser.filters.html import Link, CSS
from weboob.capabilities.base import NotAvailable
from weboob.capabilities.image import Thumbnail
from weboob.capabilities.video import BaseVideo
class IndexPage(HTMLPage):
@pagination
@method
class iter_videos(ListElement):
item_xpath = '//span[@id="miniatura"]'
next_page = Link(u'//a[text()="Next »"]')
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
woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-youjizz/modules/youjizz/pages/video.py 0000664 0000000 0000000 00000003463 13434577234 0031235 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2010-2014 Roger Philibert
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This weboob module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this weboob module. If not, see .
import re
from weboob.browser.pages import HTMLPage
from weboob.browser.elements import ItemElement, method
from weboob.browser.filters.standard import CleanText, Env
from weboob.capabilities.video import BaseVideo
from weboob.tools.misc import to_unicode
class VideoPage(HTMLPage):
@method
class get_video(ItemElement):
klass = BaseVideo
obj_id = Env('id')
obj_title = CleanText('//title')
obj_nsfw = True
obj_ext = u'flv'
def obj_url(self):
real_id = int(self.env['id'].split('-')[-1])
response = self.page.browser.open('https://www.youjizz.com/videos/embed/%s' % real_id)
data = response.text
video_file_urls = re.findall(r'"((?:https?:)?//[^",]+\.(?:flv|mp4)(?:\?[^"]*)?)"', data.replace('\\', ''))
if len(video_file_urls) == 0:
raise ValueError('Video URL not found')
url = to_unicode(video_file_urls[-1])
if url.startswith('//'):
url = u'https:' + url
return url
woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-youjizz/modules/youjizz/test.py 0000664 0000000 0000000 00000003400 13434577234 0027776 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2010-2014 Romain Bignon
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This weboob module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this weboob module. If not, see .
from weboob.tools.misc import limit
from weboob.tools.test import BackendTest
from weboob.capabilities.video import BaseVideo
class YoujizzTest(BackendTest):
MODULE = 'youjizz'
def test_search(self):
self.assertTrue(len(self.backend.search_videos('anus', nsfw=False)) == 0)
l = list(limit(self.backend.search_videos('anus', nsfw=True), 100))
self.assertTrue(len(l) > 0)
v = l[0]
self.backend.fillobj(v, ('url',))
self.assertTrue(v.url and v.url.startswith('http://'), 'URL for video "%s" not found: %s' % (v.id, v.url))
r = self.backend.browser.open(v.url, stream=True)
self.assertTrue(r.status_code == 200)
def test_latest(self):
l = list(limit(self.backend.iter_resources([BaseVideo], [u'latest_nsfw']), 100))
self.assertTrue(len(l) > 0)
v = l[0]
self.backend.fillobj(v, ('url',))
self.assertTrue(v.url and v.url.startswith('http://'), 'URL for video "%s" not found: %s' % (v.id, v.url))