diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2012-09-12 21:20:54 +0200 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2012-09-12 21:20:54 +0200 |
commit | 39cf572a4e6e85d1ecd542476ffe2636f0ecc708 (patch) | |
tree | 5dd9f6cee6cd78833b93ed2aac65d4ef6b948cde /module/plugins | |
parent | fix turbobit with ossp-js, ryushare, easybytez - thx trance4us, ChriZathens (diff) | |
download | pyload-39cf572a4e6e85d1ecd542476ffe2636f0ecc708.tar.xz |
update mediafire, rusfolder
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hoster/IfolderRu.py | 33 | ||||
-rw-r--r-- | module/plugins/hoster/MediafireCom.py | 10 | ||||
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 4 |
3 files changed, 22 insertions, 25 deletions
diff --git a/module/plugins/hoster/IfolderRu.py b/module/plugins/hoster/IfolderRu.py index b84f77c5c..a21cc748b 100644 --- a/module/plugins/hoster/IfolderRu.py +++ b/module/plugins/hoster/IfolderRu.py @@ -24,9 +24,9 @@ from module.network.RequestFactory import getURL class IfolderRu(SimpleHoster): __name__ = "IfolderRu" __type__ = "hoster" - __pattern__ = r"http://(?:[^.]*\.)?ifolder.ru/(\d+).*" - __version__ = "0.35" - __description__ = """ifolder.ru""" + __pattern__ = r"http://(?:[^.]*\.)?(?:ifolder.ru|rusfolder.com)/(?P<ID>\d+).*" + __version__ = "0.36" + __description__ = """rusfolder.com / ifolder.ru""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -35,9 +35,7 @@ class IfolderRu(SimpleHoster): FILE_SIZE_PATTERN = ur'(?:<div><span>)?Размер:(?:</span>)? <b>(?P<S>[^<]+)</b><(?:/div|br)>' FILE_OFFLINE_PATTERN = ur'<p>Файл номер <b>[^<]*</b> (не найден|удален) !!!</p>' - SESSION_ID_PATTERN = r'<a href=(http://ints.ifolder.ru/ints/sponsor/\?bi=\d*&session=([^&]+)&u=[^>]+)>' - FORM1_PATTERN = r'<form method=post name="form1" ID="Form1" style="margin-bottom:200px">(.*?)</form>' - FORM_INPUT_PATTERN = r'<input[^>]* name="?([^" ]+)"? value="?([^" ]+)"?[^>]*>' + 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'" DOWNLOAD_LINK_PATTERN = r'<a id="download_file_href" href="([^"]+)"' @@ -48,33 +46,30 @@ class IfolderRu(SimpleHoster): self.chunkLimit = 1 def process(self, pyfile): - file_id = re.search(self.__pattern__, pyfile.url).group(1) - self.html = self.load("http://ifolder.ru/%s" % file_id, cookies=True, decode=True) + file_id = re.search(self.__pattern__, pyfile.url).group('ID') + self.html = self.load("http://rusfolder.com/%s" % file_id, cookies=True, decode=True) self.getFileInfo() - url = "http://ints.ifolder.ru/ints/?ifolder.ru/%s?ints_code=" % file_id + url = "http://ints.rusfolder.com/ints/?rusfolder.com/%s?ints_code=" % file_id 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.ifolder.ru/ints/frame/?session=%s" % session_id + url = "http://ints.rusfolder.com/ints/frame/?session=%s" % session_id self.html = self.load(url, cookies=True) self.setWait(31, False) self.wait() - captcha_url = "http://ints.ifolder.ru/random/images/?session=%s" % session_id + captcha_url = "http://ints.rusfolder.com/random/images/?session=%s" % session_id for i in range(5): - self.html = self.load(url, cookies=True) - - inputs = {} - form = re.search(self.FORM1_PATTERN, self.html, re.DOTALL).group(1) - inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) - inputs['ints_session'] = re.search(self.INTS_SESSION_PATTERN, form).group(1) - inputs['Submit1'] = u"Подтвердить".encode("utf-8") + 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) @@ -85,7 +80,7 @@ class IfolderRu(SimpleHoster): else: self.fail("Invalid captcha") - self.html = self.load("http://ifolder.ru/%s?ints_code=%s" % (file_id, session_id), decode=True, cookies = True) + self.html = self.load("http://rusfolder.com/%s?ints_code=%s" % (file_id, session_id), decode=True, cookies = True) download_url = re.search(self.DOWNLOAD_LINK_PATTERN, self.html).group(1) self.correctCaptcha() diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index dce16118f..1069e5e1a 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -57,8 +57,8 @@ def getInfo(urls): class MediafireCom(SimpleHoster): __name__ = "MediafireCom" __type__ = "hoster" - __pattern__ = r"http://(\w*\.)*mediafire\.com/(file/|(download.php)?\?)(\w{11}|\w{15})($|/)" - __version__ = "0.76" + __pattern__ = r"http://(?:\w*\.)*mediafire\.com/(file/|(view/?|download.php)?\?)(\w{11}|\w{15})($|/)" + __version__ = "0.77" __description__ = """Mediafire.com plugin - free only""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -71,13 +71,15 @@ class MediafireCom(SimpleHoster): PASSWORD_PATTERN = r'<form name="form_password"' FILE_NAME_PATTERN = r'<META NAME="description" CONTENT="(?P<N>[^"]+)"/>' - FILE_SIZE_PATTERN = r'>Download\s*<span>\((?P<S>[^)]+)\)</span>' + FILE_INFO_PATTERN = r"oFileSharePopup\.ald\('(?P<ID>[^']*)','(?P<N>[^']*)','(?P<S>[^']*)','','(?P<sha256>[^']*)'\)" FILE_OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File. </div>' def setup(self): self.multiDL = False def process(self, pyfile): + pyfile.url = re.sub(r'/view/?\?', '/?', pyfile.url) + self.url, result = checkHTMLHeader(pyfile.url) self.logDebug('Location (%d): %s' % (result, self.url)) @@ -85,7 +87,7 @@ class MediafireCom(SimpleHoster): self.html = self.load(self.url, decode = True) self.checkCaptcha() self.multiDL = True - self.getFileInfo() + self.check_data = self.getFileInfo() if self.account: self.handlePremium() diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 566615120..6d7bb6284 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -39,7 +39,7 @@ def set_cookies(cj, cookies): cj.setCookie(domain, name, value) def parseHtmlTagAttrValue(attr_name, tag): - m = re.search(r"%s\s*=\s*([\"']?)((?<=\")[^\"]+|(?<=')[^']+|[^\s\"'][^>\s]+)\1" % attr_name, tag) + m = re.search(r"%s\s*=\s*([\"']?)((?<=\")[^\"]+|(?<=')[^']+|[^>\s\"'][^>\s]*)\1" % attr_name, tag, re.I) return m.group(2) if m else None def parseHtmlForm(attr_str, html): @@ -129,7 +129,7 @@ class PluginParseError(Exception): class SimpleHoster(Hoster): __name__ = "SimpleHoster" - __version__ = "0.25" + __version__ = "0.26" __pattern__ = None __type__ = "hoster" __description__ = """Base hoster plugin""" |