diff options
Diffstat (limited to 'module/plugins/hoster')
22 files changed, 478 insertions, 98 deletions
diff --git a/module/plugins/hoster/BayfilesCom.py b/module/plugins/hoster/BayfilesCom.py index a69dd3ea9..190d9a952 100644 --- a/module/plugins/hoster/BayfilesCom.py +++ b/module/plugins/hoster/BayfilesCom.py @@ -26,13 +26,13 @@ class BayfilesCom(SimpleHoster): __name__ = "BayfilesCom" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?bayfiles\.com/file/\w+/\w+/.*" - __version__ = "0.02" + __version__ = "0.04" __description__ = """Bayfiles.com plugin - free only""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") FILE_INFO_PATTERN = r'<p title="(?P<N>[^"]+)">[^<]*<strong>(?P<S>[0-9., ]+)(?P<U>[kKMG])i?B</strong></p>' - FILE_OFFLINE_PATTERN = r'<p>The requested file could not be found.</p>' + FILE_OFFLINE_PATTERN = r'(<p>The requested file could not be found.</p>|<title>404 Not Found</title>)' WAIT_PATTERN = r'>Your IP [0-9.]* has recently downloaded a file\. Upgrade to premium or wait (\d+) minutes\.<' VARS_PATTERN = r'var vfid = (\d+);\s*var delay = (\d+);' @@ -82,12 +82,12 @@ class BayfilesCom(SimpleHoster): self.download(url) # check download check = self.checkDownload({ - "waitforfreeslots": re.compile(r"^<title>BayFiles</title>$") + "waitforfreeslots": re.compile(r"<title>BayFiles</title>"), + "notfound": re.compile(r"<title>404 Not Found</title>") }) if check == "waitforfreeslots": - self.waitForFreeSlot() - - def waitForFreeSlot(self): - self.retry(60, 300, "Wait for free slot") + self.retry(60, 300, "Wait for free slot") + elif check == "notfound": + self.retry(60, 300, "404 Not found") getInfo = create_getInfo(BayfilesCom) diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index 1c7d79510..6d6b9c26d 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -46,7 +46,7 @@ class BitshareCom(Hoster): __name__ = "BitshareCom" __type__ = "hoster" __pattern__ = r"http://(www\.)?bitshare\.com/(files/(?P<id1>[a-zA-Z0-9]+)(/(?P<name>.*?)\.html)?|\?f=(?P<id2>[a-zA-Z0-9]+))" - __version__ = "0.42" + __version__ = "0.44" __description__ = """Bitshare.Com File Download Hoster""" __author_name__ = ("paulking", "fragonib") __author_mail__ = (None, "fragonib[AT]yahoo[DOT]es") @@ -58,10 +58,12 @@ class BitshareCom(Hoster): CAPTCHA_KEY_PATTERN = r"http://api\.recaptcha\.net/challenge\?k=(.*?) " def setup(self): - self.multiDL = False + self.multiDL = self.premium self.chunkLimit = 1 def process(self, pyfile): + if self.premium: + self.account.relogin(self.user) self.pyfile = pyfile @@ -116,8 +118,13 @@ class BitshareCom(Hoster): # Waiting if wait > 0: self.logDebug("Waiting %d seconds." % wait) - self.setWait(wait, True) - self.wait() + if wait < 120: + self.setWait(wait, False) + self.wait() + else: + self.setWait(wait - 55, True) + self.wait() + self.retry() # Resolve captcha if captcha == 1: @@ -142,10 +149,12 @@ class BitshareCom(Hoster): url = response.split("#")[-1] return url - + def handleErrors(self, response, separator): self.logDebug("Checking response [%s]" % response) - if "ERROR" in response: + if "ERROR:Session timed out" in response: + self.retry() + elif "ERROR" in response: msg = response.split(separator)[-1] self.fail(msg) @@ -154,5 +163,7 @@ class BitshareCom(Hoster): if "SUCCESS" in response: self.correctCaptcha() return True + elif "ERROR:SESSION ERROR" in response: + self.retry() self.logDebug("Wrong captcha") self.invalidCaptcha()
\ No newline at end of file diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index 0ef9c267c..71c698811 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -45,7 +45,7 @@ class CzshareCom(SimpleHoster): __name__ = "CzshareCom" __type__ = "hoster" __pattern__ = r"http://(\w*\.)*czshare\.(com|cz)/(\d+/|download.php\?).*" - __version__ = "0.86" + __version__ = "0.87" __description__ = """CZshare.com""" __author_name__ = ("zoidberg") @@ -149,7 +149,7 @@ class CzshareCom(SimpleHoster): check = self.checkDownload({ "tempoffline": re.compile(r"^Soubor je do.asn. nedostupn.$"), "multi_dl": re.compile(self.MULTIDL_PATTERN), - "captcha_err": re.compile(self.FREE_FORM_PATTERN) + "captcha_err": "<li>Zadaný ověřovací kód nesouhlasí!</li>" }) if check == "tempoffline": diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py new file mode 100644 index 000000000..529a5a06f --- /dev/null +++ b/module/plugins/hoster/DateiTo.py @@ -0,0 +1,92 @@ +# -*- 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 module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.plugins.ReCaptcha import ReCaptcha + +class DateiTo(SimpleHoster): + __name__ = "DateiTo" + __type__ = "hoster" + __pattern__ = r"http://(?:www\.)?datei\.to/datei/(?P<ID>\w+)\.html" + __version__ = "0.01" + __description__ = """Datei.to plugin - free only""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + FILE_NAME_PATTERN = r'Dateiname:</td>\s*<td colspan="2"><strong>(?P<N>.*?)</' + FILE_SIZE_PATTERN = r'Dateigröße:</td>\s*<td colspan="2">(?P<S>.*?)</' + FILE_OFFLINE_PATTERN = r'>Datei wurde nicht gefunden<|>Bitte wähle deine Datei aus... <' + PARALELL_PATTERN = r'>Du lädst bereits eine Datei herunter<' + + WAIT_PATTERN = r'countdown\({seconds: (\d+)' + DATA_PATTERN = r'url: "(.*?)", data: "(.*?)",' + RECAPTCHA_KEY_PATTERN = r'Recaptcha.create\("(.*?)"' + + def handleFree(self): + url = 'http://datei.to/ajax/download.php' + data = {'P': 'I', 'ID': self.file_info['ID']} + + recaptcha = ReCaptcha(self) + + for i in range(10): + self.logDebug("URL", url, "POST", data) + self.html = self.load(url, post = data) + self.checkErrors() + + if url.endswith('download.php') and 'P' in data: + if data['P'] == 'I': + self.doWait() + + elif data['P'] == 'IV': + break + + found = re.search(self.DATA_PATTERN, self.html) + if not found: self.parseError('data') + url = 'http://datei.to/' + found.group(1) + data = dict(x.split('=') for x in found.group(2).split('&')) + + if url.endswith('recaptcha.php'): + found = re.search(self.RECAPTCHA_KEY_PATTERN, self.html) + recaptcha_key = found.group(1) if found else "6LdBbL8SAAAAAI0vKUo58XRwDd5Tu_Ze1DA7qTao" + + data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge(recaptcha_key) + + else: + self.fail('Too bad...') + + download_url = self.html + self.logDebug('Download URL', download_url) + self.download(download_url) + + def checkErrors(self): + found = re.search(self.PARALELL_PATTERN, self.html) + if found: + self.setWait(wait_time + 1, False) + self.wait(300) + self.retry() + + def doWait(self): + found = re.search(self.WAIT_PATTERN, self.html) + wait_time = int(found.group(1)) if found else 30 + self.setWait(wait_time + 1, False) + + self.load('http://datei.to/ajax/download.php', post = {'P': 'Ads'}) + self.wait() + +getInfo = create_getInfo(DateiTo) diff --git a/module/plugins/hoster/DdlstorageCom.py b/module/plugins/hoster/DdlstorageCom.py new file mode 100644 index 000000000..31c4f4605 --- /dev/null +++ b/module/plugins/hoster/DdlstorageCom.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo + +class DdlstorageCom(XFileSharingPro): + __name__ = "DdlstorageCom" + __type__ = "hoster" + __pattern__ = r"http://(?:\w*\.)*?ddlstorage.com/\w{12}" + __version__ = "0.01" + __description__ = """DDLStorage.com hoster plugin""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + def setup(self): + self.resumeDownload = self.multiDL = self.premium + +getInfo = create_getInfo(DdlstorageCom)
\ No newline at end of file diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index be5e65d52..9ff6b0b55 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -11,12 +11,13 @@ class DepositfilesCom(SimpleHoster): __name__ = "DepositfilesCom" __type__ = "hoster" __pattern__ = r"http://[\w\.]*?depositfiles\.com(/\w{1,3})?/files/[\w]+" - __version__ = "0.39" + __version__ = "0.41" __description__ = """Depositfiles.com Download Hoster""" __author_name__ = ("spoob", "zoidberg") __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz") - FILE_INFO_PATTERN = r'File name: <b title="(?P<N>[^"]+)">.*\s*<span class="nowrap">File size: <b>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</b>' + FILE_NAME_PATTERN = r'File name: <b title="(?P<N>[^"]+)' + FILE_SIZE_PATTERN = r'File size: <b>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</b>' FILE_OFFLINE_PATTERN = r'<span class="html_download_api-not_exists"></span>' FILE_URL_REPLACEMENTS = [(r"\.com(/.*?)?/files", ".com/en/files"), (r"\.html$", "")] @@ -100,7 +101,7 @@ class DepositfilesCom(SimpleHoster): self.logWarning("Download limit reached") self.retry(25, 3600, "Download limit reached") elif 'onClick="show_gold_offer' in self.html: - self.account.relogin() + self.account.relogin(self.user) self.retry() link = unquote(re.search('<div id="download_url">\s*<a href="(http://.+?\.depositfiles.com/.+?)"', self.html).group(1)) self.multiDL = True diff --git a/module/plugins/hoster/EasybytezCom.py b/module/plugins/hoster/EasybytezCom.py index 49214ba99..5b9925e97 100644 --- a/module/plugins/hoster/EasybytezCom.py +++ b/module/plugins/hoster/EasybytezCom.py @@ -24,7 +24,7 @@ class EasybytezCom(XFileSharingPro): __name__ = "EasybytezCom" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)?easybytez.com/(\w+).*" - __version__ = "0.08" + __version__ = "0.09" __description__ = """easybytez.com""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -49,7 +49,7 @@ class EasybytezCom(XFileSharingPro): self.startDownload(found.group(1)) def handleOverriden(self): - self.html = self.load(self.HOSTER_URL) + self.html = self.load(self.HOSTER_NAME) action, inputs = self.parseHtmlForm('') upload_id = "%012d" % int(random()*10**12) action += upload_id + "&js_on=1&utype=prem&upload_type=url" @@ -73,4 +73,4 @@ class EasybytezCom(XFileSharingPro): self.pyfile.url = found.group(1) self.retry() -getInfo = create_getInfo(EasybytezCom) +getInfo = create_getInfo(EasybytezCom)
\ No newline at end of file diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 4f6666675..135dd90a1 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -4,6 +4,7 @@ from module.plugins.Hoster import Hoster from module.plugins.ReCaptcha import ReCaptcha from module.utils import parseFileSize from module.plugins.Plugin import chunks +from module.common.json_layer import json_loads import re @@ -16,7 +17,7 @@ def checkFile(plugin, urls): url_ids = url_dict.keys() urls = map(lambda url_id: 'http://www.filefactory.com/file/' + url_id, url_ids) - html = getURL("http://filefactory.com/tool/links.php", post = {"func": "links", "links": "\n".join(urls)}, decode=True) + html = getURL("http://www.filefactory.com/tool/links.php", post = {"func": "links", "links": "\n".join(urls)}, decode=True) for m in re.finditer(plugin.LC_INFO_PATTERN, html): if m.group('id') in url_ids: @@ -34,29 +35,28 @@ class FilefactoryCom(Hoster): __name__ = "FilefactoryCom" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?filefactory\.com/file/(?P<id>[a-zA-Z0-9]+).*" # URLs given out are often longer but this is the requirement - __version__ = "0.33" + __version__ = "0.34" __description__ = """Filefactory.Com File Download Hoster""" __author_name__ = ("paulking", "zoidberg") - LC_INFO_PATTERN = r'<tr class="(even|odd)">\s*<td>\s*<a href="http://www.filefactory.com/file/(?P<id>\w+)[^"]*">(?P<name>[^<]+)</a>\s*.*\s*</td>\s*<td>(?P<size>[0-9.]+ \w+)</td>' - LC_OFFLINE_PATTERN = r'<li class="(even|odd)">\s*<div class="metadata">http://www.filefactory.com/file/(?P<id>\w+)/</div>' - + LC_INFO_PATTERN = r'<h1 class="name">(?P<name>[^<]+) \((?P<size>[0-9.]+ \w+)\)</h1>\s*<p>http://www.filefactory.com/file/(?P<id>\w+)/' + LC_OFFLINE_PATTERN = r'<p>http://www.filefactory.com/file/(?P<id>\w+)/</p>\s*<p class="errorResponse">' + FILE_OFFLINE_PATTERN = r'<title>File Not Found' FILE_NAME_PATTERN = r'<span class="last">(?P<name>.*?)</span>' FILE_INFO_PATTERN = r'<span>(?P<size>\d(\d|\.)*) (?P<units>..) file uploaded' - FILE_CHECK_PATTERN = r'check:\'(?P<check>.*?)\'' - CAPTCHA_KEY_PATTERN = r'Recaptcha.create\("(?P<recaptchakey>.*?)",' - WAIT_PATH_PATTERN = r'path:"(?P<path>.*?)"' + FILE_CHECK_PATTERN = r'check:\s*\'(?P<check>.*?)\'' + CAPTCHA_KEY_PATTERN = r'Recaptcha.create\(\s*"(.*?)",' WAIT_PATTERN = r'id="startWait" value="(?P<wait>\d+)"' - FILE_URL_PATTERN = r'<a href="(?P<url>.*?)" id="downloadLinkTarget">' + FILE_URL_PATTERN = r'<p[^>]*?id="downloadLinkTarget"[^>]*>\s*<a href="(?P<url>.*?)"' def setup(self): self.multiDL = self.resumeDownloads = self.premium def process(self, pyfile): # Check file - pyfile.name, pyfile.size, status, self.url = checkFile(self, [pyfile.url])[0] + pyfile.name, pyfile.size, status, self.url = checkFile(self, [pyfile.url])[0] if status != 2: self.offline() self.logDebug("File Name: %s Size: %d" % (pyfile.name, pyfile.size)) @@ -93,42 +93,41 @@ class FilefactoryCom(Hoster): # Check Id self.check = re.search(self.FILE_CHECK_PATTERN, self.html).group('check') - self.log.debug("%s: File check code is [%s]" % (self.__name__, self.check)) + self.logDebug("File check code is [%s]" % self.check) # Resolve captcha - self.log.debug("%s: File is captcha protected" % self.__name__) - id = re.search(self.CAPTCHA_KEY_PATTERN, self.html).group('recaptchakey') + found = re.search(self.CAPTCHA_KEY_PATTERN, self.html) + recaptcha_key = found.group(1) if found else "6LeN8roSAAAAAPdC1zy399Qei4b1BwmSBSsBN8zm" + recaptcha = ReCaptcha(self) + # Try up to 5 times - for i in range(5): - self.log.debug("%s: Resolving ReCaptcha with key [%s], round %d" % (self.__name__, id, i+1)) - recaptcha = ReCaptcha(self) - challenge, code = recaptcha.challenge(id) - response = self.load("http://www.filefactory.com/file/checkCaptcha.php", - post={"check" : self.check, "recaptcha_challenge_field" : challenge, "recaptcha_response_field" : code}) - captchavalid = self.handleCaptchaErrors(response) - if captchavalid: + for i in range(5): + challenge, code = recaptcha.challenge(recaptcha_key) + response = json_loads(self.load("http://www.filefactory.com/file/checkCaptcha.php", + post={"check" : self.check, "recaptcha_challenge_field" : challenge, "recaptcha_response_field" : code})) + if response['status'] == 'ok': + self.correctCaptcha() break - if not captchavalid: + else: + self.invalidCaptcha() + else: self.fail("No valid captcha after 5 attempts") - - # Get wait URL - waitpath = re.search(self.WAIT_PATH_PATTERN, response).group('path') - waiturl = "http://www.filefactory.com" + waitpath # This will take us to a wait screen - self.log.debug("%s: fetching wait with url [%s]" % (self.__name__, waiturl)) + waiturl = "http://www.filefactory.com" + response['path'] + self.logDebug("Fetching wait with url [%s]" % waiturl) waithtml = self.load(waiturl, decode=True) # Find the wait value and wait wait = int(re.search(self.WAIT_PATTERN, waithtml).group('wait')) - self.log.debug("%s: Waiting %d seconds." % (self.__name__, wait)) + self.logDebug("Waiting %d seconds." % wait) self.setWait(wait, True) self.wait() # Now get the real download url and retrieve the file url = re.search(self.FILE_URL_PATTERN,waithtml).group('url') # this may either download our file or forward us to an error page - self.log.debug("%s: download url %s" % (self.__name__, url)) + self.logDebug("Download URL: %s" % url) dl = self.download(url) check = self.checkDownload({"multiple": "You are currently downloading too many files at once.", @@ -136,20 +135,11 @@ class FilefactoryCom(Hoster): if check == "multiple": self.setWait(15*60) - self.log.debug("%s: Parallel downloads detected waiting 15 minutes" % self.__name__) + self.logDebug("Parallel downloads detected; waiting 15 minutes") self.wait() self.retry() elif check == "error": self.fail("Unknown error") - - def handleCaptchaErrors(self, response): - self.log.debug("%s: Result of captcha resolving [%s]" % (self.__name__, response)) - if 'status:"ok"' in response: - self.correctCaptcha() - return True - - self.log.debug("%s: Wrong captcha" % self.__name__) - self.invalidCaptcha() def handlePremium(self): self.fail('Please enable direct downloads') diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py new file mode 100644 index 000000000..28ba35abe --- /dev/null +++ b/module/plugins/hoster/GigapetaCom.py @@ -0,0 +1,73 @@ +# -*- 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 randint +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from pycurl import FOLLOWLOCATION + +class GigapetaCom(SimpleHoster): + __name__ = "GigapetaCom" + __type__ = "hoster" + __pattern__ = r"http://(?:www\.)?gigapeta\.com/dl/\w+" + __version__ = "0.01" + __description__ = """GigaPeta.com plugin - free only""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + SH_COOKIES = [("http://gigapeta.com", "lang", "us")] + FILE_NAME_PATTERN = r'<img src=".*" alt="file" />-->\s*(?P<N>.*?)\s*</td>' + FILE_SIZE_PATTERN = r'<th>\s*Size\s*</th>\s*<td>\s*(?P<S>.*?)\s*</td>' + FILE_OFFLINE_PATTERN = r'<div id="page_error">' + + def handleFree(self): + captcha_key = str(randint(1,100000000)) + captcha_url = "http://gigapeta.com/img/captcha.gif?x=%s" % captcha_key + + self.req.http.c.setopt(FOLLOWLOCATION, 0) + + for i in range(5): + self.checkErrors() + + captcha = self.decryptCaptcha(captcha_url) + self.html = self.load(self.pyfile.url, post = { + "captcha_key": captcha_key, + "captcha": captcha, + "download": "Download"}) + + found = re.search(r"Location\s*:\s*(.*)", self.req.http.header, re.I) + if found: + download_url = found.group(1) + break + elif "Entered figures don`t coincide with the picture" in self.html: + self.invalidCaptcha() + else: + self.fail("No valid captcha code entered") + + self.req.http.c.setopt(FOLLOWLOCATION, 1) + self.logDebug("Download URL: %s" % download_url) + self.download(download_url) + + def checkErrors(self): + if "All threads for IP" in self.html: + self.logDebug("Your IP is already downloading a file - wait and retry") + self.setWait(300, True) + self.wait() + self.retry() + +getInfo = create_getInfo(GigapetaCom)
\ No newline at end of file diff --git a/module/plugins/hoster/JumbofilesCom.py b/module/plugins/hoster/JumbofilesCom.py new file mode 100644 index 000000000..a338b31cc --- /dev/null +++ b/module/plugins/hoster/JumbofilesCom.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +import re +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo +from module.utils import html_unescape + +class JumbofilesCom(XFileSharingPro): + __name__ = "JumbofilesCom" + __type__ = "hoster" + __pattern__ = r"http://(?:\w*\.)*(jumbofiles.com)/\w{12}" + __version__ = "0.01" + __description__ = """JumboFiles.com hoster plugin""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + FILE_INFO_PATTERN = '<TR><TD>(?P<N>[^<]+?)\s*<small>\((?P<S>[\d.]+)\s*(?P<U>[KMG][bB])\)</small></TD></TR>' + FILE_OFFLINE_PATTERN = 'Not Found or Deleted / Disabled due to inactivity or DMCA' + DIRECT_LINK_PATTERN = '<FORM METHOD="LINK" ACTION="(.*?)"' + +getInfo = create_getInfo(JumbofilesCom)
\ No newline at end of file diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py index e5fc055c0..88e708bf5 100644 --- a/module/plugins/hoster/LetitbitNet.py +++ b/module/plugins/hoster/LetitbitNet.py @@ -24,7 +24,7 @@ from module.common.json_layer import json_loads class LetitbitNet(SimpleHoster): __name__ = "LetitbitNet" __type__ = "hoster" - __pattern__ = r"http://(?:\w*\.)*letitbit.net/download/.*" + __pattern__ = r"http://(?:\w*\.)*(letitbit|shareflare).net/download/.*" __version__ = "0.19" __description__ = """letitbit.net""" __author_name__ = ("zoidberg") @@ -35,8 +35,9 @@ class LetitbitNet(SimpleHoster): FILE_INFO_PATTERN = r'<h1[^>]*>File:.*?<span>(?P<N>[^<]+)</span>.*?\[<span>(?P<S>[^<]+)</span>]</h1>' FILE_OFFLINE_PATTERN = r'>File not found<' - + DOMAIN = "http://letitbit.net" + FILE_URL_REPLACEMENTS = [(r"(?<=http://)([^/]+)", "letitbit.net")] def setup(self): self.resumeDownload = self.multiDL = True @@ -106,4 +107,4 @@ class LetitbitNet(SimpleHoster): else: self.fail("Download did not finish correctly") -getInfo = create_getInfo(LetitbitNet) +getInfo = create_getInfo(LetitbitNet)
\ No newline at end of file diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index c1d6e3595..717143880 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -58,7 +58,7 @@ class MediafireCom(SimpleHoster): __name__ = "MediafireCom" __type__ = "hoster" __pattern__ = r"http://(\w*\.)*mediafire\.com/(file/|(download.php)?\?)(\w{11}|\w{15})($|/)" - __version__ = "0.74" + __version__ = "0.75" __description__ = """Mediafire.com plugin - free only""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -104,6 +104,7 @@ class MediafireCom(SimpleHoster): else: self.fail("No or incorrect password") + """ links = re.findall(self.DOWNLOAD_LINK_PATTERN, self.html) link_count = len(links) self.logDebug('LINKS ', links) @@ -131,6 +132,11 @@ class MediafireCom(SimpleHoster): else: zindex, download_url = links[0] + """ + found = re.search(r'kNO = "(http://.*?)";', self.html) + if not found: self.parseError("Download URL") + download_url = found.group(1) + self.logDebug("DOWNLOAD LINK:", download_url) self.download(download_url) diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 4aa1cd888..fa2f3ddef 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -55,7 +55,7 @@ class NetloadIn(Hoster): __name__ = "NetloadIn" __type__ = "hoster" __pattern__ = r"http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)" - __version__ = "0.39" + __version__ = "0.40" __description__ = """Netload.in Download Hoster""" __author_name__ = ("spoob", "RaNaN", "Gregy") __author_mail__ = ("spoob@pyload.org", "ranan@pyload.org", "gregy@gregy.cz") @@ -98,8 +98,8 @@ class NetloadIn(Hoster): self.api_data = False return - apiurl = "http://netload.in/share/fileinfos2.php" - src = self.load(apiurl, cookies=False, get={"file_id": match.group(1)}, decode = True).strip() + apiurl = "http://api.netload.in/info.php" + src = self.load(apiurl, cookies=False, get={"file_id": match.group(1), "auth": "Zf9SnQh9WiReEsb18akjvQGqT0I830e8", "bz": "1", "md5": "1"}, decode = True).strip() if not src and n <= 3: sleep(0.2) self.download_api_data(n+1) diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index a8c55f0ba..8a6ab6150 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -27,7 +27,7 @@ class RapidgatorNet(SimpleHoster): __name__ = "RapidgatorNet" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?(rapidgator.net)/file/(\d+)" - __version__ = "0.01" + __version__ = "0.03" __description__ = """rapidgator.net""" __author_name__ = ("zoidberg") @@ -39,6 +39,9 @@ class RapidgatorNet(SimpleHoster): RECAPTCHA_KEY_PATTERN = r'"http://api.recaptcha.net/challenge?k=(.*?)"' def handleFree(self): + if "You can download files up to 500 MB in free mode" in self.html: + self.fail("File too large for free download") + self.checkWait() jsvars = dict(re.findall(self.JSVARS_PATTERN, self.html)) diff --git a/module/plugins/hoster/ShareRapidCom.py b/module/plugins/hoster/ShareRapidCom.py index b9ce61e18..6859b3d9f 100644 --- a/module/plugins/hoster/ShareRapidCom.py +++ b/module/plugins/hoster/ShareRapidCom.py @@ -23,7 +23,7 @@ class ShareRapidCom(SimpleHoster): __name__ = "ShareRapidCom" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?((share(-?rapid\.(biz|com|cz|info|eu|net|org|pl|sk)|-(central|credit|free|net)\.cz|-ms\.net)|(s-?rapid|rapids)\.(cz|sk))|(e-stahuj|mediatack|premium-rapidshare|rapidshare-premium|qiuck)\.cz|kadzet\.com|stahuj-zdarma\.eu|strelci\.net|universal-share\.com)/(stahuj/.+)" - __version__ = "0.47" + __version__ = "0.48" __description__ = """Share-rapid.com plugin - premium only""" __author_name__ = ("MikyWoW", "zoidberg") __author_mail__ = ("MikyWoW@seznam.cz", "zoidberg@mujmail.cz") @@ -60,7 +60,7 @@ class ShareRapidCom(SimpleHoster): else: self.logError("Download URL not found") if re.search(self.ERR_LOGIN_PATTERN, self.html): - self.relogin() + self.relogin(self.user) self.retry(3,0,"User login failed") elif re.search(self.ERR_CREDIT_PATTERN, self.html): self.fail("Not enough credit left") diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index cb624e7a2..719235565 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.27" + __version__ = "0.29" __description__ = """Shareonline.biz Download Hoster""" __author_name__ = ("spoob", "mkaay", "zoidberg") __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz") @@ -73,6 +73,10 @@ class ShareonlineBiz(Hoster): if self.premium: self.account.getAccountInfo(self.user, True) self.retry(reason=_("Invalid download ticket")) + + self.logDebug('DOWNLOAD SIZE: %d B (%d expected)' % (self.pyfile.size , self.exp_size)) + if self.pyfile.size != self.exp_size: + self.retry(reason="Incorrect file size: %d B" % self.pyfile.size) def downloadAPIData(self): api_url_base = "http://api.share-online.biz/linkcheck.php?md5=1" @@ -91,7 +95,7 @@ class ShareonlineBiz(Hoster): def handleFree(self): self.downloadAPIData() self.pyfile.name = self.api_data["filename"] - self.pyfile.size = self.api_data["size"] + self.pyfile.size = self.exp_size = int(self.api_data["size"]) self.html = self.load(self.pyfile.url, cookies = True) #refer, stuff self.setWait(3) @@ -129,7 +133,7 @@ class ShareonlineBiz(Hoster): self.download(download_url) def handleAPIPremium(self): #should be working better - self.account.getAccountInfo(self.user) + self.account.getAccountInfo(self.user, True) src = self.load("http://api.share-online.biz/account.php?username=%s&password=%s&act=download&lid=%s" % (self.user, self.account.accounts[self.user]["password"], self.file_id), post={}) self.api_data = dlinfo = {} for line in src.splitlines(): @@ -141,7 +145,7 @@ class ShareonlineBiz(Hoster): self.offline() self.pyfile.name = dlinfo["name"] - self.pyfile.size = dlinfo["size"] + self.pyfile.size = self.exp_size = int(dlinfo["size"]) dlLink = dlinfo["url"] if dlLink == "server_under_maintenance": diff --git a/module/plugins/hoster/StahnuTo.py b/module/plugins/hoster/StahnuTo.py index a78615dba..354a99b1a 100644 --- a/module/plugins/hoster/StahnuTo.py +++ b/module/plugins/hoster/StahnuTo.py @@ -32,29 +32,32 @@ def getInfo(urls): class StahnuTo(SimpleHoster): __name__ = "StahnuTo" __type__ = "hoster" - __pattern__ = r"http://(\w*\.)?stahnu.to/(files/get/|.*\?file=)([^/]+).*" - __version__ = "0.12" + __pattern__ = r"http://(?:\w*\.)?stahnu.to/(?:files/get/|.*\?file=)(?P<ID>[^/]+).*" + __version__ = "0.14" __description__ = """stahnu.to""" __author_name__ = ("zoidberg") - FILE_NAME_PATTERN = r"<div class='nadpis-01'><h2>(?<N>[^<]+)</h2></div>" - FILE_SIZE_PATTERN = r'<td>Velikost souboru<br /><span>(?<S>[^<]+)\s*(?<U>[kKMG])i?[Bb]</span></td>' + FILE_NAME_PATTERN = r"<td colspan='2'>Název souboru<br /><span>(?P<N>[^<]+)</span>" + FILE_SIZE_PATTERN = r'<td>Velikost souboru<br /><span>(?P<S>[^<]+)\s*(?P<U>[kKMG])i?[Bb]</span></td>' FILE_OFFLINE_PATTERN = r'<!-- Obsah - start -->\s*<!-- Obsah - end -->' - #FILE_OFFLINE_PATTERN = r'<h2 align="center">Tento soubor neexistuje nebo byl odstraněn! </h2>' - CAPTCHA_PATTERN = r'<img src="captcha/captcha.php" id="captcha" /></td>' def setup(self): self.multiDL = True def process(self, pyfile): + if not self.account: + self.fail("Please enter your stahnu.to account") + found = re.search(self.__pattern__, pyfile.url) - file_id = found.group(3) + file_id = found.group(1) - self.html = self.load("http://stahnu.to/?file=" + file_id, decode=True) + self.html = self.load("http://www.stahnu.to/getfile.php?file=%s" % file_id, decode=True) self.getFileInfo() + + if "K stažení souboru se musíte <strong>zdarma</strong> přihlásit!" in self.html: + self.account.relogin(self.user) + self.retry() - self.download("http://stahnu.to/files/gen/" + file_id, post={ - "file": file_id, - "user": "Anonym", - "commenttext": "" + self.download("http://www.stahnu.to/files/gen/" + file_id, post={ + "downloadbutton": u"STÁHNOUT" }) diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 95fcae7f2..9de7f9bd0 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -26,8 +26,8 @@ from pycurl import HTTPHEADER class TurbobitNet(SimpleHoster): __name__ = "TurbobitNet" __type__ = "hoster" - __pattern__ = r"http://(?:\w*\.)?turbobit.net/(?:download/free/)?(?P<ID>\w+).*" - __version__ = "0.03" + __pattern__ = r"http://(?:\w*\.)?(turbobit.net|unextfiles.com)/(?:download/free/)?(?P<ID>\w+).*" + __version__ = "0.05" __description__ = """Turbobit.net plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -35,12 +35,12 @@ class TurbobitNet(SimpleHoster): FILE_INFO_PATTERN = r"<span class='file-icon1[^>]*>(?P<N>[^<]+)</span>\s*\((?P<S>[^\)]+)\)\s*</h1>" #long filenames are shortened FILE_NAME_PATTERN = r'<meta name="keywords" content="\s*(?P<N>[^,]+)' #full name but missing on page2 FILE_OFFLINE_PATTERN = r'<h2>File Not Found</h2>' - FILE_URL_REPLACEMENTS = [(r'(?<=http://)(.*?)(?=turbobit.net/)', '')] + FILE_URL_REPLACEMENTS = [(r"(?<=http://)([^/]+)", "turbobit.net")] SH_COOKIES = [("turbobit.net", "user_lang", "en")] CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"' DOWNLOAD_URL_PATTERN = r'(?P<url>/download/redirect/[^"\']+)' - LIMIT_WAIT_PATTERN = r'<div id="time-limit-text">\s*.*?<span id=\'timeout\'>(\d+)</span> seconds' + LIMIT_WAIT_PATTERN = r'<div id="time-limit-text">\s*.*?<span id=\'timeout\'>(\d+)</span>' CAPTCHA_SRC_PATTERN = r'<img alt="Captcha" src="(.*?)"' def handleFree(self): @@ -53,7 +53,8 @@ class TurbobitNet(SimpleHoster): for i in range(5): found = re.search(self.LIMIT_WAIT_PATTERN, self.html) if found: - self.setWait(int(found.group(1)), True) + wait_time = int(found.group(1)) + self.setWait(wait_time, wait_time > 60) self.wait() self.retry() diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index de60cb7c7..dc9f9a733 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -27,7 +27,7 @@ class UlozTo(SimpleHoster): __name__ = "UlozTo" __type__ = "hoster" __pattern__ = r"http://(\w*\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/(?:live/)?(?P<id>\w+/[^/?]*)" - __version__ = "0.86" + __version__ = "0.87" __description__ = """uloz.to""" __author_name__ = ("zoidberg") @@ -102,8 +102,9 @@ class UlozTo(SimpleHoster): self.download("http://www.ulozto.net" + action, post=inputs, cookies=True) def handlePremium(self): - parsed_url = self.findDownloadURL(premium=True) - self.download(parsed_url, post={"download": "Download"}) + self.download(self.pyfile.url + "?do=directDownload") + #parsed_url = self.findDownloadURL(premium=True) + #self.download(parsed_url, post={"download": "Download"}) def findDownloadURL(self, premium=False): msg = "%s link" % ("Premium" if premium else "Free") diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py new file mode 100644 index 000000000..eb7b5fb23 --- /dev/null +++ b/module/plugins/hoster/UploadheroCom.py @@ -0,0 +1,84 @@ +# -*- 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 module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + +class UploadheroCom(SimpleHoster): + __name__ = "UploadheroCom" + __type__ = "hoster" + __pattern__ = r"http://(?:www\.)?uploadhero\.com/dl/\w+" + __version__ = "0.12" + __description__ = """UploadHero.com plugin""" + __author_name__ = ("mcmyst", "zoidberg") + __author_mail__ = ("mcmyst@hotmail.fr", "zoidberg@mujmail.cz") + + SH_COOKIES = [("http://uploadhero.com", "lang", "en")] + FILE_NAME_PATTERN = r'<div class="nom_de_fichier">(?P<N>.*?)</div>' + FILE_SIZE_PATTERN = r'Taille du fichier : </span><strong>(?P<S>.*?)</strong>' + FILE_OFFLINE_PATTERN = r'<p class="titre_dl_2">|<div class="raison"><strong>Le lien du fichier ci-dessus n\'existe plus.' + + DOWNLOAD_URL_PATTERN = r'<a href="([^"]+)" id="downloadnow"' + + IP_BLOCKED_PATTERN = r'href="(/lightbox_block_download.php\?min=.*?)"' + IP_WAIT_PATTERN = r'<span id="minutes">(\d+)</span>.*\s*<span id="seconds">(\d+)</span>' + + CAPTCHA_PATTERN = r'"(/captchadl\.php\?[a-z0-9]+)"' + FREE_URL_PATTERN = r'var magicomfg = \'<a href="(http://[^<>"]*?)"|"(http://storage\d+\.uploadhero\.com/\?d=[A-Za-z0-9]+/[^<>"/]+)"' + + def handleFree(self): + self.checkErrors() + + found = re.search(self.CAPTCHA_PATTERN, self.html) + if not found: self.parseError("Captcha URL") + captcha_url = "http://uploadhero.com" + found.group(1) + + for i in range(5): + captcha = self.decryptCaptcha(captcha_url) + self.html = self.load(self.pyfile.url, get = {"code": captcha}) + found = re.search(self.FREE_URL_PATTERN, self.html) + if found: + self.correctCaptcha() + download_url = found.group(1) or found.group(2) + break + else: + self.invalidCaptcha() + else: + self.fail("No valid captcha code entered") + + self.download(download_url) + + def handlePremium(self): + self.log.debug("%s: Use Premium Account" % self.__name__) + self.html = self.load(self.pyfile.url) + link = re.search(self.DOWNLOAD_URL_PATTERN, self.html).group(1) + self.log.debug("Downloading link : '%s'" % link) + self.download(link) + + def checkErrors(self): + found = re.search(self.IP_BLOCKED_PATTERN, self.html) + if found: + self.html = self.load("http://uploadhero.com%s" % found.group(1)) + + found = re.search(self.IP_WAIT_PATTERN, self.html) + wait_time = (int(found.group(1)) * 60 + int(found.group(2))) if found else 300 + self.setWait(wait_time, True) + self.wait() + self.retry() + +getInfo = create_getInfo(UploadheroCom)
\ No newline at end of file diff --git a/module/plugins/hoster/WrzucTo.py b/module/plugins/hoster/WrzucTo.py new file mode 100644 index 000000000..4a5e89f22 --- /dev/null +++ b/module/plugins/hoster/WrzucTo.py @@ -0,0 +1,58 @@ +# -*- 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 module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from pycurl import HTTPHEADER + +class WrzucTo(SimpleHoster): + __name__ = "WrzucTo" + __type__ = "hoster" + __pattern__ = r"http://(?:\w+\.)*?wrzuc\.to/([a-zA-Z0-9]+(\.wt|\.html)|(\w+/?linki/[a-zA-Z0-9]+))" + __version__ = "0.01" + __description__ = """Wrzuc.to plugin - free only""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + SH_COOKIES = [("http://www.wrzuc.to", "language", "en")] + FILE_SIZE_PATTERN = r'class="info">\s*<tr>\s*<td>(?P<S>.*?)</td>' + FILE_NAME_PATTERN = r'id="file_info">\s*<strong>(?P<N>.*?)</strong>' + + def setup(self): + self.multiDL = True + + def handleFree(self): + data = dict(re.findall(r'(md5|file): "(.*?)"', self.html)) + if len(data) != 2: self.parseError('File ID') + + self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) + self.req.http.lastURL = self.pyfile.url + self.load("http://www.wrzuc.to/ajax/server/prepair", post = {"md5": data['md5']}) + + self.req.http.lastURL = self.pyfile.url + self.html = self.load("http://www.wrzuc.to/ajax/server/download_link", post = {"file": data['file']}) + + data.update(re.findall(r'"(download_link|server_id)":"(.*?)"', self.html)) + if len(data) != 4: self.parseError('Download URL') + + download_url = "http://%s.wrzuc.to/pobierz/%s" % (data['server_id'], data['download_link']) + self.logDebug("Download URL: %s" % download_url) + self.download(download_url) + +getInfo = create_getInfo(WrzucTo) + diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 0d44300af..6b98b4d08 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -34,7 +34,7 @@ class XFileSharingPro(SimpleHoster): __name__ = "XFileSharingPro" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)*((aieshare|amonshare|asixfiles|azsharing|banashare|batubia|bebasupload|boosterking|buckshare|bulletupload|crocshare|ddlanime|divxme|dopeshare|downupload|eyesfile|eyvx|fik1|file(4safe|4sharing|band|beep|bit|box|dove|fat|forth|made|mak|planet|playgroud|race|rio|strack|upper|velocity)|fooget|4bytez|freefilessharing|glumbouploads|grupload|heftyfile|hipfile|host4desi|hulkshare.com|idupin|imageporter|isharefast|jalurcepat|kingsupload|laoupload|linkzhost|loombo|maknyos|migahost|mlfat4arab|movreel|netuploaded|ok2upload|180upload|1hostclick|ovfile|putshare|pyramidfiles|q4share|queenshare|ravishare|rockdizfile|sendmyway|share(76|beast|hut|run|swift)|sharingonline|6ybh-upload|skipfile|spaadyshare|space4file|speedoshare|upload(baz|boost|c|dot|floor|ic|dville)|uptobox|vidbull|zalaa|zomgupload)\.com|(kupload|movbay|multishare|omegave|toucansharing|uflinq)\.org|(annonhost|fupload|muchshare|supashare|tusfiles|usershare|xuploading)\.net|(banicrazy|flowhot|upbrasil)\.info|(shareyourfilez)|.biz|(bzlink|)\.us|(cloudcache|fileserver)\.cc|(farshare|kingshare)\.to|(filemaze|filehost)\.ws|(goldfile|xfileshare)\.eu|(filestock|moidisk)\.ru|4up\.me|kfiles\.kz|odsiebie\.pl|upchi\.co\.il|upit\.in|verzend\.be)/\w{12}" - __version__ = "0.02" + __version__ = "0.05" __description__ = """XFileSharingPro common hoster base""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -47,13 +47,15 @@ class XFileSharingPro(SimpleHoster): WAIT_PATTERN = r'<span id="countdown_str">.*?>(\d+)</span>' OVR_DOWNLOAD_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)' OVR_KILL_LINK_PATTERN = r'<h2>Delete Link</h2>\s*<textarea[^>]*>([^<]+)' - CAPTCHA_URL_PATTERN = r'(http://[^"\']+?/captchas/[^"\']+)' + CAPTCHA_URL_PATTERN = r'(http://[^"\']+?/captchas?/[^"\']+)' RECAPTCHA_URL_PATTERN = r'http://[^"\']+?recaptcha[^"\']+?\?k=([^"\']+)"' - ERROR_PATTERN = r'class="err">(.*?)<' + CAPTCHA_DIV_PATTERN = r'<b>Enter code.*?<div.*?>(.*?)</div>' + ERROR_PATTERN = r'class=["\']err["\'][^>]*>(.*?)</' DIRECT_LINK_PATTERN = r'This direct link.*?href=["\'](.*?)["\']' def setup(self): + self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] self.HOSTER_NAME = re.search(self.__pattern__, self.pyfile.url).group(1) self.multiDL = True @@ -152,8 +154,14 @@ class XFileSharingPro(SimpleHoster): self.wait() elif 'captcha' in self.errmsg: self.invalidCaptcha() - elif 'countdown' in self.errmsg: + elif 'countdown' or 'Expired session' in self.errmsg: self.retry(3) + elif 'maintenance' in self.errmsg: + self.tempOffline() + elif 'download files up to' in self.errmsg: + self.fail("File too large for free download") + elif 'requires premium' in self.errmsg: + self.fail("File can be downloaded by premium users only") else: self.errmsg = None @@ -222,6 +230,15 @@ class XFileSharingPro(SimpleHoster): captcha_url = found.group(1) inputs['code'] = self.decryptCaptcha(captcha_url) return 2 + else: + found = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.S) + if found: + captcha_div = found.group(1) + self.logDebug(captcha_div) + numerals = re.findall('<span.*?padding-left\s*:\s*(\d+).*?>(\d)</span>', html_unescape(captcha_div)) + inputs['code'] = "".join([a[1] for a in sorted(numerals, key = lambda num: int(num[0]))]) + self.logDebug("CAPTCHA", inputs['code'], numerals) + return 3 return 0 getInfo = create_getInfo(XFileSharingPro)
\ No newline at end of file |