diff options
author | GammaC0de <GammaC0de@users.noreply.github.com> | 2015-04-14 01:49:49 +0200 |
---|---|---|
committer | GammaC0de <GammaC0de@users.noreply.github.com> | 2015-04-14 01:49:49 +0200 |
commit | 20d88924fd6a3a5d15b521441a414aa3f8121e79 (patch) | |
tree | 2477c8c150048bdc580a6fe6000eb62d6db89b6f | |
parent | Update DepositfilesCom.py (diff) | |
parent | [UnSkipOnFail] Typo (diff) | |
download | pyload-20d88924fd6a3a5d15b521441a414aa3f8121e79.tar.xz |
Merge pull request #1 from pyload/stable
Sync
38 files changed, 136 insertions, 166 deletions
diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py index 0acacbb2a..a9068f1df 100644 --- a/module/plugins/accounts/OboomCom.py +++ b/module/plugins/accounts/OboomCom.py @@ -2,7 +2,20 @@ import time -from beaker.crypto.pbkdf2 import PBKDF2 +try: + from beaker.crypto.pbkdf2 import PBKDF2 + +except ImportError: + from beaker.crypto.pbkdf2 import pbkdf2 + from binascii import b2a_hex + class PBKDF2(object): + def __init__(self, passphrase, salt, iterations=1000): + self.passphrase = passphrase + self.salt = salt + self.iterations = iterations + + def hexread(self, octets): + return b2a_hex(pbkdf2(self.passphrase, self.salt, self.iterations, octets)) from module.common.json_layer import json_loads from module.plugins.Account import Account @@ -11,7 +24,7 @@ from module.plugins.Account import Account class OboomCom(Account): __name__ = "OboomCom" __type__ = "account" - __version__ = "0.23" + __version__ = "0.24" __description__ = """Oboom.com account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py index 87efb89b3..3c8226704 100644 --- a/module/plugins/accounts/SmoozedCom.py +++ b/module/plugins/accounts/SmoozedCom.py @@ -3,7 +3,20 @@ import hashlib import time -from beaker.crypto.pbkdf2 import PBKDF2 +try: + from beaker.crypto.pbkdf2 import PBKDF2 + +except ImportError: + from beaker.crypto.pbkdf2 import pbkdf2 + from binascii import b2a_hex + class PBKDF2(object): + def __init__(self, passphrase, salt, iterations=1000): + self.passphrase = passphrase + self.salt = salt + self.iterations = iterations + + def hexread(self, octets): + return b2a_hex(pbkdf2(self.passphrase, self.salt, self.iterations, octets)) from module.common.json_layer import json_loads from module.plugins.Account import Account @@ -12,7 +25,7 @@ from module.plugins.Account import Account class SmoozedCom(Account): __name__ = "SmoozedCom" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Smoozed.com account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/RestartSlow.py b/module/plugins/hooks/RestartSlow.py deleted file mode 100644 index db535b3d1..000000000 --- a/module/plugins/hooks/RestartSlow.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- - -import pycurl - -from module.plugins.Hook import Hook - - -class RestartSlow(Hook): - __name__ = "RestartSlow" - __type__ = "hook" - __version__ = "0.04" - - __config__ = [("free_limit" , "int" , "Transfer speed threshold in kilobytes" , 100 ), - ("free_time" , "int" , "Sample interval in minutes" , 5 ), - ("premium_limit", "int" , "Transfer speed threshold for premium download in kilobytes", 300 ), - ("premium_time" , "int" , "Sample interval for premium download in minutes" , 2 ), - ("safe_mode" , "bool", "Don't restart if download is not resumable" , True)] - - __description__ = """Restart slow downloads""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - - - event_list = ["downloadStarts"] - interval = 0 #@TODO: Remove in 0.4.10 - - - def setup(self): - self.info = {'chunk': {}} - - - def periodical(self): - if not self.pyfile.plugin.req.dl: - return - - if self.getConfig('safe_mode') and not self.pyfile.plugin.resumeDownload: - time = 30 - limit = 5 - else: - type = "premium" if self.pyfile.plugin.premium else "free" - time = max(30, self.getConfig("%s_time" % type) * 60) - limit = max(5, self.getConfig("%s_limit" % type) * 1024) - - chunks = [chunk for chunk in self.pyfile.plugin.req.dl.chunks \ - if chunk.id not in self.info['chunk'] or self.info['chunk'][chunk.id] is not (time, limit)] - - for chunk in chunks: - chunk.c.setopt(pycurl.LOW_SPEED_TIME , time) - chunk.c.setopt(pycurl.LOW_SPEED_LIMIT, limit) - - self.info['chunk'][chunk.id] = (time, limit) - - - def downloadStarts(self, pyfile, url, filename): - if self.cb or (self.getConfig('safe_mode') and not pyfile.plugin.resumeDownload): - return - self.pyfile = pyfile - super(RestartSlow, self).initPeriodical() diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index ebd370a0f..6cd742c91 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -7,7 +7,7 @@ from module.plugins.Hook import Hook class UnSkipOnFail(Hook): __name__ = "UnSkipOnFail" __type__ = "hook" - __version__ = "0.05" + __version__ = "0.06" __config__ = [("activated", "bool", "Activated", True)] @@ -43,7 +43,7 @@ class UnSkipOnFail(Hook): # It creates a temporary PyFile object using # "link" data, changes its status, and tells # the core.files-manager to save its data. - pylink = _pyfile(link) + pylink = self._pyfile(link) pylink.setCustomStatus(_("unskipped"), "queued") diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py index 37dd38e02..fbb17635c 100644 --- a/module/plugins/hoster/BezvadataCz.py +++ b/module/plugins/hoster/BezvadataCz.py @@ -76,7 +76,7 @@ class BezvadataCz(SimpleHoster): wait_time = (int(m.group(1)) * 60 + int(m.group(2))) if m else 120 self.wait(wait_time, False) - self.download(url) + self.link = url def checkErrors(self): diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index 43f29c41f..79aaedcd9 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -72,7 +72,7 @@ class BitshareCom(SimpleHoster): self.logDebug("File ajax id is [%s]" % self.ajaxid) # This may either download our file or forward us to an error page - self.download(self.getDownloadUrl()) + self.link = self.getDownloadUrl() if self.checkDownload({"error": ">Error occured<"}): self.retry(5, 5 * 60, "Bitshare host : Error occured") diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py index 89882d7f1..ad514f5eb 100644 --- a/module/plugins/hoster/DataportCz.py +++ b/module/plugins/hoster/DataportCz.py @@ -38,7 +38,7 @@ class DataportCz(SimpleHoster): else: self.error(_("captcha")) - self.html = self.download("http://www.dataport.cz%s" % action, post=inputs) + self.download("http://www.dataport.cz%s" % action, post=inputs) check = self.checkDownload({"captcha": 'alert("\u0160patn\u011b opsan\u00fd k\u00f3d z obr\u00e1zu");', "slot" : 'alert("Je n\u00e1m l\u00edto, ale moment\u00e1ln\u011b nejsou'}) diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index e93ebcf04..71a9eb4bf 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -57,7 +57,7 @@ class DateiTo(SimpleHoster): else: self.fail(_("Too bad...")) - self.download(self.html) + self.link = self.html def checkErrors(self): diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 48b325b48..cc24e351e 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DepositfilesCom(SimpleHoster): __name__ = "DepositfilesCom" __type__ = "hoster" - __version__ = "0.54" + __version__ = "0.55" __pattern__ = r'https?://(?:www\.)?(depositfiles\.com|dfiles\.(eu|ru))(/\w{1,3})?/files/(?P<ID>\w+)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -28,7 +28,7 @@ class DepositfilesCom(SimpleHoster): OFFLINE_PATTERN = r'<span class="html_download_api-not_exists"></span>' NAME_REPLACEMENTS = [(r'\%u([0-9A-Fa-f]{4})', lambda m: unichr(int(m.group(1), 16))), - (r'.*<b title="(?P<N>.+?)".*', "\g<N>")] + (r'.*<b title="(?P<N>.+?)".*', "\g<N>")] URL_REPLACEMENTS = [(__pattern__ + ".*", "https://dfiles.eu/files/\g<ID>")] COOKIES = [("dfiles.eu", "lang_current", "en")] @@ -52,8 +52,7 @@ class DepositfilesCom(SimpleHoster): params = {'fid': m.group(1)} self.logDebug("FID: %s" % params['fid']) - self.setWait(60) - self.wait() + self.checkErrors() recaptcha = ReCaptcha(self) captcha_key = recaptcha.detect_key() @@ -68,9 +67,6 @@ class DepositfilesCom(SimpleHoster): m = re.search(self.LINK_FREE_PATTERN, self.html) if m: - if 'response' in params: - self.correctCaptcha() - self.link = unquote(m.group(1)) diff --git a/module/plugins/hoster/DropboxCom.py b/module/plugins/hoster/DropboxCom.py index c948039ac..eec968f5a 100644 --- a/module/plugins/hoster/DropboxCom.py +++ b/module/plugins/hoster/DropboxCom.py @@ -27,8 +27,8 @@ class DropboxCom(SimpleHoster): def setup(self): - self.multiDL = True - self.chunkLimit = 1 + self.multiDL = True + self.chunkLimit = 1 self.resumeDownload = True diff --git a/module/plugins/hoster/EdiskCz.py b/module/plugins/hoster/EdiskCz.py index cfa6da4eb..b8485001e 100644 --- a/module/plugins/hoster/EdiskCz.py +++ b/module/plugins/hoster/EdiskCz.py @@ -51,7 +51,7 @@ class EdiskCz(SimpleHoster): if not re.match(self.LINK_FREE_PATTERN, url): self.fail(_("Unexpected server response")) - self.download(url) + self.link = url getInfo = create_getInfo(EdiskCz) diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py index 922665c2e..842e0cb87 100644 --- a/module/plugins/hoster/EuroshareEu.py +++ b/module/plugins/hoster/EuroshareEu.py @@ -34,7 +34,7 @@ class EuroshareEu(SimpleHoster): self.account.relogin(self.user) self.retry(reason=_("User not logged in")) - self.download(pyfile.url.rstrip('/') + "/download/") + self.link = pyfile.url.rstrip('/') + "/download/" check = self.checkDownload({"login": re.compile(self.ERR_NOT_LOGGED_IN_PATTERN), "json" : re.compile(r'\{"status":"error".*?"message":"(.*?)"')}) diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index a485f0c4d..f3b4d28be 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -72,8 +72,7 @@ class ExtabitCom(SimpleHoster): if m is None: self.error(_("LINK_FREE_PATTERN not found")) - url = m.group(1) - self.download(url) + self.link = m.group(1) getInfo = create_getInfo(ExtabitCom) diff --git a/module/plugins/hoster/FilecloudIo.py b/module/plugins/hoster/FilecloudIo.py index f4c8fedd6..38d2972a1 100644 --- a/module/plugins/hoster/FilecloudIo.py +++ b/module/plugins/hoster/FilecloudIo.py @@ -104,8 +104,7 @@ class FilecloudIo(SimpleHoster): if "size" in self.info and self.info['size']: self.check_data = {"size": int(self.info['size'])} - download_url = m.group(1) - self.download(download_url) + self.link = m.group(1) else: self.fail(_("Unexpected server response")) diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py index 78960dc6d..2a9e3dc26 100644 --- a/module/plugins/hoster/FilepostCom.py +++ b/module/plugins/hoster/FilepostCom.py @@ -79,20 +79,11 @@ class FilepostCom(SimpleHoster): self.logDebug(u"RECAPTCHA: %s : %s : %s" % ( captcha_key, post_dict['recaptcha_challenge_field'], post_dict['recaptcha_response_field'])) - download_url = self.getJsonResponse(get_dict, post_dict, 'link') - if download_url: - if i: - self.correctCaptcha() - break - elif i: - self.invalidCaptcha() + self.link = self.getJsonResponse(get_dict, post_dict, 'link') else: self.fail(_("Invalid captcha")) - # Download - self.download(download_url) - def getJsonResponse(self, get_dict, post_dict, field): res = json_loads(self.load('https://filepost.com/files/get/', get=get_dict, post=post_dict)) diff --git a/module/plugins/hoster/FlyFilesNet.py b/module/plugins/hoster/FlyFilesNet.py index bcfaaab69..4420d5d60 100644 --- a/module/plugins/hoster/FlyFilesNet.py +++ b/module/plugins/hoster/FlyFilesNet.py @@ -41,6 +41,4 @@ class FlyFilesNet(SimpleHoster): self.wait(10 * 60, True) self.retry() - download_url = parsed_url.replace('#downlink|', '') - - self.download(download_url) + self.link = parsed_url.replace('#downlink|', '') diff --git a/module/plugins/hoster/GigapetaCom.py b/module/plugins/hoster/GigapetaCom.py index bb53a12ee..2fe44ca85 100644 --- a/module/plugins/hoster/GigapetaCom.py +++ b/module/plugins/hoster/GigapetaCom.py @@ -45,7 +45,7 @@ class GigapetaCom(SimpleHoster): m = re.search(r'Location\s*:\s*(.+)', self.req.http.header, re.I) if m: - download_url = m.group(1).rstrip() #@TODO: Remove .rstrip() in 0.4.10 + self.link = m.group(1).rstrip() #@TODO: Remove .rstrip() in 0.4.10 break elif "Entered figures don`t coincide with the picture" in self.html: self.invalidCaptcha() @@ -53,7 +53,6 @@ class GigapetaCom(SimpleHoster): self.fail(_("No valid captcha code entered")) self.req.http.c.setopt(FOLLOWLOCATION, 1) - self.download(download_url) def checkErrors(self): diff --git a/module/plugins/hoster/GooIm.py b/module/plugins/hoster/GooIm.py index c6d8ce83d..4b27e6cc8 100644 --- a/module/plugins/hoster/GooIm.py +++ b/module/plugins/hoster/GooIm.py @@ -32,7 +32,7 @@ class GooIm(SimpleHoster): def handleFree(self, pyfile): self.wait(10) - self.download(pyfile.url) + self.link = pyfile.url getInfo = create_getInfo(GooIm) diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py index 27f2cadb8..79dbd8133 100644 --- a/module/plugins/hoster/LetitbitNet.py +++ b/module/plugins/hoster/LetitbitNet.py @@ -119,16 +119,7 @@ class LetitbitNet(SimpleHoster): else: self.error(_("Unknown response - captcha check")) - self.correctCaptcha() - - for download_url in urls: - try: - self.download(download_url) - break - except Exception, e: - self.logError(e) - else: - self.fail(_("Download did not finish correctly")) + self.link = urls[0] def handlePremium(self, pyfile): diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index 8f4f8808c..2b4202051 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -45,7 +45,7 @@ class LoadTo(SimpleHoster): if m is None: self.error(_("LINK_FREE_PATTERN not found")) - download_url = m.group(1) + self.link = m.group(1) # Set Timer - may be obsolete m = re.search(self.WAIT_PATTERN, self.html) @@ -56,11 +56,9 @@ class LoadTo(SimpleHoster): solvemedia = SolveMedia(self) captcha_key = solvemedia.detect_key() - if captcha_key is None: - self.download(download_url) - else: + if captcha_key: response, challenge = solvemedia.challenge(captcha_key) - self.download(download_url, + self.download(self.link, post={'adcopy_challenge': challenge, 'adcopy_response' : response, 'returnUrl' : pyfile.url}) diff --git a/module/plugins/hoster/LolabitsEs.py b/module/plugins/hoster/LolabitsEs.py new file mode 100644 index 000000000..61df5f0bb --- /dev/null +++ b/module/plugins/hoster/LolabitsEs.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -* + +import HTMLParser +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class LolabitsEs(SimpleHoster): + __name__ = "LolabitsEs" + __type__ = "hoster" + __version__ = "0.02" + + __pattern__ = r'https?://(?:www\.)?lolabits\.es/.+' + + __description__ = """Lolabits.es hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de")] + + + NAME_PATTERN = r'Descargar: <b>(?P<N>.+?)<' + SIZE_PATTERN = r'class="fileSize">(?P<S>[\d.,]+) (?P<U>[\w^_]+)' + OFFLINE_PATTERN = r'Un usuario con este nombre no existe' + + FILEID_PATTERN = r'name="FileId" value="(\d+)"' + TOKEN_PATTERN = r'name="__RequestVerificationToken" type="hidden" value="(.+?)"' + LINK_PATTERN = r'"redirectUrl":"(.+?)"' + + + def setup(self): + self.chunkLimit = 1 + + + def handleFree(self, pyfile): + fileid = re.search(self.FILEID_PATTERN, self.html).group(1) + self.logDebug("FileID: " + fileid) + + token = re.search(self.TOKEN_PATTERN, self.html).group(1) + self.logDebug("Token: " + token) + + self.html = self.load("http://lolabits.es/action/License/Download", + post={'fileId' : fileid, + '__RequestVerificationToken' : token}).decode('unicode-escape') + + self.link = HTMLParser.HTMLParser().unescape(re.search(self.LINK_PATTERN, self.html).group(1)) + + +getInfo = create_getInfo(LolabitsEs) diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py index 980072744..26af8153f 100644 --- a/module/plugins/hoster/LuckyShareNet.py +++ b/module/plugins/hoster/LuckyShareNet.py @@ -69,7 +69,7 @@ class LuckyShareNet(SimpleHoster): if not json['link']: self.fail(_("No Download url retrieved/all captcha attempts failed")) - self.download(json['link']) + self.link = json['link'] getInfo = create_getInfo(LuckyShareNet) diff --git a/module/plugins/hoster/MegasharesCom.py b/module/plugins/hoster/MegasharesCom.py index c6ccdb587..ed2363fe3 100644 --- a/module/plugins/hoster/MegasharesCom.py +++ b/module/plugins/hoster/MegasharesCom.py @@ -105,9 +105,8 @@ class MegasharesCom(SimpleHoster): if m is None: self.error(msg) - download_url = m.group(1) - self.logDebug("%s: %s" % (msg, download_url)) - self.download(download_url) + self.link = m.group(1) + self.logDebug("%s: %s" % (msg, self.link)) getInfo = create_getInfo(MegasharesCom) diff --git a/module/plugins/hoster/NarodRu.py b/module/plugins/hoster/NarodRu.py index 7de041f36..65ad90d17 100644 --- a/module/plugins/hoster/NarodRu.py +++ b/module/plugins/hoster/NarodRu.py @@ -48,7 +48,7 @@ class NarodRu(SimpleHoster): m = re.search(self.LINK_FREE_PATTERN, self.html) if m: - url = 'http://narod.ru' + m.group(1) + self.link = 'http://narod.ru' + m.group(1) self.correctCaptcha() break @@ -61,7 +61,5 @@ class NarodRu(SimpleHoster): else: self.fail(_("No valid captcha code entered")) - self.download(url) - getInfo = create_getInfo(NarodRu) diff --git a/module/plugins/hoster/NowDownloadSx.py b/module/plugins/hoster/NowDownloadSx.py index 5ef36d270..a1cf9baf7 100644 --- a/module/plugins/hoster/NowDownloadSx.py +++ b/module/plugins/hoster/NowDownloadSx.py @@ -55,11 +55,11 @@ class NowDownloadSx(SimpleHoster): self.html = self.load(baseurl + str(continuelink.group(1))) - url = re.search(self.LINK_FREE_PATTERN, self.html) - if url is None: + m = re.search(self.LINK_FREE_PATTERN, self.html) + if m is None: self.error(_("Download link not found")) - self.download(str(url.group(1))) + self.link = m.group(1) getInfo = create_getInfo(NowDownloadSx) diff --git a/module/plugins/hoster/NowVideoSx.py b/module/plugins/hoster/NowVideoSx.py index 04274ed82..477379597 100644 --- a/module/plugins/hoster/NowVideoSx.py +++ b/module/plugins/hoster/NowVideoSx.py @@ -39,7 +39,7 @@ class NowVideoSx(SimpleHoster): if m is None: self.error(_("Free download link not found")) - self.download(m.group(1)) + self.link = m.group(1) getInfo = create_getInfo(NowVideoSx) diff --git a/module/plugins/hoster/QuickshareCz.py b/module/plugins/hoster/QuickshareCz.py index 250a33d0d..893c3b6c7 100644 --- a/module/plugins/hoster/QuickshareCz.py +++ b/module/plugins/hoster/QuickshareCz.py @@ -68,11 +68,12 @@ class QuickshareCz(SimpleHoster): m = re.search(r'Location\s*:\s*(.+)', self.header, re.I) if m is None: self.fail(_("File not found")) - download_url = m.group(1).rstrip() #@TODO: Remove .rstrip() in 0.4.10 - self.logDebug("FREE URL2:" + download_url) + + self.link = m.group(1).rstrip() #@TODO: Remove .rstrip() in 0.4.10 + self.logDebug("FREE URL2:" + self.link) # check errors - m = re.search(r'/chyba/(\d+)', download_url) + m = re.search(r'/chyba/(\d+)', self.link) if m: if m.group(1) == '1': self.retry(60, 2 * 60, "This IP is already downloading") @@ -81,9 +82,6 @@ class QuickshareCz(SimpleHoster): else: self.fail(_("Error %d") % m.group(1)) - # download file - self.download(download_url) - def handlePremium(self, pyfile): download_url = '%s/download_premium.php' % self.jsvars['server'] diff --git a/module/plugins/hoster/SendspaceCom.py b/module/plugins/hoster/SendspaceCom.py index 148217fe6..0ab20949d 100644 --- a/module/plugins/hoster/SendspaceCom.py +++ b/module/plugins/hoster/SendspaceCom.py @@ -35,7 +35,7 @@ class SendspaceCom(SimpleHoster): if m: if 'captcha_hash' in params: self.correctCaptcha() - download_url = m.group(1) + self.link = m.group(1) break m = re.search(self.CAPTCHA_PATTERN, self.html) @@ -56,7 +56,5 @@ class SendspaceCom(SimpleHoster): else: self.fail(_("Download link not found")) - self.download(download_url) - getInfo = create_getInfo(SendspaceCom) diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 102e91276..fea5781fe 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -98,16 +98,14 @@ class ShareonlineBiz(SimpleHoster): self.checkErrors() - res = self.handleCaptcha() - download_url = res.decode('base64') + res = self.handleCaptcha() + self.link = res.decode('base64') - if not download_url.startswith("http://"): + if not self.link.startswith("http://"): self.error(_("Wrong download url")) self.wait() - self.download(download_url) - def checkFile(self, rules={}): check = self.checkDownload({'cookie': re.compile(r'<div id="dl_failure"'), @@ -145,13 +143,12 @@ class ShareonlineBiz(SimpleHoster): pyfile.name = dlinfo['name'] pyfile.size = int(dlinfo['size']) - dlLink = dlinfo['url'] + self.link = dlinfo['url'] - if dlLink == "server_under_maintenance": + if self.link == "server_under_maintenance": self.tempOffline() else: self.multiDL = True - self.download(dlLink) def checkErrors(self): diff --git a/module/plugins/hoster/UloziskoSk.py b/module/plugins/hoster/UloziskoSk.py index 39a375b49..d687ae7cb 100644 --- a/module/plugins/hoster/UloziskoSk.py +++ b/module/plugins/hoster/UloziskoSk.py @@ -34,8 +34,7 @@ class UloziskoSk(SimpleHoster): m = re.search(self.IMG_PATTERN, self.html) if m: - url = "http://ulozisko.sk" + m.group(1) - self.download(url) + self.link = "http://ulozisko.sk" + m.group(1) else: self.handleFree(pyfile) diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py index 7753f1264..14447b0b0 100644 --- a/module/plugins/hoster/UnibytesCom.py +++ b/module/plugins/hoster/UnibytesCom.py @@ -42,7 +42,7 @@ class UnibytesCom(SimpleHoster): m = re.search(r'location:\s*(\S+)', self.req.http.header, re.I) if m: - url = m.group(1) + self.link = m.group(1) break if '>Somebody else is already downloading using your IP-address<' in self.html: @@ -52,7 +52,7 @@ class UnibytesCom(SimpleHoster): if post_data['step'] == 'last': m = re.search(self.LINK_FREE_PATTERN, self.html) if m: - url = m.group(1) + self.link = m.group(1) self.correctCaptcha() break else: @@ -73,7 +73,5 @@ class UnibytesCom(SimpleHoster): self.req.http.c.setopt(FOLLOWLOCATION, 1) - self.download(url) - getInfo = create_getInfo(UnibytesCom) diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 164b7b243..d0e0b1fd7 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -53,8 +53,7 @@ class UploadingCom(SimpleHoster): self.html = self.load('http://uploading.com/files/get/?JsHttpRequest=%d-xml' % timestamp(), post=postData) url = re.search(r'"link"\s*:\s*"(.*?)"', self.html) if url: - url = url.group(1).replace("\\/", "/") - self.download(url) + self.link = url.group(1).replace("\\/", "/") raise Exception("Plugin defect") @@ -93,7 +92,7 @@ class UploadingCom(SimpleHoster): else: self.error(_("No URL")) - self.download(url) + self.link = url getInfo = create_getInfo(UploadingCom) diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index 2f79f5aa4..57b24623b 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -43,8 +43,7 @@ class VeohCom(SimpleHoster): m = re.search(pattern, self.html) if m: pyfile.name += ".mp4" - link = m.group(1).replace("\\", "") - self.download(link) + self.link = m.group(1).replace("\\", "") return else: self.logInfo(_("No %s quality video found") % q.upper()) diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index 02aef98ec..a5196cb92 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -49,7 +49,7 @@ class VimeoCom(SimpleHoster): if self.getConfig('original'): if "original" in link: - self.download(link[q]) + self.link = link[q] return else: self.logInfo(_("Original file not downloadable")) @@ -64,7 +64,7 @@ class VimeoCom(SimpleHoster): for q in qlevel: if q in link: - self.download(link[q]) + self.link = link[q] return else: self.logInfo(_("No %s quality video found") % q.upper()) diff --git a/module/plugins/hoster/WrzucTo.py b/module/plugins/hoster/WrzucTo.py index 0d78058d7..50a45babe 100644 --- a/module/plugins/hoster/WrzucTo.py +++ b/module/plugins/hoster/WrzucTo.py @@ -46,8 +46,7 @@ class WrzucTo(SimpleHoster): if len(data) != 4: self.error(_("No download URL")) - download_url = "http://%s.wrzuc.to/pobierz/%s" % (data['server_id'], data['download_link']) - self.download(download_url) + self.link = "http://%s.wrzuc.to/pobierz/%s" % (data['server_id'], data['download_link']) getInfo = create_getInfo(WrzucTo) diff --git a/module/plugins/hoster/YibaishiwuCom.py b/module/plugins/hoster/YibaishiwuCom.py index 44f2b7b83..7ca6e1ac0 100644 --- a/module/plugins/hoster/YibaishiwuCom.py +++ b/module/plugins/hoster/YibaishiwuCom.py @@ -47,9 +47,8 @@ class YibaishiwuCom(SimpleHoster): for mr in mirrors: try: - url = mr['url'].replace("\\", "") - self.logDebug("Trying URL: " + url) - self.download(url) + self.link = mr['url'].replace("\\", "") + self.logDebug("Trying URL: " + self.link) break except Exception: continue diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index ac5fbf391..910731f95 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -245,7 +245,7 @@ def secondsToMidnight(gmt=0): class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "1.36" + __version__ = "1.37" __pattern__ = r'^unmatchable$' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -599,8 +599,8 @@ class SimpleHoster(Hoster): except Exception: waitmsg = m.group(0).strip() - wait_time = sum(int(v) * {"hr": 3600, "hour": 3600, "min": 60, "sec": 1}[u.lower()] for v, u in - re.findall(r'(\d+)\s*(hr|hour|min|sec)', waitmsg, re.I)) + wait_time = sum(int(v) * {"hr": 3600, "hour": 3600, "min": 60, "sec": 1, "": 1}[u.lower()] for v, u in + re.findall(r'(\d+)\s*(hr|hour|min|sec|)', waitmsg, re.I)) self.wait(wait_time, wait_time > 300) self.info.pop('error', None) diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py index 9e60a5aa5..027e68236 100644 --- a/module/plugins/internal/XFSHoster.py +++ b/module/plugins/internal/XFSHoster.py @@ -16,7 +16,7 @@ from module.utils import html_unescape class XFSHoster(SimpleHoster): __name__ = "XFSHoster" __type__ = "hoster" - __version__ = "0.45" + __version__ = "0.46" __pattern__ = r'^unmatchable$' @@ -193,8 +193,8 @@ class XFSHoster(SimpleHoster): self.logWarning(re.sub(r"<.*?>", " ", self.errmsg)) if 'wait' in self.errmsg: - wait_time = sum(int(v) * {"hr": 3600, "hour": 3600, "min": 60, "sec": 1}[u.lower()] for v, u in - re.findall(r'(\d+)\s*(hr|hour|min|sec)', self.errmsg, re.I)) + wait_time = sum(int(v) * {"hr": 3600, "hour": 3600, "min": 60, "sec": 1, "": 1}[u.lower()] for v, u in + re.findall(r'(\d+)\s*(hr|hour|min|sec|)', self.errmsg, re.I)) self.wait(wait_time, wait_time > 300) elif 'country' in self.errmsg: |