diff options
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/BezvadataCz.py | 2 | ||||
-rw-r--r-- | module/plugins/hoster/DateiTo.py | 20 | ||||
-rw-r--r-- | module/plugins/hoster/DebridItaliaCom.py | 37 | ||||
-rw-r--r-- | module/plugins/hoster/DodanePl.py | 18 | ||||
-rw-r--r-- | module/plugins/hoster/FastshareCz.py | 10 | ||||
-rw-r--r-- | module/plugins/hoster/FileSharkPl.py | 95 | ||||
-rw-r--r-- | module/plugins/hoster/FilerNet.py | 69 | ||||
-rw-r--r-- | module/plugins/hoster/FreakshareCom.py | 4 | ||||
-rw-r--r-- | module/plugins/hoster/FshareVn.py | 2 | ||||
-rw-r--r-- | module/plugins/hoster/GigapetaCom.py | 2 | ||||
-rw-r--r-- | module/plugins/hoster/Keep2shareCc.py | 4 | ||||
-rw-r--r-- | module/plugins/hoster/PremiumTo.py | 4 | ||||
-rw-r--r-- | module/plugins/hoster/RapiduNet.py | 82 | ||||
-rw-r--r-- | module/plugins/hoster/ShareonlineBiz.py | 1 | ||||
-rw-r--r-- | module/plugins/hoster/UploadheroCom.py | 2 |
15 files changed, 227 insertions, 125 deletions
diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py index cefa04e9e..d89616c86 100644 --- a/module/plugins/hoster/BezvadataCz.py +++ b/module/plugins/hoster/BezvadataCz.py @@ -83,6 +83,8 @@ class BezvadataCz(SimpleHoster): elif '<div class="infobox' in self.html: self.tempOffline() + self.info.pop('error', None) + def loadcaptcha(self, data, *args, **kwargs): return data.decode("base64") diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 683c6b75d..e4bff8458 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -18,12 +18,13 @@ class DateiTo(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - NAME_PATTERN = r'Dateiname:</td>\s*<td colspan="2"><strong>(?P<N>.*?)</' - SIZE_PATTERN = r'Dateigröße:</td>\s*<td colspan="2">(?P<S>.*?)</' + NAME_PATTERN = r'Dateiname:</td>\s*<td colspan="2"><strong>(?P<N>.*?)</' + SIZE_PATTERN = r'Dateigröße:</td>\s*<td colspan="2">(?P<S>.*?)</' 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+)' + WAIT_PATTERN = r'countdown\({seconds: (\d+)' + MULTIDL_PATTERN = r'>Du lädst bereits eine Datei herunter<' + DATA_PATTERN = r'url: "(.*?)", data: "(.*?)",' @@ -55,16 +56,19 @@ class DateiTo(SimpleHoster): else: self.fail(_("Too bad...")) - download_url = self.html - self.download(download_url) + self.download(self.html) def checkErrors(self): - m = re.search(self.PARALELL_PATTERN, self.html) + m = re.search(self.MULTIDL_PATTERN, self.html) if m: m = re.search(self.WAIT_PATTERN, self.html) wait_time = int(m.group(1)) if m else 30 - self.retry(wait_time=wait_time) + + errmsg = self.info['error'] = _("Parallel downloads") + self.retry(wait_time=wait_time, reason=errmsg) + + self.info.pop('error', None) def doWait(self): diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py index dbac000c8..90f1233ff 100644 --- a/module/plugins/hoster/DebridItaliaCom.py +++ b/module/plugins/hoster/DebridItaliaCom.py @@ -3,48 +3,51 @@ import re from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import replace_patterns class DebridItaliaCom(Hoster): __name__ = "DebridItaliaCom" __type__ = "hoster" - __version__ = "0.05" + __version__ = "0.06" - __pattern__ = r'https?://(?:[^/]*\.)?debriditalia\.com' + __pattern__ = r'http://s\d+\.debriditalia\.com/dl/\d+' __description__ = """Debriditalia.com hoster plugin""" __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] + __authors__ = [("stickell", "l.stickell@yahoo.it"), + ("Walter Purcaro", "vuolter@gmail.com")] + + + URL_REPLACEMENTS = [(r'(/dl/\d+)$', '\1/')] def setup(self): - self.chunkLimit = -1 + self.chunkLimit = -1 self.resumeDownload = True def process(self, pyfile): + pyfile.url = replace_patterns(pyfile.url, cls.URL_REPLACEMENTS) + if re.match(self.__pattern__, pyfile.url): - new_url = pyfile.url + link = pyfile.url + elif not self.account: self.logError(_("Please enter your %s account or deactivate this plugin") % "DebridItalia") self.fail(_("No DebridItalia account provided")) + else: - self.logDebug("Old URL: %s" % pyfile.url) - url = "http://debriditalia.com/linkgen2.php?xjxfun=convertiLink&xjxargs[]=S<![CDATA[%s]]>" % pyfile.url - page = self.load(url) - self.logDebug("XML data: %s" % page) + html = self.load("http://www.debriditalia.com/api.php?generate=&link=%s" % pyfile.url) - if 'File not available' in page: - self.fail(_("File not available")) - else: - new_url = re.search(r'<a href="(?:[^"]+)">(?P<direct>[^<]+)</a>', page).group('direct') + if "ERROR" in html: + self.fail(re.search(r'ERROR:(.*)', html).split()) - if new_url != pyfile.url: - self.logDebug("New URL: %s" % new_url) + link = html.split() - self.download(new_url, disposition=True) + self.download(link, disposition=True) - check = self.checkDownload({"empty": re.compile(r"^$")}) + check = self.checkDownload({'empty': re.compile(r"^$")}) if check == "empty": self.retry(5, 2 * 60, "Empty file downloaded") diff --git a/module/plugins/hoster/DodanePl.py b/module/plugins/hoster/DodanePl.py new file mode 100644 index 000000000..58f1c02d8 --- /dev/null +++ b/module/plugins/hoster/DodanePl.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.DeadHoster import DeadHoster, parseFileInfo + + +class DodanePl(DeadHoster): + __name__ = "DodanePl" + __type__ = "hoster" + __version__ = "0.03" + + __pattern__ = r'http://(?:www\.)?dodane\.pl/file/\d+' + + __description__ = """Dodane.pl hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("z00nx", "z00nx0@gmail.com")] + + +getInfo = create_getInfo(DodanePl) diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index 8b01b5edd..1f1e9e6ee 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -35,14 +35,16 @@ class FastshareCz(SimpleHoster): def checkErrors(self): if self.SLOT_ERROR in self.html: - e = self.info['error'] = _("No free slots") - self.retry(12, 60, e) + errmsg = self.info['error'] = _("No free slots") + self.retry(12, 60, errmsg) if self.CREDIT_ERROR in self.html: - e = self.info['error'] = _("Not enough traffic left") - self.logWarning(e) + errmsg = self.info['error'] = _("Not enough traffic left") + self.logWarning(errmsg) self.resetAccount() + self.info.pop('error', None) + def handleFree(self): m = re.search(self.FREE_URL_PATTERN, self.html) diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index 5a9cbb456..ea2b56821 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FileSharkPl(SimpleHoster): __name__ = "FileSharkPl" __type__ = "hoster" - __version__ = "0.01" + __version__ = "0.03" __pattern__ = r'http://(?:www\.)?fileshark\.pl/pobierz/\d{6}/\w{5}' @@ -20,22 +20,23 @@ class FileSharkPl(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] + CONTENT_DISPOSITION = True + NAME_PATTERN = r'<h2 class="name-file">(?P<N>.+)</h2>' SIZE_PATTERN = r'<p class="size-file">(.*?)<strong>(?P<S>\d+\.?\d*)\s(?P<U>\w+)</strong></p>' OFFLINE_PATTERN = '(P|p)lik zosta. (usuni.ty|przeniesiony)' - DOWNLOAD_ALERT = r'<p class="lead text-center alert alert-warning">(.*?)</p>' - IP_BLOCKED_PATTERN = 'Strona jest dost.pna wy..cznie dla u.ytkownik.w znajduj.cych si. na terenie Polski' - DOWNLOAD_SLOTS_ERROR_PATTERN = r'Osi.gni.to maksymaln. liczb. .ci.ganych jednocze.nie plik.w\.' - - DOWNLOAD_URL_FREE = r'<a href="(.*?)" class="btn-upload-free">' - DOWNLOAD_URL_PREMIUM = r'<a href="(.*?)" class="btn-upload-premium">' + LINK_FREE_PATTERN = r'<a href="(.*?)" class="btn-upload-free">' + LINK_PREMIUM_PATTERN = r'<a href="(.*?)" class="btn-upload-premium">' - SECONDS_PATTERN = r'var timeToDownload = (\d+);' + WAIT_PATTERN = r'var timeToDownload = (\d+);' + ERROR_PATTERN = r'<p class="lead text-center alert alert-warning">(.*?)</p>' + IP_ERROR_PATTERN = r'Strona jest dost.pna wy..cznie dla u.ytkownik.w znajduj.cych si. na terenie Polski' + SLOT_ERROR_PATTERN = r'Osi.gni.to maksymaln. liczb. .ci.ganych jednocze.nie plik.w\.' - CAPTCHA_IMG_PATTERN = '<img src="data:image/jpeg;base64,(.*?)" title="captcha"' - CAPTCHA_TOKEN_PATTERN = r'name="form\[_token\]" value="(.*?)" />' + CAPTCHA_PATTERN = '<img src="data:image/jpeg;base64,(.*?)" title="captcha"' + TOKEN_PATTERN = r'name="form\[_token\]" value="(.*?)" />' def setup(self): @@ -47,77 +48,79 @@ class FileSharkPl(SimpleHoster): self.multiDL = False - def prepare(self): - super(FileSharkPl, self).prepare() + def checkErrors(self): + # check if file is now available for download (-> file name can be found in html body) + m = re.search(self.WAIT_PATTERN, self.html) + if m: + errmsg = self.info['error'] = _("Another download already run") + self.retry(15, int(m.group(1)), errmsg) - m = re.search(self.DOWNLOAD_ALERT, self.html): + m = re.search(self.ERROR_PATTERN, self.html): if m: - return + alert = m.group(1) - alert = m.group(1) + if re.match(self.IP_ERROR_PATTERN, alert): + self.fail(_("Only connections from Polish IP are allowed")) - if re.match(self.IP_BLOCKED_PATTERN, alert): - self.fail(_("Only connections from Polish IP are allowed")) - elif re.match(self.DOWNLOAD_SLOTS_ERROR_PATTERN, alert): - self.logInfo(_("No free download slots available")) - self.retry(10, 30 * 60, _("Still no free download slots available")) - else: - self.logInfo(alert) - self.retry(10, 10 * 60, _("Try again later")) + elif re.match(self.SLOT_ERROR_PATTERN, alert): + errmsg = self.info['error'] = _("No free download slots available") + self.logWarning(errmsg) + self.retry(10, 30 * 60, _("Still no free download slots available")) + + else: + self.info['error'] = alert + self.retry(10, 10 * 60, _("Try again later")) + + self.info.pop('error', None) #@NOTE: handlePremium method was never been tested def handlePremium(self): - self.logDebug("Premium accounts support in experimental modus!") - m = re.search(self.DOWNLOAD_URL_PREMIUM, self.html) - file_url = urljoin("http://fileshark.pl", m.group(1)) - - self.download(file_url, disposition=True) - self.checkDownload() + super(FilerNet, self).handlePremium() + if self.link: + self.link = urljoin("http://fileshark.pl/", self.link) def handleFree(self): - m = re.search(self.DOWNLOAD_URL_FREE, self.html) + m = re.search(self.LINK_FREE_PATTERN, self.html) if m is None: self.error(_("Download url not found")) - file_url = urljoin("http://fileshark.pl", m.group(1)) + link = urljoin("http://fileshark.pl", m.group(1)) - m = re.search(self.SECONDS_PATTERN, self.html) + m = re.search(self.WAIT_PATTERN, self.html) if m: seconds = int(m.group(1)) self.logDebug("Wait %s seconds" % seconds) - self.wait(seconds + 2) + self.wait(seconds) action, inputs = self.parseHtmlForm('action=""') - m = re.search(self.CAPTCHA_TOKEN_PATTERN, self.html) + + m = re.search(self.TOKEN_PATTERN, self.html) if m is None: self.retry(reason=_("Captcha form not found")) inputs['form[_token]'] = m.group(1) - m = re.search(self.CAPTCHA_IMG_PATTERN, self.html) + m = re.search(self.CAPTCHA_PATTERN, self.html) if m is None: self.retry(reason=_("Captcha image not found")) - tmp_load = self.load - self.load = self.decode64 #: injects decode64 inside decryptCaptcha + tmp_load = self.load + self.load = self._decode64 #: work-around: injects decode64 inside decryptCaptcha inputs['form[captcha]'] = self.decryptCaptcha(m.group(1), imgtype='jpeg') inputs['form[start]'] = "" self.load = tmp_load - self.download(file_url, post=inputs, cookies=True, disposition=True) - self.checkDownload() + self.download(link, post=inputs, cookies=True, disposition=True) - def checkDownload(self): - check = super(FileSharkPl, self).checkDownload({ - 'wrong_captcha': re.compile(r'<label for="form_captcha" generated="true" class="error">(.*?)</label>'), - 'wait_pattern': re.compile(self.SECONDS_PATTERN), - 'DL-found': re.compile('<a href="(.*)">') - }) + def checkFile(self): + check = self.checkDownload({'wrong_captcha': re.compile(r'<label for="form_captcha" generated="true" class="error">(.*?)</label>'), + 'wait_pattern' : re.compile(self.SECONDS_PATTERN), + 'DL-found' : re.compile('<a href="(.*)">')}) if check == "DL-found": self.correctCaptcha() @@ -130,7 +133,7 @@ class FileSharkPl(SimpleHoster): self.retry() - def decode64(self, data, *args, **kwargs): + def _decode64(self, data, *args, **kwargs): return data.decode("base64") diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index d9876c573..c943a076d 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -4,7 +4,6 @@ # http://filer.net/get/ivgf5ztw53et3ogd # http://filer.net/get/hgo14gzcng3scbvv -import pycurl import re from urlparse import urljoin @@ -16,83 +15,67 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __version__ = "0.08" + __version__ = "0.09" __pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+' __description__ = """Filer.net hoster plugin""" __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] + __authors__ = [("stickell", "l.stickell@yahoo.it") + ("Walter Purcaro", "vuolter@gmail.com")] - INFO_PATTERN = r'<h1 class="page-header">Free Download (?P<N>\S+) <small>(?P<S>[\w.]+) (?P<U>[\w^_]+)</small></h1>' + CONTENT_DISPOSITION = True + + INFO_PATTERN = r'<h1 class="page-header">Free Download (?P<N>\S+) <small>(?P<S>[\w.]+) (?P<U>[\w^_]+)</small></h1>' OFFLINE_PATTERN = r'Nicht gefunden' - LINK_PATTERN = r'href="([^"]+)">Get download</a>' + LINK_FREE_PATTERN = LINK_PREMIUM_PATTERN = r'href="([^"]+)">Get download</a>' - def handleFree(self): + def checkErrors(self): # Wait between downloads m = re.search(r'musst du <span id="time">(\d+)</span> Sekunden warten', self.html) if m: - self.retry(wait_time=int(m.group(1)), reason=_("Wait between free downloads")) + errmsg = self.info['error'] = _("Wait between free downloads") + self.retry(wait_time=int(m.group(1)), reason=errmsg) - self.html = self.load(self.pyfile.url, decode=True) + self.info.pop('error', None) + + def handleFree(self): inputs = self.parseHtmlForm(input_names={'token': re.compile(r'.+')})[1] if 'token' not in inputs: self.error(_("Unable to detect token")) - token = inputs['token'] - self.logDebug("Token: " + token) - self.html = self.load(self.pyfile.url, post={'token': token}, decode=True) + self.html = self.load(self.pyfile.url, post={'token': inputs['token']}, decode=True) inputs = self.parseHtmlForm(input_names={'hash': re.compile(r'.+')})[1] if 'hash' not in inputs: self.error(_("Unable to detect hash")) - hash_data = inputs['hash'] - self.logDebug("Hash: " + hash_data) - downloadURL = r'' recaptcha = ReCaptcha(self) for _i in xrange(5): challenge, response = recaptcha.challenge() - post_data = {'recaptcha_challenge_field': challenge, - 'recaptcha_response_field': response, - 'hash': hash_data} - - # Workaround for 0.4.9 just_header issue. In 0.5 clean the code using just_header - self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0) - self.load(self.pyfile.url, post=post_data) - self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1) - - if 'location' in self.req.http.header.lower(): - location = re.search(r'location: (\S+)', self.req.http.header, re.I).group(1) - downloadURL = urljoin('http://filer.net', location) + + header = self.load(self.pyfile.url, + post={'recaptcha_challenge_field': challenge, + 'recaptcha_response_field' : response, + 'hash' : inputs['hash']}) + + if 'location' in header and header['location']: self.correctCaptcha() - break + self.link = urljoin('http://filer.net', header['location']) + return else: self.invalidCaptcha() - if not downloadURL: - self.fail(_("No Download url retrieved/all captcha attempts failed")) - - self.download(downloadURL, disposition=True) - def handlePremium(self): - header = self.load(self.pyfile.url, just_header=True) - if 'location' in header: # Direct Download ON - dl = self.pyfile.url - else: # Direct Download OFF - html = self.load(self.pyfile.url) - m = re.search(self.LINK_PATTERN, html) - if m is None: - self.error(_("LINK_PATTERN not found")) - dl = 'http://filer.net' + m.group(1) - - self.download(dl, disposition=True) + super(FilerNet, self).handlePremium() + if self.link: + self.link = urljoin("http://filer.net/", self.link) getInfo = create_getInfo(FilerNet) diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 1a811b007..00c31c528 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -163,10 +163,6 @@ class FreakshareCom(Hoster): herewego = self.load(self.pyfile.url, None, request_options) # the actual download-Page - # comment this in, when it doesnt work - # with open("DUMP__FS_.HTML", "w") as fp: - # fp.write(herewego) - to_sort = re.findall(r"<input\stype=\".*?\"\svalue=\"(\S*?)\".*?name=\"(\S*?)\"\s.*?\/>", herewego) request_options = dict((n, v) for (v, n) in to_sort) diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 2ab65ae99..3c230bbe2 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -112,6 +112,8 @@ class FshareVn(SimpleHoster): self.logError(msg) self.retry(30, 2 * 60, msg) + self.info.pop('error', None) + def checkDownloadedFile(self): # check download diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index c015b8ac3..37af7f216 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -61,5 +61,7 @@ class GigapetaCom(SimpleHoster): self.wait(5 * 60, True) self.retry() + self.info.pop('error', None) + getInfo = create_getInfo(GigapetaCom) diff --git a/module/plugins/hoster/Keep2shareCc.py b/module/plugins/hoster/Keep2shareCc.py index 7ca29701a..cb5e65a29 100644 --- a/module/plugins/hoster/Keep2shareCc.py +++ b/module/plugins/hoster/Keep2shareCc.py @@ -49,8 +49,8 @@ class Keep2shareCc(SimpleHoster): m = re.search(self.ERROR_PATTERN, self.html) if m: - e = self.info['error'] = m.group(1) - self.error(e) + errmsg = self.info['error'] = m.group(1) + self.error(errmsg) m = re.search(self.WAIT_PATTERN, self.html) if m: diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index beab4391e..b4fe327db 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +from __future__ import with_statement + from os import remove from os.path import exists from urllib import quote @@ -11,7 +13,7 @@ from module.utils import fs_encode class PremiumTo(Hoster): __name__ = "PremiumTo" __type__ = "hoster" - __version__ = "0.10" + __version__ = "0.11" __pattern__ = r'https?://(?:www\.)?premium\.to/.*' diff --git a/module/plugins/hoster/RapiduNet.py b/module/plugins/hoster/RapiduNet.py new file mode 100644 index 000000000..e14b18a4f --- /dev/null +++ b/module/plugins/hoster/RapiduNet.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- + +import re + +from pycurl import HTTPHEADER +from time import time, altzone + +from module.common.json_layer import json_loads +from module.plugins.internal.CaptchaService import ReCaptcha +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class RapiduNet(SimpleHoster): + __name__ = "RapiduNet" + __type__ = "hoster" + __version__ = "0.02" + + __pattern__ = r'https?://(?:www\.)?rapidu\.net/(?P<ID>\d{10})' + + __description__ = """Rapidu.net hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("prOq", None)] + + + COOKIES = [("rapidu.net", "rapidu_lang", "en")] + + FILE_INFO_PATTERN = r'<h1 title="(?P<N>.*)">.*</h1>\s*<small>(?P<S>\d+(\.\d+)?)\s(?P<U>\w+)</small>' + OFFLINE_PATTERN = r'404 - File not found' + + ERROR_PATTERN = r'<div class="error">' + + RECAPTCHA_KEY = r'6Ld12ewSAAAAAHoE6WVP_pSfCdJcBQScVweQh8Io' + + + def setup(self): + self.resumeDownload = True + self.multiDL = True + self.limitDL = 0 if self.premium else 2 + + + def handleFree(self): + self.req.http.lastURL = self.pyfile.url + self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) + + jsvars = self.getJsonResponse("https://rapidu.net/ajax.php?a=getLoadTimeToDownload", {'_go': None}) + + if str(jsvars['timeToDownload']) is "stop": + t = (24 * 60 * 60) - (int(time()) % (24 *60 * 60)) + altzone + + self.logInfo("You've reach your daily download transfer") + + self.retry(10, 10 if t < 1 else None, "Try tomorrow again") #@NOTE: check t in case of not synchronised clock + + else: + self.wait(int(jsvars['timeToDownload']) - int(time())) + + recaptcha = ReCaptcha(self) + + for _i in xrange(10): + challenge, code = recaptcha.challenge(self.RECAPTCHA_KEY) + + jsvars = self.getJsonResponse("https://rapidu.net/ajax.php?a=getCheckCaptcha", + {'_go' : None, + 'captcha1': challenge, + 'captcha2': code, + 'fileId' : self.info['ID']}) + if jsvars['message'] == 'success': + self.download(jsvars['url']) + break + + + def getJsonResponse(self, url, post_data): + response = self.load(url, post=post_data, decode=True) + if not response.startswith('{'): + self.retry() + + self.logDebug(url, response) + + return json_loads(response) + + +getInfo = create_getInfo(RapiduNet) diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index d52328fd6..1cb651b12 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -160,6 +160,7 @@ class ShareonlineBiz(SimpleHoster): def checkErrors(self): m = re.search(r"/failure/(.*?)/1", self.req.lastEffectiveURL) if m is None: + self.info.pop('error', None) return errmsg = m.group(1).lower() diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index 92066abb5..189079017 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/plugins/hoster/UploadheroCom.py @@ -75,5 +75,7 @@ class UploadheroCom(SimpleHoster): self.wait(wait_time, True) self.retry() + self.info.pop('error', None) + getInfo = create_getInfo(UploadheroCom) |