pax_global_header 0000666 0000000 0000000 00000000064 13400741301 0014503 g ustar 00root root 0000000 0000000 52 comment=309ae667efa3c8f7192ef6b744c295fbb8a2d101
woob-309ae667efa3c8f7192ef6b744c295fbb8a2d101-modules-izneo/ 0000775 0000000 0000000 00000000000 13400741301 0022332 5 ustar 00root root 0000000 0000000 woob-309ae667efa3c8f7192ef6b744c295fbb8a2d101-modules-izneo/modules/ 0000775 0000000 0000000 00000000000 13400741301 0024002 5 ustar 00root root 0000000 0000000 woob-309ae667efa3c8f7192ef6b744c295fbb8a2d101-modules-izneo/modules/izneo/ 0000775 0000000 0000000 00000000000 13400741301 0025126 5 ustar 00root root 0000000 0000000 woob-309ae667efa3c8f7192ef6b744c295fbb8a2d101-modules-izneo/modules/izneo/__init__.py 0000664 0000000 0000000 00000001434 13400741301 0027241 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Roger Philibert
#
# This file is part of weboob.
#
# weboob 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.
#
# weboob 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 weboob. If not, see .
from .module import IzneoModule
__all__ = ['IzneoModule']
woob-309ae667efa3c8f7192ef6b744c295fbb8a2d101-modules-izneo/modules/izneo/favicon.png 0000664 0000000 0000000 00000002730 13400741301 0027263 0 ustar 00root root 0000000 0000000 PNG
IHDR @ @ iq sRGB bKGD pHYs tIME
8({ XIDATxoHu?6Vc3BH6Ŕ6Jk\G/(A4tAXYzPS%CGH3fl>9ϽKs~|w~w~BEIQJ(nk2 ׁI,d" Mbhz' Lv`Ou]>[V{:3f)ַ qy_l[{%C'@69ͮ/9s'Ϸ5[q/syR4[Hpn?| |ܐ[S>($px(OxJ,|q6~4%&8wX3p!['#|sRdm 9/xx',pM[X(29AN8
AuPRFb4d@l{\l~3[=3smP]{#x[_ /a(sjSl1ov=F㏈ %k![v^h|`&[pB#6=E)x60`@Lk `XtРB6Ҟ7*աIE055WaxYoMiS~?KĶPWN| ? -hP!V)lB Pj0 ҄r\jk1oKgV#pM9ZC@RݘBV!P}iP!`RMŘ?@Mݑ
"PLDp3ִ2Koh5
JaK3qjuYQT^eACR~*&i!,"ıf&J&nc}FT{2 iKѦV_ˍ":nrɅGBH/ޝҮD0ۣȐ1 Y
0CK: F/h.Э+8x
Iůmm "QAqGĆ~3gTn..ig="^95]Hs/c.PUϲn+:D@>WZdy
IjWb|` WP0)/01 . 㯊OY?ܕejޑ#$Krl"`Z0
|k;D-:?Dau\oqJ[%]^O.~-1:r(42
$<#$mpf%
gsBB({X"ʮ
(-I< IENDB` woob-309ae667efa3c8f7192ef6b744c295fbb8a2d101-modules-izneo/modules/izneo/module.py 0000664 0000000 0000000 00000006030 13400741301 0026764 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Roger Philibert
#
# This file is part of weboob.
#
# weboob 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.
#
# weboob 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 weboob. If not, see .
import re
from weboob.capabilities.gallery import CapGallery, BaseGallery, BaseImage
from weboob.tools.json import json
from weboob.tools.backend import Module
from weboob.deprecated.browser import Browser, Page
__all__ = ['IzneoModule']
class ReaderV2(Page):
def get_ean(self):
return self.document.xpath("//div[@id='viewer']/attribute::rel")[0]
def iter_gallery_images(self, gallery):
ean = self.get_ean()
pages = json.load(self.browser.openurl(
'http://www.izneo.com/playerv2/ajax.php?ean=%s&action=get_list_jpg'
% ean))
for page in pages['list']:
width = 1200 # maximum width
yield BaseImage(page['page'],
gallery=gallery,
url=("http://www.izneo.com/playerv2/%s/%s/%s/%d/%s" %
(page['expires'], page['token'], ean, width, page['page'])))
class IzneoBrowser(Browser):
PAGES = {r'http://.+\.izneo.\w+/readv2-.+': ReaderV2}
def iter_gallery_images(self, gallery):
self.location(gallery.url)
assert self.is_on_page(ReaderV2)
return self.page.iter_gallery_images(gallery)
def fill_image(self, image, fields):
if 'data' in fields:
image.data = self.readurl(self.request_class(
image.url, None, {'Referer': image.gallery.url}))
class IzneoModule(Module, CapGallery):
NAME = 'izneo'
MAINTAINER = u'Roger Philibert'
EMAIL = 'roger.philibert@gmail.com'
VERSION = '1.4'
DESCRIPTION = 'Izneo digital comics'
LICENSE = 'AGPLv3+'
BROWSER = IzneoBrowser
def iter_gallery_images(self, gallery):
with self.browser:
return self.browser.iter_gallery_images(gallery)
def get_gallery(self, _id):
match = re.match(r'(?:(?:.+izneo.com/)?readv2-)?(\d+-\d+)/?$', _id)
if match is None:
return None
_id = match.group(1)
gallery = BaseGallery(_id, url=('http://www.izneo.com/readv2-%s' % _id))
with self.browser:
return gallery
def fill_gallery(self, gallery, fields):
gallery.title = gallery.id
def fill_image(self, image, fields):
with self.browser:
self.browser.fill_image(image, fields)
OBJECTS = {
BaseGallery: fill_gallery,
BaseImage: fill_image}