diff options
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/BasePlugin.py | 14 | ||||
-rw-r--r-- | module/plugins/hoster/IfolderRu.py | 33 | ||||
-rw-r--r-- | module/plugins/hoster/MediafireCom.py | 10 | ||||
-rw-r--r-- | module/plugins/hoster/NowDownloadEu.py | 62 | ||||
-rw-r--r-- | module/plugins/hoster/OneFichierCom.py | 13 | ||||
-rw-r--r-- | module/plugins/hoster/ShareonlineBiz.py | 12 | ||||
-rw-r--r-- | module/plugins/hoster/ZippyshareCom.py | 3 |
7 files changed, 112 insertions, 35 deletions
diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index f1e3006d0..1ac33931f 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -12,10 +12,10 @@ class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" __pattern__ = r"^unmatchable$" - __version__ = "0.15" + __version__ = "0.151" __description__ = """Base Plugin when any other didnt fit""" - __author_name__ = ("RaNaN") - __author_mail__ = ("RaNaN@pyload.org") + __author_name__ = ("RaNaN", 'hagg') + __author_mail__ = ("RaNaN@pyload.org", '') def setup(self): self.chunkLimit = -1 @@ -54,6 +54,8 @@ class BasePlugin(Hoster): self.req.addAuth(pwd) self.downloadFile(pyfile) + elif e.code == 404: + self.offline() else: raise @@ -65,6 +67,10 @@ class BasePlugin(Hoster): header = self.load(pyfile.url, just_header = True) #self.logDebug(header) + # self.load does not raise a BadHeader on 404 responses, do it here + if header.has_key('code') and header['code'] == 404: + raise BadHeader(404) + if 'location' in header: self.logDebug("Location: " + header['location']) url = unquote(header['location']) @@ -86,4 +92,4 @@ class BasePlugin(Hoster): if not name: name = url pyfile.name = name self.logDebug("Filename: %s" % pyfile.name) - self.download(url, disposition=True)
\ No newline at end of file + self.download(url, disposition=True) 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/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py new file mode 100644 index 000000000..fa699a278 --- /dev/null +++ b/module/plugins/hoster/NowDownloadEu.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +from random import random +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + +class NowDownloadEu(SimpleHoster): + __name__ = "NowDownloadEu" + __type__ = "hoster" + __pattern__ = r"http://(www\.)?nowdownload\.(eu|co)/dl/(?P<ID>[a-z0-9]+)" + __version__ = "0.01" + __description__ = """NowDownloadEu""" + __author_name__ = ("godofdream") + FILE_INFO_PATTERN = r'Downloading</span> <br> (?P<N>.*) (?P<S>[0-9,.]+) (?P<U>[kKMG])i?B </h4>' + FILE_OFFLINE_PATTERN = r'(This file does not exist!)' + FILE_TOKEN_PATTERN = r'"(/api/token\.php\?token=[a-z0-9]+)"' + FILE_CONTINUE_PATTERN = r'"(/dl2/[a-z0-9]+/[a-z0-9]+)"' + FILE_WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),' + FILE_DOWNLOAD_LINK = r'"(http://f\d+\.nowdownload\.eu/dl/[a-z0-9]+/[a-z0-9]+/[^<>"]*?)"' + def setup(self): + self.wantReconnect = False + self.multiDL = True + self.chunkLimit = -1 + self.resumeDownload = True + + def handleFree(self): + tokenlink = re.search(self.FILE_TOKEN_PATTERN, self.html) + continuelink = re.search(self.FILE_CONTINUE_PATTERN, self.html) + if (not tokenlink) or (not continuelink): self.fail('Plugin out of Date') + + wait = 60 + found = re.search(self.FILE_WAIT_PATTERN, self.html) + if found: wait = int(found.group(1)) + + self.html = self.load("http://www.nowdownload.eu" + str(tokenlink.group(1))) + self.setWait(wait) + self.wait() + + self.html = self.load("http://www.nowdownload.eu" + str(continuelink.group(1))) + + url = re.search(self.FILE_DOWNLOAD_LINK, self.html) + if not url: self.fail('Download Link not Found (Plugin out of Date?)') + self.logDebug('Download link: ' + str(url.group(1))) + self.download(str(url.group(1))) + +getInfo = create_getInfo(NowDownloadEu)
\ No newline at end of file diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 128942b75..3a4ff7275 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -7,7 +7,7 @@ class OneFichierCom(SimpleHoster): __name__ = "OneFichierCom" __type__ = "hoster" __pattern__ = r"(http://(\w+)\.((1fichier|d(es)?fichiers|pjointe)\.(com|fr|net|org)|(cjoint|mesfichiers|piecejointe|oi)\.(org|net)|tenvoi\.(com|org|net)|dl4free\.com|alterupload\.com|megadl.fr))" - __version__ = "0.43" + __version__ = "0.44" __description__ = """1fichier.com download hoster""" __author_name__ = ("fragonib", "the-razer", "zoidberg") __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "daniel_ AT gmx DOT net", "zoidberg@mujmail.cz") @@ -19,7 +19,7 @@ class OneFichierCom(SimpleHoster): DOWNLOAD_LINK_PATTERN = r'<br/> <br/> <br/> \s+<a href="(?P<url>http://.*?)"' PASSWORD_PROTECTED_TOKEN = "protected by password" - WAITING_TOKEN = "Please wait a few seconds" + WAITING_PATTERN = "you must wait (\d+) minutes" def process(self, pyfile): found = re.search(self.__pattern__, pyfile.url) @@ -27,8 +27,9 @@ class OneFichierCom(SimpleHoster): url = "http://%s.%s/en/" % (found.group(2), found.group(3)) self.html = self.load(url, decode = True) - if self.WAITING_TOKEN in self.html: - self.waitAndRetry(120) + found = re.search(self.WAITING_PATTERN, self.html) + if found: + self.waitAndRetry(int(found.group(1)) * 60) self.getFileInfo() @@ -46,9 +47,9 @@ class OneFichierCom(SimpleHoster): self.checkDownloadedFile() def checkDownloadedFile(self): - check = self.checkDownload({"wait": self.WAITING_TOKEN}) + check = self.checkDownload({"wait": self.WAITING_PATTERN}) if check == "wait": - self.waitAndRetry(60) + self.waitAndRetry(int(self.lastcheck.group(1)) * 60) def waitAndRetry(self, wait_time): self.setWait(wait_time, True) diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index b40cd51dd..e47aa0e5e 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -43,7 +43,7 @@ class ShareonlineBiz(Hoster): __name__ = "ShareonlineBiz" __type__ = "hoster" __pattern__ = r"http://[\w\.]*?(share\-online\.biz|egoshare\.com)/(download.php\?id\=|dl/)[\w]+" - __version__ = "0.33" + __version__ = "0.34" __description__ = """Shareonline.biz Download Hoster""" __author_name__ = ("spoob", "mkaay", "zoidberg") __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz") @@ -130,6 +130,16 @@ class ShareonlineBiz(Hoster): self.wait() self.download(download_url) + # check download + check = self.checkDownload({ + "cookie": re.compile(r'<div id="dl_failure"'), + "fail": re.compile(r"<title>Share-Online") + }) + if check == "cookie": + self.retry(5, 60, "Cookie failure") + elif check == "fail": + self.retry(5, 300, "Download failed") + def checkErrors(self): found = re.search(r"/failure/(.*?)/1", self.req.lastEffectiveURL) diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index 6b0b01003..84974e7ba 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -10,7 +10,7 @@ class ZippyshareCom(SimpleHoster): __name__ = "ZippyshareCom" __type__ = "hoster" __pattern__ = r"(?P<HOST>http://www\d{0,2}\.zippyshare.com)/v(?:/|iew.jsp.*key=)(?P<KEY>\d+)" - __version__ = "0.36" + __version__ = "0.37" __description__ = """Zippyshare.com Download Hoster""" __author_name__ = ("spoob", "zoidberg") __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz") @@ -18,6 +18,7 @@ class ZippyshareCom(SimpleHoster): FILE_NAME_PATTERN = r'>Name:</font>\s*<font [^>]*>(?P<N>[^<]+)</font><br />' FILE_SIZE_PATTERN = r'>Size:</font>\s*<font [^>]*>(?P<S>[0-9.,]+) (?P<U>[kKMG]+)i?B</font><br />' + FILE_INFO_PATTERN = r'document\.getElementById\(\'dlbutton\'\)\.href = "[^;]*/(?P<N>[^"]+)";' FILE_OFFLINE_PATTERN = r'>File does not exist on this server</div>' DOWNLOAD_URL_PATTERN = r"<script type=\"text/javascript\">([^<]*?)document\.getElementById\('dlbutton'\).href = ([^;]+);" |