# -*- coding: utf-8 -*- import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class IfolderRu(SimpleHoster): __name__ = "IfolderRu" __type__ = "hoster" __version__ = "0.39" __pattern__ = r'http://(?:www\.)?(?:ifolder\.ru|rusfolder\.(?:com|net|ru))/(?:files/)?(?P\d+)' __description__ = """Ifolder.ru hoster plugin""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] SIZE_REPLACEMENTS = [(u'Кб', 'KB'), (u'Мб', 'MB'), (u'Гб', 'GB')] NAME_PATTERN = ur'(?:
)?Название:(?:)? (?P[^<]+)<(?:/div|br)>' SIZE_PATTERN = ur'(?:
)?Размер:(?:)? (?P[^<]+)<(?:/div|br)>' OFFLINE_PATTERN = ur'

Файл номер [^<]* (не найден|удален) !!!

' SESSION_ID_PATTERN = r']+)>' INTS_SESSION_PATTERN = r'\(\'ints_session\'\);\s*if\(tag\)\{tag\.value = "([^"]+)";\}' HIDDEN_INPUT_PATTERN = r'var v = .*?name=\'(.+?)\' value=\'1\'' LINK_FREE_PATTERN = r'неверный код,
введите еще раз
' def setup(self): self.resumeDownload = self.multiDL = bool(self.account) self.chunkLimit = 1 def handleFree(self, pyfile): self.html = self.load("http://rusfolder.com/%s" % self.info['pattern']['ID'], cookies=True, decode=True) self.getFileInfo() url = re.search(r"location\.href = '(http://ints\..*?=)'", self.html).group(1) self.html = self.load(url, cookies=True, decode=True) url, session_id = re.search(self.SESSION_ID_PATTERN, self.html).groups() self.html = self.load(url, cookies=True, decode=True) url = "http://ints.rusfolder.com/ints/frame/?session=%s" % session_id self.html = self.load(url, cookies=True) self.wait(31, False) captcha_url = "http://ints.rusfolder.com/random/images/?session=%s" % session_id 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) inputs[re.search(self.HIDDEN_INPUT_PATTERN, self.html).group(1)] = '1' inputs['confirmed_number'] = self.decryptCaptcha(captcha_url, cookies=True) inputs['action'] = '1' self.logDebug(inputs) self.html = self.load(url, decode=True, cookies=True, post=inputs) if self.WRONG_CAPTCHA_PATTERN in self.html: self.invalidCaptcha() else: break else: self.fail(_("Invalid captcha")) self.link = re.search(self.LINK_PATTERN, self.html).group(1) getInfo = create_getInfo(IfolderRu)