diff options
Diffstat (limited to 'pyload/plugins/hoster/IfolderRu.py')
-rw-r--r-- | pyload/plugins/hoster/IfolderRu.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/pyload/plugins/hoster/IfolderRu.py b/pyload/plugins/hoster/IfolderRu.py index 3de9b2e38..2a961f780 100644 --- a/pyload/plugins/hoster/IfolderRu.py +++ b/pyload/plugins/hoster/IfolderRu.py @@ -6,24 +6,25 @@ from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class IfolderRu(SimpleHoster): - __name__ = "IfolderRu" - __type__ = "hoster" + __name__ = "IfolderRu" + __type__ = "hoster" __version__ = "0.38" __pattern__ = r'http://(?:www\.)?(?:ifolder\.ru|rusfolder\.(?:com|net|ru))/(?:files/)?(?P<ID>\d+).*' __description__ = """Ifolder.ru hoster plugin""" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - FILE_SIZE_REPLACEMENTS = [(u'Кб', 'KB'), (u'Мб', 'MB'), (u'Гб', 'GB')] - FILE_NAME_PATTERN = ur'(?:<div><span>)?Название:(?:</span>)? <b>(?P<N>[^<]+)</b><(?:/div|br)>' - FILE_SIZE_PATTERN = ur'(?:<div><span>)?Размер:(?:</span>)? <b>(?P<S>[^<]+)</b><(?:/div|br)>' + SIZE_REPLACEMENTS = [(u'Кб', 'KB'), (u'Мб', 'MB'), (u'Гб', 'GB')] + NAME_PATTERN = ur'(?:<div><span>)?Название:(?:</span>)? <b>(?P<N>[^<]+)</b><(?:/div|br)>' + SIZE_PATTERN = ur'(?:<div><span>)?Размер:(?:</span>)? <b>(?P<S>[^<]+)</b><(?:/div|br)>' OFFLINE_PATTERN = ur'<p>Файл номер <b>[^<]*</b> (не найден|удален) !!!</p>' - SESSION_ID_PATTERN = r'<a href=(http://ints.(?:rusfolder.com|ifolder.ru)/ints/sponsor/\?bi=\d*&session=([^&]+)&u=[^>]+)>' - INTS_SESSION_PATTERN = r'\(\'ints_session\'\);\s*if\(tag\)\{tag.value = "([^"]+)";\}' - HIDDEN_INPUT_PATTERN = r"var v = .*?name='([^']+)' value='1'" + SESSION_ID_PATTERN = r'<a href=(http://ints\.(?:rusfolder\.com|ifolder\.ru)/ints/sponsor/\?bi=\d*&session=([^&]+)&u=[^>]+)>' + INTS_SESSION_PATTERN = r'\(\'ints_session\'\);\s*if\(tag\)\{tag\.value = "([^"]+)";\}' + HIDDEN_INPUT_PATTERN = r'var v = .*?name=\'(.+?)\' value=\'1\'' LINK_PATTERN = r'<a id="download_file_href" href="([^"]+)"' WRONG_CAPTCHA_PATTERN = ur'<font color=Red>неверный код,<br>введите еще раз</font><br>' @@ -32,6 +33,7 @@ class IfolderRu(SimpleHoster): self.resumeDownload = self.multiDL = True if self.account else False self.chunkLimit = 1 + def process(self, pyfile): file_id = re.match(self.__pattern__, pyfile.url).group('ID') self.html = self.load("http://rusfolder.com/%s" % file_id, cookies=True, decode=True) @@ -49,7 +51,7 @@ class IfolderRu(SimpleHoster): self.wait(31, False) captcha_url = "http://ints.rusfolder.com/random/images/?session=%s" % session_id - for _ in xrange(5): + for _i in xrange(5): self.html = self.load(url, cookies=True) action, inputs = self.parseHtmlForm('ID="Form1"') inputs['ints_session'] = re.search(self.INTS_SESSION_PATTERN, self.html).group(1) @@ -64,11 +66,10 @@ class IfolderRu(SimpleHoster): else: break else: - self.fail("Invalid captcha") + self.fail(_("Invalid captcha")) download_url = re.search(self.LINK_PATTERN, self.html).group(1) self.correctCaptcha() - self.logDebug("Download URL: %s" % download_url) self.download(download_url) |