pax_global_header 0000666 0000000 0000000 00000000064 12144374047 0014520 g ustar 00root root 0000000 0000000 52 comment=36f2c04c804663f49b91ddfd0488bb7761c74090
woob-36f2c04c804663f49b91ddfd0488bb7761c74090-modules-podnapisi/ 0000775 0000000 0000000 00000000000 12144374047 0022714 5 ustar 00root root 0000000 0000000 woob-36f2c04c804663f49b91ddfd0488bb7761c74090-modules-podnapisi/modules/ 0000775 0000000 0000000 00000000000 12144374047 0024364 5 ustar 00root root 0000000 0000000 woob-36f2c04c804663f49b91ddfd0488bb7761c74090-modules-podnapisi/modules/podnapisi/ 0000775 0000000 0000000 00000000000 12144374047 0026352 5 ustar 00root root 0000000 0000000 woob-36f2c04c804663f49b91ddfd0488bb7761c74090-modules-podnapisi/modules/podnapisi/__init__.py 0000664 0000000 0000000 00000001442 12144374047 0030464 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# 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 .backend import PodnapisiBackend
__all__ = ['PodnapisiBackend']
woob-36f2c04c804663f49b91ddfd0488bb7761c74090-modules-podnapisi/modules/podnapisi/backend.py 0000664 0000000 0000000 00000004153 12144374047 0030316 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# 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 weboob.capabilities.subtitle import ICapSubtitle, LanguageNotSupported, Subtitle
from weboob.applications.suboob.suboob import LANGUAGE_CONV
from weboob.tools.backend import BaseBackend
from .browser import PodnapisiBrowser
from urllib import quote_plus
__all__ = ['PodnapisiBackend']
class PodnapisiBackend(BaseBackend, ICapSubtitle):
NAME = 'podnapisi'
MAINTAINER = u'Julien Veyssier'
EMAIL = 'julien.veyssier@aiur.fr'
VERSION = '0.g'
DESCRIPTION = 'Podnapisi movies and tv series subtitle website'
LICENSE = 'AGPLv3+'
BROWSER = PodnapisiBrowser
def get_subtitle(self, id):
return self.browser.get_subtitle(id)
def get_subtitle_file(self, id):
subtitle = self.browser.get_subtitle(id)
if not subtitle:
return None
return self.browser.openurl(subtitle.url.encode('utf-8')).read()
def iter_subtitles(self, language, pattern):
if language not in LANGUAGE_CONV.keys():
raise LanguageNotSupported()
return self.browser.iter_subtitles(language, quote_plus(pattern.encode('utf-8')))
def fill_subtitle(self, subtitle, fields):
if 'description' in fields or 'url' in fields:
sub = self.get_subtitle(subtitle.id)
subtitle.description = sub.description
subtitle.url = sub.url
return subtitle
OBJECTS = {
Subtitle: fill_subtitle,
}
woob-36f2c04c804663f49b91ddfd0488bb7761c74090-modules-podnapisi/modules/podnapisi/browser.py 0000664 0000000 0000000 00000003527 12144374047 0030416 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# 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 weboob.tools.browser import BaseBrowser, BrowserHTTPNotFound
from .pages import SearchPage, SubtitlePage, LANGUAGE_NUMBERS
__all__ = ['PodnapisiBrowser']
class PodnapisiBrowser(BaseBrowser):
DOMAIN = 'www.podnapisi.net'
PROTOCOL = 'http'
ENCODING = 'utf-8'
USER_AGENT = BaseBrowser.USER_AGENTS['wget']
PAGES = {
'http://www.podnapisi.net/fr/ppodnapisi/search\?sJ=[0-9]*&sK=.*&sS=downloads&sO=desc': SearchPage,
'http://www.podnapisi.net/fr/ppodnapisi/podnapis/i/[0-9]*': SubtitlePage
}
def iter_subtitles(self, language, pattern):
nlang = LANGUAGE_NUMBERS[language]
self.location('http://www.podnapisi.net/fr/ppodnapisi/search?sJ=%s&sK=%s&sS=downloads&sO=desc' % (nlang, pattern.encode('utf-8')))
assert self.is_on_page(SearchPage)
return self.page.iter_subtitles(unicode(language))
def get_subtitle(self, id):
try:
self.location('http://www.podnapisi.net/fr/ppodnapisi/podnapis/i/%s' % id)
except BrowserHTTPNotFound:
return
if self.is_on_page(SubtitlePage):
return self.page.get_subtitle(id)
woob-36f2c04c804663f49b91ddfd0488bb7761c74090-modules-podnapisi/modules/podnapisi/favicon.png 0000664 0000000 0000000 00000003101 12144374047 0030500 0 ustar 00root root 0000000 0000000 PNG
IHDR @ @ iq sRGB bKGD pHYs tIME
)P˞ tEXtComment Created with GIMPW IDATxkTU6>j^b5JtfIYr44%")#B_JC_&J{#´@L4Au{5v\Gvsf̘1wag^{@N9SN9ԨuD|h#ޘM
@! +rƥ0\nt݀X Iw4(֓jq}/ } ڀg䚁'{ˀNJ9(@+5XiLPv _|Pb6`1:G-Wz.c
&,IIQSJ^Ѿ.B_I5N6s?0VX_gLpʘj|7u3&XmL|3`zL֘1NjbAS
c60?߳4N 0&+g8Еx@C>4}gR[0"7Ăf9*J' ',^S~ӿ+aU]
{c@K}l^6&X2zg9AӘ̃a5yA 0D}Ί]lro2 82792og2)c"/N~ 8ILcքMϨL;0Řh]y/ZcPi - nuZ ֤GCl0&r"-`LЦ 0Ę`ULO:zG+G`X-~zP(tG^,q$65B#sx""?[N ? 3EY+iEvZV+nEZHϸ.m"~+r"f1h>`AB|%Nו1@wOsf]t2ޘfqH˴]W/wݤ/( .@q;.Ҍ, )Zi XiZXݗ:scQ#^npw) |hV /mX.H֔v}[T"}6^u4y!*r`cjXQ ﵭ\R tvxaO9Uv/j78(vmjػX/ߎ:Cԋ8]3We@ߊLO1_aW/za8Y