diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-09-29 22:43:17 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-09-29 22:43:17 +0200 |
commit | 3353ea228835ffa96cc73d5b5e23f6d92ba84203 (patch) | |
tree | c593079745e1a65c39bfa59b3a3b6a07e1b05486 /module/plugins/hoster | |
parent | [OpenloadIo] Cleanup (diff) | |
download | pyload-3353ea228835ffa96cc73d5b5e23f6d92ba84203.tar.xz |
Update hoster plugins
Diffstat (limited to 'module/plugins/hoster')
50 files changed, 211 insertions, 206 deletions
diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index d64834a7c..1952309fe 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -12,7 +12,7 @@ from module.plugins.internal.Hoster import Hoster class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" - __version__ = "0.45" + __version__ = "0.46" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -33,48 +33,48 @@ class BasePlugin(Hoster): """ Main function """ + netloc = urlparse.urlparse(pyfile.url).netloc + pyfile.name = self.get_info(pyfile.url)['name'] if not pyfile.url.startswith("http"): self.fail(_("No plugin matched")) - for _i in xrange(5): - try: - link = self.direct_link(urllib.unquote(pyfile.url)) + try: + link = self.direct_link(urllib.unquote(pyfile.url)) - if link: - self.download(link, ref=False, disposition=True) - else: - self.fail(_("File not found")) + if link: + self.download(link, ref=False, disposition=True) + else: + self.fail(_("File not found")) - except BadHeader, e: - if e.code == 404: - self.offline() + except BadHeader, e: + if e.code == 404: + self.offline() - elif e.code in (401, 403): - self.log_debug("Auth required", "Received HTTP status code: %d" % e.code) + elif e.code in (401, 403): + self.log_debug("Auth required", "Received HTTP status code: %d" % e.code) - account = self.pyload.accountManager.getAccountPlugin('Http') - servers = [x['login'] for x in account.getAllAccounts()] #@TODO: Recheck in 0.4.10 - server = urlparse.urlparse(pyfile.url).netloc + #@TODO: Recheck in 0.4.10 + if self.account: + servers = [x['login'] for x in self.account.getAllAccounts()] + else: + servers = [] + + if netloc in servers: + self.log_debug("Logging on to %s" % netloc) + self.req.addAuth(self.account.get_login('password')) - if server in servers: - self.log_debug("Logging on to %s" % server) - self.req.addAuth(account.get_info(server)['login']['password']) - else: - pwd = self.get_password() - if ':' in pwd: - self.req.addAuth(pwd) - else: - self.fail(_("Authorization required")) else: - self.fail(e) + pwd = self.get_password() + if ':' in pwd: + self.req.addAuth(pwd) + else: + self.fail(_("Authorization required")) else: - break - else: - self.fail(_("No file downloaded")) #@TODO: Move to hoster class in 0.4.10 + self.fail(e) - errmsg = self.check_download({'Empty file' : re.compile(r'\A\s*\Z'), + errmsg = self.check_file({'Empty file' : re.compile(r'\A\s*\Z'), 'Html error' : re.compile(r'\A(?:\s*<.+>)?((?:[\w\s]*(?:[Ee]rror|ERROR)\s*\:?)?\s*\d{3})(?:\Z|\s+)'), 'Html file' : re.compile(r'\A\s*<!DOCTYPE html'), 'Request error': re.compile(r'([Aa]n error occured while processing your request)')}) diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index b975a8ab0..cea78088e 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class BitshareCom(SimpleHoster): __name__ = "BitshareCom" __type__ = "hoster" - __version__ = "0.55" + __version__ = "0.56" __status__ = "testing" __pattern__ = r'http://(?:www\.)?bitshare\.com/(files/)?(?(1)|\?f=)(?P<ID>\w+)(?(1)/(?P<NAME>.+?)\.html)' @@ -39,7 +39,7 @@ class BitshareCom(SimpleHoster): def process(self, pyfile): if self.premium: - self.account.relogin(self.user) + self.account.relogin() #: File id m = re.match(self.__pattern__, pyfile.url) @@ -75,7 +75,7 @@ class BitshareCom(SimpleHoster): #: This may either download our file or forward us to an error page self.link = self.get_download_url() - if self.check_download({'error': ">Error occured<"}): + if self.check_file({'error': ">Error occured<"}): self.retry(5, 5 * 60, "Bitshare host : Error occured") diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py index 17e3ee93c..2ed140b9c 100644 --- a/module/plugins/hoster/CrockoCom.py +++ b/module/plugins/hoster/CrockoCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class CrockoCom(SimpleHoster): __name__ = "CrockoCom" __type__ = "hoster" - __version__ = "0.21" + __version__ = "0.22" __status__ = "testing" __pattern__ = r'http://(?:www\.)?(crocko|easy-share)\.com/\w+' @@ -58,7 +58,7 @@ class CrockoCom(SimpleHoster): inputs['recaptcha_response_field'], inputs['recaptcha_challenge_field'] = recaptcha.challenge() self.download(action, post=inputs) - if self.check_download({'captcha': recaptcha.KEY_AJAX_PATTERN}): + if self.check_file({'captcha': recaptcha.KEY_AJAX_PATTERN}): self.captcha.invalid() else: break diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index 6afd9fa2d..eeba9d86d 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -12,7 +12,7 @@ from module.utils import parseFileSize as parse_size class CzshareCom(SimpleHoster): __name__ = "CzshareCom" __type__ = "hoster" - __version__ = "1.02" + __version__ = "1.03" __status__ = "testing" __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/(\d+/|download\.php\?).+' @@ -40,11 +40,11 @@ class CzshareCom(SimpleHoster): USER_CREDIT_PATTERN = r'<div class="credit">\s*kredit: <strong>([\d .,]+)(\w+)</strong>\s*</div><!-- .credit -->' - def check_traffic_left(self): + def check_traffic(self): #: Check if user logged in m = re.search(self.USER_CREDIT_PATTERN, self.html) if m is None: - self.account.relogin(self.user) + self.account.relogin() self.html = self.load(self.pyfile.url) m = re.search(self.USER_CREDIT_PATTERN, self.html) if m is None: @@ -54,7 +54,7 @@ class CzshareCom(SimpleHoster): try: credit = parse_size(m.group(1).replace(' ', ''), m.group(2)) self.log_info(_("Premium download for %i KiB of Credit") % (self.pyfile.size / 1024)) - self.log_info(_("User %s has %i KiB left") % (self.user, credit / 1024)) + self.log_info(_("User %s has %i KiB left") % (self.account.user, credit / 1024)) if credit < self.pyfile.size: self.log_info(_("Not enough credit to download file: %s") % self.pyfile.name) return False @@ -137,9 +137,9 @@ class CzshareCom(SimpleHoster): self.wait() - def check_file(self): + def check_download(self): #: Check download - check = self.check_download({ + check = self.check_file({ "temp offline" : re.compile(r"^Soubor je do.*asn.* nedostupn.*$"), 'credit' : re.compile(r"^Nem.*te dostate.*n.* kredit.$"), "multi-dl" : re.compile(self.MULTIDL_PATTERN), @@ -159,7 +159,7 @@ class CzshareCom(SimpleHoster): self.captcha.invalid() self.retry() - return super(CzshareCom, self).check_file() + return super(CzshareCom, self).check_download() getInfo = create_getInfo(CzshareCom) diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py index 15caae1f7..2b30df059 100644 --- a/module/plugins/hoster/DataportCz.py +++ b/module/plugins/hoster/DataportCz.py @@ -6,7 +6,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DataportCz(SimpleHoster): __name__ = "DataportCz" __type__ = "hoster" - __version__ = "0.42" + __version__ = "0.43" __status__ = "testing" __pattern__ = r'http://(?:www\.)?dataport\.cz/file/(.+)' @@ -41,7 +41,7 @@ class DataportCz(SimpleHoster): self.download("http://www.dataport.cz%s" % action, post=inputs) - check = self.check_download({'captcha': 'alert("\u0160patn\u011b opsan\u00fd k\u00f3d z obr\u00e1zu");', + check = self.check_file({'captcha': 'alert("\u0160patn\u011b opsan\u00fd k\u00f3d z obr\u00e1zu");', 'slot' : 'alert("Je n\u00e1m l\u00edto, ale moment\u00e1ln\u011b nejsou'}) if check == "captcha": self.error(_("invalid captcha")) diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 9d42935cb..cb9ab5572 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DepositfilesCom(SimpleHoster): __name__ = "DepositfilesCom" __type__ = "hoster" - __version__ = "0.57" + __version__ = "0.58" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(depositfiles\.com|dfiles\.(eu|ru))(/\w{1,3})?/files/(?P<ID>\w+)' @@ -48,7 +48,7 @@ class DepositfilesCom(SimpleHoster): m = re.search(r"var fid = '(\w+)';", self.html) if m is None: - self.retry(wait_time=5) + self.retry(delay=5) params = {'fid': m.group(1)} self.log_debug("FID: %s" % params['fid']) @@ -76,7 +76,7 @@ class DepositfilesCom(SimpleHoster): self.retry(25, 60 * 60, "Download limit reached") elif 'onClick="show_gold_offer' in self.html: - self.account.relogin(self.user) + self.account.relogin() self.retry() else: diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py index 70df8e354..3cfa014dd 100644 --- a/module/plugins/hoster/EuroshareEu.py +++ b/module/plugins/hoster/EuroshareEu.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class EuroshareEu(SimpleHoster): __name__ = "EuroshareEu" __type__ = "hoster" - __version__ = "0.31" + __version__ = "0.32" __status__ = "testing" __pattern__ = r'http://(?:www\.)?euroshare\.(eu|sk|cz|hu|pl)/file/.+' @@ -32,16 +32,16 @@ class EuroshareEu(SimpleHoster): def handle_premium(self, pyfile): if self.ERROR_PATTERN in self.html: - self.account.relogin(self.user) + self.account.relogin() self.retry(msg=_("User not logged in")) self.link = pyfile.url.rstrip('/') + "/download/" - check = self.check_download({'login': re.compile(self.ERROR_PATTERN), + check = self.check_file({'login': re.compile(self.ERROR_PATTERN), 'json' : re.compile(r'\{"status":"error".*?"message":"(.*?)"')}) if check == "login" or (check == "json" and self.last_check.group(1) == "Access token expired"): - self.account.relogin(self.user) + self.account.relogin() self.retry(msg=_("Access token expired")) elif check == "json": diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 3442e7d27..0d5533539 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, s class ExtabitCom(SimpleHoster): __name__ = "ExtabitCom" __type__ = "hoster" - __version__ = "0.67" + __version__ = "0.68" __status__ = "testing" __pattern__ = r'http://(?:www\.)?extabit\.com/(file|go|fid)/(?P<ID>\w+)' @@ -39,7 +39,7 @@ class ExtabitCom(SimpleHoster): self.wait(int(m.group(1)) * 60, True) elif "The daily downloads limit from your IP is exceeded" in self.html: self.log_warning(_("You have reached your daily downloads limit for today")) - self.wait(seconds_to_midnight(gmt=2), True) + self.wait(seconds_to_midnight(), True) self.log_debug("URL: " + self.req.http.lastEffectiveURL) m = re.match(self.__pattern__, self.req.http.lastEffectiveURL) diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py index f00dded3f..d932bb22e 100644 --- a/module/plugins/hoster/FastixRu.py +++ b/module/plugins/hoster/FastixRu.py @@ -10,7 +10,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class FastixRu(MultiHoster): __name__ = "FastixRu" __type__ = "hoster" - __version__ = "0.14" + __version__ = "0.15" __status__ = "testing" __pattern__ = r'http://(?:www\.)?fastix\.(ru|it)/file/\w{24}' @@ -28,7 +28,7 @@ class FastixRu(MultiHoster): def handle_premium(self, pyfile): self.html = json_loads(self.load("http://fastix.ru/api_v2/", - get={'apikey': self.account.get_data()['apikey'], + get={'apikey': self.account.get_data('apikey'), 'sub' : "getdirectlink", 'link' : pyfile.url}) data = self.html) diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index 62cf3889b..985faaa93 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FastshareCz(SimpleHoster): __name__ = "FastshareCz" __type__ = "hoster" - __version__ = "0.33" + __version__ = "0.34" __status__ = "testing" __pattern__ = r'http://(?:www\.)?fastshare\.cz/\d+/.+' @@ -59,8 +59,8 @@ class FastshareCz(SimpleHoster): self.download(urlparse.urljoin(baseurl, action), post={'code': captcha, 'btn.x': 77, 'btn.y': 18}) - def check_file(self): - check = self.check_download({ + def check_download(self): + check = self.check_file({ 'paralell-dl' : re.compile(r"<title>FastShare.cz</title>|<script>alert\('Pres FREE muzete stahovat jen jeden soubor najednou.'\)"), 'wrong captcha': re.compile(r'Download for FREE'), 'credit' : re.compile(self.CREDIT_ERROR) @@ -70,12 +70,12 @@ class FastshareCz(SimpleHoster): self.retry(6, 10 * 60, _("Paralell download")) elif check == "wrong captcha": - self.retry(max_tries=5, msg=_("Wrong captcha")) + self.retry(attemps=5, msg=_("Wrong captcha")) elif check == "credit": self.restart(nopremium=True) - return super(FastshareCz, self).check_file() + return super(FastshareCz, self).check_download() getInfo = create_getInfo(FastshareCz) diff --git a/module/plugins/hoster/FilecloudIo.py b/module/plugins/hoster/FilecloudIo.py index 21654fee3..aa864271a 100644 --- a/module/plugins/hoster/FilecloudIo.py +++ b/module/plugins/hoster/FilecloudIo.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilecloudIo(SimpleHoster): __name__ = "FilecloudIo" __type__ = "hoster" - __version__ = "0.10" + __version__ = "0.11" __status__ = "testing" __pattern__ = r'http://(?:www\.)?(?:filecloud\.io|ifile\.it|mihd\.net)/(?P<ID>\w+)' @@ -64,7 +64,7 @@ class FilecloudIo(SimpleHoster): response, challenge = recaptcha.challenge(captcha_key) self.account.form_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field' : response} - self.account.relogin(self.user) + self.account.relogin() self.retry(2) json_url = "http://filecloud.io/download-request.json" @@ -111,7 +111,7 @@ class FilecloudIo(SimpleHoster): def handle_premium(self, pyfile): - akey = self.account.get_data(self.user)['akey'] + akey = self.account.get_data('akey') ukey = self.info['pattern']['ID'] self.log_debug("Akey: %s | Ukey: %s" % (akey, ukey)) rep = self.load("http://api.filecloud.io/api-fetch_download_url.api", diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index b13a7c793..e8890086b 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -19,7 +19,7 @@ def get_info(urls): class FilefactoryCom(SimpleHoster): __name__ = "FilefactoryCom" __type__ = "hoster" - __version__ = "0.58" + __version__ = "0.59" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?filefactory\.com/(file|trafficshare/\w+)/\w+' @@ -59,18 +59,18 @@ class FilefactoryCom(SimpleHoster): self.wait(m.group(1)) - def check_file(self): - check = self.check_download({'multiple': "You are currently downloading too many files at once.", + def check_download(self): + check = self.check_file({'multiple': "You are currently downloading too many files at once.", 'error' : '<div id="errorMessage">'}) if check == "multiple": self.log_debug("Parallel downloads detected; waiting 15 minutes") - self.retry(wait_time=15 * 60, msg=_("Parallel downloads")) + self.retry(delay=15 * 60, msg=_("Parallel downloads")) elif check == "error": self.error(_("Unknown error")) - return super(FilefactoryCom, self).check_file() + return super(FilefactoryCom, self).check_download() def handle_premium(self, pyfile): diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py index d8c626ef2..f2e3fb76d 100644 --- a/module/plugins/hoster/FilepostCom.py +++ b/module/plugins/hoster/FilepostCom.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilepostCom(SimpleHoster): __name__ = "FilepostCom" __type__ = "hoster" - __version__ = "0.35" + __version__ = "0.36" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:filepost\.com/files|fp\.io)/(?P<ID>[^/]+)' @@ -101,8 +101,8 @@ class FilepostCom(SimpleHoster): if 'error' in res['js']: if res['js']['error'] == "download_delay": - self.retry(wait_time=res['js']['params']['next_download']) - #: ~? self.retry(wait_time=js_answer['params']['next_download']) + self.retry(delay=res['js']['params']['next_download']) + #: ~? self.retry(delay=js_answer['params']['next_download']) elif 'Wrong file password' in res['js']['error'] \ or 'You entered a wrong CAPTCHA code' in res['js']['error'] \ diff --git a/module/plugins/hoster/FilesMailRu.py b/module/plugins/hoster/FilesMailRu.py index a1c30be7b..fcb29b922 100644 --- a/module/plugins/hoster/FilesMailRu.py +++ b/module/plugins/hoster/FilesMailRu.py @@ -33,7 +33,7 @@ def get_info(urls): class FilesMailRu(Hoster): __name__ = "FilesMailRu" __type__ = "hoster" - __version__ = "0.34" + __version__ = "0.35" __status__ = "testing" __pattern__ = r'http://(?:www\.)?files\.mail\.ru/.+' @@ -104,7 +104,7 @@ class FilesMailRu(Hoster): #: so i set it to check every download because sometimes there are downloads #: that contain the HTML-Text and 60MB ZEROs after that in a xyzfile.part1.rar file #: (Loading 100MB in to ram is not an option) - check = self.check_download({'html': "<meta name="}, read_size=50000) + check = self.check_file({'html': "<meta name="}, read_size=50000) if check == "html": self.log_info(_( "There was HTML Code in the Downloaded File (%s)...redirect error? The Download will be restarted." % diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index c35fab3fc..36ccd473f 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -34,7 +34,7 @@ def check_file(plugin, urls): class FileserveCom(Hoster): __name__ = "FileserveCom" __type__ = "hoster" - __version__ = "0.59" + __version__ = "0.60" __status__ = "testing" __pattern__ = r'http://(?:www\.)?fileserve\.com/file/(?P<ID>[^/]+)' @@ -95,7 +95,7 @@ class FileserveCom(Hoster): elif action['fail'] == "parallelDownload": self.log_warning(_("Parallel download error, now waiting 60s")) - self.retry(wait_time=60, msg=_("parallelDownload")) + self.retry(delay=60, msg=_("parallelDownload")) else: self.fail(_("Download check returned: %s") % action['fail']) @@ -120,7 +120,7 @@ class FileserveCom(Hoster): self.download(self.url, post={'download': "normal"}) self.log_debug(self.req.http.lastEffectiveURL) - check = self.check_download({'expired': self.LINK_EXPIRED_PATTERN, + check = self.check_file({'expired': self.LINK_EXPIRED_PATTERN, 'wait' : re.compile(self.LONG_WAIT_PATTERN), 'limit' : self.DL_LIMIT_PATTERN}) @@ -133,7 +133,7 @@ class FileserveCom(Hoster): elif check == "limit": self.log_warning(_("Download limited reached for today")) - self.wait(seconds_to_midnight(gmt=2), True) + self.wait(seconds_to_midnight(), True) self.retry() self.thread.m.reconnecting.wait(3) #: Ease issue with later downloads appearing to be in parallel @@ -187,8 +187,8 @@ class FileserveCom(Hoster): if self.__name__ == "FileserveCom": #: Try api download res = self.load("http://app.fileserve.com/api/download/premium/", - post={'username': self.user, - 'password': self.account.get_info(self.user)['login']['password'], + post={'username': self.account.user, + 'password': self.account.get_login('password'), 'shorten': self.file_id}) if res: res = json_loads(res) @@ -205,8 +205,8 @@ class FileserveCom(Hoster): self.download(premium_url or self.pyfile.url) - if not premium_url and self.check_download({'login': re.compile(self.NOT_LOGGED_IN_PATTERN)}): - self.account.relogin(self.user) + if not premium_url and self.check_file({'login': re.compile(self.NOT_LOGGED_IN_PATTERN)}): + self.account.relogin() self.retry(msg=_("Not logged in")) diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 4564ee03e..72a1c0401 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import seconds_to_midnight class FreakshareCom(Hoster): __name__ = "FreakshareCom" __type__ = "hoster" - __version__ = "0.43" + __version__ = "0.44" __status__ = "testing" __pattern__ = r'http://(?:www\.)?freakshare\.(net|com)/files/\S*?/' @@ -44,7 +44,7 @@ class FreakshareCom(Hoster): self.download(pyfile.url, post=self.req_opts) - check = self.check_download({'bad' : "bad try", + check = self.check_file({'bad' : "bad try", 'paralell' : "> Sorry, you cant download more then 1 files at time. <", 'empty' : "Warning: Unknown: Filename cannot be empty", 'wrong_captcha' : "Wrong Captcha!", @@ -142,7 +142,7 @@ class FreakshareCom(Hoster): if "Your Traffic is used up for today" in self.html: self.wantReconnect = True - return seconds_to_midnight(gmt=2) + return seconds_to_midnight() timestring = re.search('\s*var\s(?:downloadWait|time)\s=\s(\d*)[\d.]*;', self.html) if timestring: diff --git a/module/plugins/hoster/FreeWayMe.py b/module/plugins/hoster/FreeWayMe.py index ed7c4bf7f..c0053fc76 100644 --- a/module/plugins/hoster/FreeWayMe.py +++ b/module/plugins/hoster/FreeWayMe.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class FreeWayMe(MultiHoster): __name__ = "FreeWayMe" __type__ = "hoster" - __version__ = "0.19" + __version__ = "0.20" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?free-way\.(bz|me)/.+' @@ -33,7 +33,7 @@ class FreeWayMe(MultiHoster): get={'multiget': 7, 'url' : pyfile.url, 'user' : user, - 'pw' : self.account.get_info(self.user)['login']['password'], + 'pw' : self.account.get_login('password'), 'json' : ""}, just_header=True) diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index c9f5fa6b6..2fa5c1aa8 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -11,7 +11,7 @@ from module.plugins.internal.Hoster import Hoster class Ftp(Hoster): __name__ = "Ftp" __type__ = "hoster" - __version__ = "0.54" + __version__ = "0.55" __status__ = "testing" __pattern__ = r'(?:ftps?|sftp)://([\w.-]+(:[\w.-]+)?@)?[\w.-]+(:\d+)?/.+' @@ -29,10 +29,10 @@ class Ftp(Hoster): def process(self, pyfile): - parsed_url = urlparse.urlparse(pyfile.url) - netloc = parsed_url.netloc + p_url = urlparse.urlparse(pyfile.url) + netloc = p_url.netloc - pyfile.name = parsed_url.path.rpartition('/')[2] + pyfile.name = p_url.path.rpartition('/')[2] try: pyfile.name = urllib.unquote(str(pyfile.name)).decode('utf8') @@ -40,20 +40,30 @@ class Ftp(Hoster): pass if not "@" in netloc: - servers = [x['login'] for x in self.account.getAllAccounts()] if self.account else [] + self.log_debug("Auth required") + + #@TODO: Recheck in 0.4.10 + if self.account: + servers = [x['login'] for x in self.account.getAllAccounts()] + else: + servers = [] if netloc in servers: self.log_debug("Logging on to %s" % netloc) - self.req.addAuth(self.account.get_info(netloc)['login']['password']) + self.req.addAuth(self.account.get_login('password')) + else: pwd = self.get_password() if ':' in pwd: self.req.addAuth(pwd) + else: + self.fail(_("Authorization required")) self.req.http.c.setopt(pycurl.NOBODY, 1) try: res = self.load(pyfile.url) + except pycurl.error, e: self.fail(_("Error %d: %s") % e.args) diff --git a/module/plugins/hoster/HighWayMe.py b/module/plugins/hoster/HighWayMe.py index f8dc27eec..5d990795f 100644 --- a/module/plugins/hoster/HighWayMe.py +++ b/module/plugins/hoster/HighWayMe.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import seconds_to_midnight class HighWayMe(MultiHoster): __name__ = "HighWayMe" __type__ = "hoster" - __version__ = "0.14" + __version__ = "0.15" __status__ = "testing" __pattern__ = r'https?://.+high-way\.my' @@ -27,7 +27,7 @@ class HighWayMe(MultiHoster): def check_errors(self): if self.html.get('code') == 302: #@NOTE: This is not working. It should by if 302 Moved Temporarily then... But I don't now how to implement it. - self.account.relogin(self.user) + self.account.relogin() self.retry() elif "<code>9</code>" in self.html: @@ -39,7 +39,7 @@ class HighWayMe(MultiHoster): elif "trafficlimit" in self.html: self.log_warning(_("Reached daily limit")) - self.retry(wait_time=seconds_to_midnight(gmt=2), msg="Daily limit for this host reached") + self.retry(delay=seconds_to_midnight(), msg="Daily limit for this host reached") elif "<code>8</code>" in self.html: self.log_warning(_("Hoster temporarily unavailable, waiting 1 minute and retry")) diff --git a/module/plugins/hoster/Keep2ShareCc.py b/module/plugins/hoster/Keep2ShareCc.py index b8275e84b..1b9f69a02 100644 --- a/module/plugins/hoster/Keep2ShareCc.py +++ b/module/plugins/hoster/Keep2ShareCc.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class Keep2ShareCc(SimpleHoster): __name__ = "Keep2ShareCc" __type__ = "hoster" - __version__ = "0.25" + __version__ = "0.26" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P<ID>\w+)' @@ -45,7 +45,7 @@ class Keep2ShareCc(SimpleHoster): if m: self.info['error'] = m.group(1) self.wantReconnect = True - self.retry(wait_time=30 * 60, msg=m.group(0)) + self.retry(delay=30 * 60, msg=m.group(0)) m = re.search(self.ERROR_PATTERN, self.html) if m: @@ -61,7 +61,7 @@ class Keep2ShareCc(SimpleHoster): wait_time = sum(a * b for a, b in zip(ftr, map(int, m.group(1).split(':')))) self.wantReconnect = True - self.retry(wait_time=wait_time, msg="Please wait to download this file") + self.retry(delay=wait_time, msg="Please wait to download this file") self.info.pop('error', None) diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py index e93b60460..22d5c654a 100644 --- a/module/plugins/hoster/LetitbitNet.py +++ b/module/plugins/hoster/LetitbitNet.py @@ -35,7 +35,7 @@ def get_info(urls): class LetitbitNet(SimpleHoster): __name__ = "LetitbitNet" __type__ = "hoster" - __version__ = "0.32" + __version__ = "0.33" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(letitbit|shareflare)\.net/download/.+' @@ -104,7 +104,7 @@ class LetitbitNet(SimpleHoster): if res == "error_free_download_blocked": self.log_warning(_("Daily limit reached")) - self.wait(seconds_to_midnight(gmt=2), True) + self.wait(seconds_to_midnight(), True) if res == "error_wrong_captcha": self.captcha.invalid() @@ -123,10 +123,9 @@ class LetitbitNet(SimpleHoster): def handle_premium(self, pyfile): - api_key = self.user - premium_key = self.account.get_info(self.user)['login']['password'] + premium_key = self.account.get_login('password') - json_data = [api_key, ["download/direct_links", {'pass': premium_key, 'link': pyfile.url}]] + json_data = [self.account.user, ["download/direct_links", {'pass': premium_key, 'link': pyfile.url}]] api_rep = self.load('http://api.letitbit.net/json', post={'r': json_dumps(json_data)}) self.log_debug("API Data: " + api_rep) api_rep = json_loads(api_rep) diff --git a/module/plugins/hoster/LinksnappyCom.py b/module/plugins/hoster/LinksnappyCom.py index 1c3f86d4a..f92681f60 100644 --- a/module/plugins/hoster/LinksnappyCom.py +++ b/module/plugins/hoster/LinksnappyCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class LinksnappyCom(MultiHoster): __name__ = "LinksnappyCom" __type__ = "hoster" - __version__ = "0.11" + __version__ = "0.12" __status__ = "testing" __pattern__ = r'https?://(?:[^/]+\.)?linksnappy\.com' @@ -26,8 +26,8 @@ class LinksnappyCom(MultiHoster): host = self._get_host(pyfile.url) json_params = json_dumps({'link' : pyfile.url, 'type' : host, - 'username': self.user, - 'password': self.account.get_info(self.user)['login']['password']}) + 'username': self.account.user, + 'password': self.account.get_login('password')}) r = self.load("http://linksnappy.com/api/linkgen", post={'genLinks': json_params}) diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py index 5d9bf52c0..71cccb71a 100644 --- a/module/plugins/hoster/LuckyShareNet.py +++ b/module/plugins/hoster/LuckyShareNet.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class LuckyShareNet(SimpleHoster): __name__ = "LuckyShareNet" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.10" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?luckyshare\.net/(?P<ID>\d{10,})' @@ -32,7 +32,7 @@ class LuckyShareNet(SimpleHoster): if m: seconds = int(m.group(1)) self.log_debug("You have to wait %d seconds between free downloads" % seconds) - self.retry(wait_time=seconds) + self.retry(delay=seconds) else: self.error(_("Unable to detect wait time between free downloads")) elif 'Hash expired' in rep: diff --git a/module/plugins/hoster/MegaRapidCz.py b/module/plugins/hoster/MegaRapidCz.py index 4d6d0171a..c3cf8a2b6 100644 --- a/module/plugins/hoster/MegaRapidCz.py +++ b/module/plugins/hoster/MegaRapidCz.py @@ -22,7 +22,7 @@ def get_info(urls): class MegaRapidCz(SimpleHoster): __name__ = "MegaRapidCz" __type__ = "hoster" - __version__ = "0.58" + __version__ = "0.59" __status__ = "testing" __pattern__ = r'http://(?:www\.)?(share|mega)rapid\.cz/soubor/\d+/.+' @@ -58,8 +58,8 @@ class MegaRapidCz(SimpleHoster): self.link = m.group(1) else: if re.search(self.ERR_LOGIN_PATTERN, self.html): - self.relogin(self.user) - self.retry(wait_time=60, msg=_("User login failed")) + self.relogin() + self.retry(delay=60, msg=_("User login failed")) elif re.search(self.ERR_CREDIT_PATTERN, self.html): self.fail(_("Not enough credit left")) diff --git a/module/plugins/hoster/MegaRapidoNet.py b/module/plugins/hoster/MegaRapidoNet.py index 6676a565d..b00daf713 100644 --- a/module/plugins/hoster/MegaRapidoNet.py +++ b/module/plugins/hoster/MegaRapidoNet.py @@ -23,7 +23,7 @@ def random_with_n_digits(n): class MegaRapidoNet(MultiHoster): __name__ = "MegaRapidoNet" __type__ = "hoster" - __version__ = "0.04" + __version__ = "0.05" __status__ = "testing" __pattern__ = r'http://(?:www\.)?\w+\.megarapido\.net/\?file=\w+' @@ -47,7 +47,7 @@ class MegaRapidoNet(MultiHoster): 'links' : pyfile.url, 'exibir' : "normal", 'usar' : "premium", - 'user' : self.account.get_data(self.user).get('sid', None), + 'user' : self.account.get_data('sid'), 'autoreset': ""}) if "desloga e loga novamente para gerar seus links" in self.html.lower(): diff --git a/module/plugins/hoster/MegasharesCom.py b/module/plugins/hoster/MegasharesCom.py index 8b87dbd68..deee700ba 100644 --- a/module/plugins/hoster/MegasharesCom.py +++ b/module/plugins/hoster/MegasharesCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class MegasharesCom(SimpleHoster): __name__ = "MegasharesCom" __type__ = "hoster" - __version__ = "0.30" + __version__ = "0.31" __status__ = "testing" __pattern__ = r'http://(?:www\.)?(d\d{2}\.)?megashares\.com/((index\.php)?\?d\d{2}=|dl/)\w+' @@ -46,7 +46,7 @@ class MegasharesCom(SimpleHoster): def handle_free(self, pyfile): if self.NO_SLOTS_PATTERN in self.html: - self.retry(wait_time=5 * 60) + self.retry(delay=5 * 60) m = re.search(self.REACTIVATE_PASSPORT_PATTERN, self.html) if m: @@ -82,7 +82,7 @@ class MegasharesCom(SimpleHoster): time = [int(x) for x in m.groups()] renew = time[0] + (time[1] * 60) + (time[2] * 60) self.log_debug("Waiting %d seconds for a new passport" % renew) - self.retry(wait_time=renew, msg=_("Passport renewal")) + self.retry(delay=renew, msg=_("Passport renewal")) #: Check traffic left on passport m = re.search(self.PASSPORT_LEFT_PATTERN, self.html, re.M | re.S) @@ -94,7 +94,7 @@ class MegasharesCom(SimpleHoster): self.log_info(_("Data left: %s %s (%d MB needed)") % (m.group(2), m.group(3), self.pyfile.size / 1048576)) if not data_left: - self.retry(wait_time=600, msg=_("Passport renewal")) + self.retry(delay=600, msg=_("Passport renewal")) self.handle_download(False) diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py index 6b69fa9c2..1124dadce 100644 --- a/module/plugins/hoster/MultishareCz.py +++ b/module/plugins/hoster/MultishareCz.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class MultishareCz(SimpleHoster): __name__ = "MultishareCz" __type__ = "hoster" - __version__ = "0.42" + __version__ = "0.43" __status__ = "testing" __pattern__ = r'http://(?:www\.)?multishare\.cz/stahnout/(?P<ID>\d+)' @@ -42,7 +42,7 @@ class MultishareCz(SimpleHoster): self.check_info() - if not self.check_traffic_left(): + if not self.check_traffic(): self.fail(_("Not enough credit left to download file")) self.download("http://dl%d.mms.multishare.cz/html/mms_process.php" % round(random.random() * 10000 * random.random()), diff --git a/module/plugins/hoster/MyfastfileCom.py b/module/plugins/hoster/MyfastfileCom.py index bbd678ba0..ff28d5dfd 100644 --- a/module/plugins/hoster/MyfastfileCom.py +++ b/module/plugins/hoster/MyfastfileCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class MyfastfileCom(MultiHoster): __name__ = "MyfastfileCom" __type__ = "hoster" - __version__ = "0.10" + __version__ = "0.11" __status__ = "testing" __pattern__ = r'http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/dl/' @@ -27,7 +27,8 @@ class MyfastfileCom(MultiHoster): def handle_premium(self, pyfile): self.html = self.load('http://myfastfile.com/api.php', - get={'user': self.user, 'pass': self.account.get_info(self.user)['login']['password'], + get={'user': self.account.user, + 'pass': self.account.get_login('password'), 'link': pyfile.url}) self.log_debug("JSON data: " + self.html) diff --git a/module/plugins/hoster/NoPremiumPl.py b/module/plugins/hoster/NoPremiumPl.py index 9e2a5a93c..0826d5252 100644 --- a/module/plugins/hoster/NoPremiumPl.py +++ b/module/plugins/hoster/NoPremiumPl.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHoster import MultiHoster class NoPremiumPl(MultiHoster): __name__ = "NoPremiumPl" __type__ = "hoster" - __version__ = "0.04" + __version__ = "0.05" __status__ = "testing" __pattern__ = r'https?://direct\.nopremium\.pl.+' @@ -39,7 +39,7 @@ class NoPremiumPl(MultiHoster): def prepare(self): super(NoPremiumPl, self).prepare() - data = self.account.get_data(self.user) + data = self.account.get_data() self.usr = data['usr'] self.pwd = data['pwd'] @@ -84,10 +84,8 @@ class NoPremiumPl(MultiHoster): self.fail(self.ERROR_CODES[parsed['errno']] % self.__name__) else: #: Error code isn't yet added to plugin - self.fail( - parsed['errstring'] - or _("Unknown error (code: %s)") % parsed['errno'] - ) + self.fail(parsed['errstring'] or + _("Unknown error (code: %s)") % parsed['errno']) if "sdownload" in parsed: if parsed['sdownload'] == "1": diff --git a/module/plugins/hoster/NowDownloadSx.py b/module/plugins/hoster/NowDownloadSx.py index e03ec2789..5aadd0b3f 100644 --- a/module/plugins/hoster/NowDownloadSx.py +++ b/module/plugins/hoster/NowDownloadSx.py @@ -3,7 +3,6 @@ import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.utils import fixup class NowDownloadSx(SimpleHoster): diff --git a/module/plugins/hoster/OboomCom.py b/module/plugins/hoster/OboomCom.py index 1ee342de5..d294ae3c6 100644 --- a/module/plugins/hoster/OboomCom.py +++ b/module/plugins/hoster/OboomCom.py @@ -13,7 +13,7 @@ from module.plugins.captcha.ReCaptcha import ReCaptcha class OboomCom(Hoster): __name__ = "OboomCom" __type__ = "hoster" - __version__ = "0.37" + __version__ = "0.38" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?oboom\.com/(?:#(?:id=|/)?)?(?P<ID>\w{8})' @@ -58,7 +58,7 @@ class OboomCom(Hoster): def get_session_token(self): if self.premium: - accountInfo = self.account.get_data(self.user, True) + accountInfo = self.account.get_data() if "session" in accountInfo: self.session_token = accountInfo['session'] else: @@ -141,6 +141,6 @@ class OboomCom(Hoster): self.download_domain = result[1] self.download_ticket = result[2] elif result[0] == 421: - self.retry(wait_time=result[2] + 60, msg=_("Connection limit exceeded")) + self.retry(delay=result[2] + 60, msg=_("Connection limit exceeded")) else: self.fail(_("Could not retrieve download ticket. Error code: %s") % result[0]) diff --git a/module/plugins/hoster/OverLoadMe.py b/module/plugins/hoster/OverLoadMe.py index 0b5bab6a5..a2bbfc701 100644 --- a/module/plugins/hoster/OverLoadMe.py +++ b/module/plugins/hoster/OverLoadMe.py @@ -11,7 +11,7 @@ from module.utils import parseFileSize as parse_size class OverLoadMe(MultiHoster): __name__ = "OverLoadMe" __type__ = "hoster" - __version__ = "0.13" + __version__ = "0.14" __status__ = "testing" __pattern__ = r'https?://.*overload\.me/.+' @@ -28,7 +28,7 @@ class OverLoadMe(MultiHoster): def handle_premium(self, pyfile): - data = self.account.get_data(self.user) + data = self.account.get_data() page = self.load("https://api.over-load.me/getdownload.php", get={'auth': data['password'], 'link': pyfile.url}) diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index ec02bb12d..8186c6224 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -11,7 +11,7 @@ from module.utils import fs_encode class PremiumTo(MultiHoster): __name__ = "PremiumTo" __type__ = "hoster" - __version__ = "0.25" + __version__ = "0.26" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -37,8 +37,8 @@ class PremiumTo(MultiHoster): disposition=True) - def check_file(self): - if self.check_download({'nopremium': "No premium account available"}): + def check_download(self): + if self.check_file({'nopremium': "No premium account available"}): self.retry(60, 5 * 60, "No premium account available") err = "" @@ -52,7 +52,7 @@ class PremiumTo(MultiHoster): if err: self.fail(err) - return super(PremiumTo, self).check_file() + return super(PremiumTo, self).check_download() getInfo = create_getInfo(PremiumTo) diff --git a/module/plugins/hoster/QuickshareCz.py b/module/plugins/hoster/QuickshareCz.py index 4311a82aa..2baef4c6d 100644 --- a/module/plugins/hoster/QuickshareCz.py +++ b/module/plugins/hoster/QuickshareCz.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class QuickshareCz(SimpleHoster): __name__ = "QuickshareCz" __type__ = "hoster" - __version__ = "0.57" + __version__ = "0.58" __status__ = "testing" __pattern__ = r'http://(?:[^/]*\.)?quickshare\.cz/stahnout-soubor/.+' @@ -39,7 +39,7 @@ class QuickshareCz(SimpleHoster): if 'UU_prihlasen' in self.jsvars: if self.jsvars['UU_prihlasen'] == "0": self.log_warning(_("User not logged in")) - self.relogin(self.user) + self.relogin() self.retry() elif float(self.jsvars['UU_kredit']) < float(self.jsvars['kredit_odecet']): self.log_warning(_("Not enough credit left")) @@ -50,7 +50,7 @@ class QuickshareCz(SimpleHoster): else: self.handle_free(pyfile) - if self.check_download({'error': re.compile(r"\AChyba!")}, max_size=100): + if self.check_file({'error': re.compile(r"\AChyba!")}, max_size=100): self.fail(_("File not m or plugin defect")) diff --git a/module/plugins/hoster/RPNetBiz.py b/module/plugins/hoster/RPNetBiz.py index 62e6bee4e..5207832ee 100644 --- a/module/plugins/hoster/RPNetBiz.py +++ b/module/plugins/hoster/RPNetBiz.py @@ -44,10 +44,10 @@ class RPNetBiz(MultiHoster): self.wait(30) #: Wait for 30 seconds #: Lets query the server again asking for the status on the link, #: We need to keep doing this until we reach 100 - max_tries = 30 + attemps = 30 my_try = 0 - while (my_try <= max_tries): - self.log_debug("Try: %d ; Max Tries: %d" % (my_try, max_tries)) + while (my_try <= attemps): + self.log_debug("Try: %d ; Max Tries: %d" % (my_try, attemps)) res = self.load("https://premium.rpnet.biz/client_api.php", get={'username': user, 'password': info['login']['password'], @@ -66,7 +66,7 @@ class RPNetBiz(MultiHoster): self.wait(30) my_try += 1 - if my_try > max_tries: #: We went over the limit! + if my_try > attemps: #: We went over the limit! self.fail(_("Waited for about 15 minutes for download to finish but failed")) if 'generated' in link_status: diff --git a/module/plugins/hoster/RapideoPl.py b/module/plugins/hoster/RapideoPl.py index e1a0d278f..a43440e61 100644 --- a/module/plugins/hoster/RapideoPl.py +++ b/module/plugins/hoster/RapideoPl.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHoster import MultiHoster class RapideoPl(MultiHoster): __name__ = "RapideoPl" __type__ = "hoster" - __version__ = "0.04" + __version__ = "0.05" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -39,7 +39,7 @@ class RapideoPl(MultiHoster): def prepare(self): super(RapideoPl, self).prepare() - data = self.account.get_data(self.user) + data = self.account.get_data() self.usr = data['usr'] self.pwd = data['pwd'] @@ -84,10 +84,8 @@ class RapideoPl(MultiHoster): self.fail(self.ERROR_CODES[parsed['errno']] % self.__name__) else: #: Error code isn't yet added to plugin - self.fail( - parsed['errstring'] - or _("Unknown error (code: %s)") % parsed['errno'] - ) + self.fail(parsed['errstring'] or + _("Unknown error (code: %s)") % parsed['errno']) if "sdownload" in parsed: if parsed['sdownload'] == "1": diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index 636ea1bcc..3f2003034 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -14,7 +14,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class RapidgatorNet(SimpleHoster): __name__ = "RapidgatorNet" __type__ = "hoster" - __version__ = "0.35" + __version__ = "0.36" __status__ = "testing" __pattern__ = r'http://(?:www\.)?(rapidgator\.net|rg\.to)/file/\w+' @@ -51,7 +51,7 @@ class RapidgatorNet(SimpleHoster): def setup(self): if self.account: - self.sid = self.account.get_data(self.user).get('sid', None) + self.sid = self.account.get_data('sid') else: self.sid = None @@ -81,12 +81,12 @@ class RapidgatorNet(SimpleHoster): return json['response'] elif status == 423: - self.account.empty(self.user) + self.account.empty() self.retry() else: - self.account.relogin(self.user) - self.retry(wait_time=60) + self.account.relogin() + self.retry(delay=60) def handle_premium(self, pyfile): diff --git a/module/plugins/hoster/RehostTo.py b/module/plugins/hoster/RehostTo.py index 6f0645e9f..af8ba3fd9 100644 --- a/module/plugins/hoster/RehostTo.py +++ b/module/plugins/hoster/RehostTo.py @@ -8,7 +8,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class RehostTo(MultiHoster): __name__ = "RehostTo" __type__ = "hoster" - __version__ = "0.23" + __version__ = "0.24" __status__ = "testing" __pattern__ = r'https?://.*rehost\.to\..+' @@ -23,7 +23,7 @@ class RehostTo(MultiHoster): def handle_premium(self, pyfile): self.download("http://rehost.to/process_download.php", get={'user': "cookie", - 'pass': self.account.get_data(self.user)['session'], + 'pass': self.account.get_data('session'), 'dl' : pyfile.url}, disposition=True) diff --git a/module/plugins/hoster/Share4WebCom.py b/module/plugins/hoster/Share4WebCom.py index 3f128be5e..898e12927 100644 --- a/module/plugins/hoster/Share4WebCom.py +++ b/module/plugins/hoster/Share4WebCom.py @@ -7,7 +7,7 @@ from module.plugins.internal.SimpleHoster import create_getInfo class Share4WebCom(UnibytesCom): __name__ = "Share4WebCom" __type__ = "hoster" - __version__ = "0.12" + __version__ = "0.13" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?share4web\.com/get/\w+' @@ -17,7 +17,7 @@ class Share4WebCom(UnibytesCom): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - HOSTER_DOMAIN = "share4web.com" + PLUGIN_DOMAIN = "share4web.com" getInfo = create_getInfo(Share4WebCom) diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index bba4bf6ad..56177f97a 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -12,7 +12,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class ShareonlineBiz(SimpleHoster): __name__ = "ShareonlineBiz" __type__ = "hoster" - __version__ = "0.56" + __version__ = "0.57" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(share-online\.biz|egoshare\.com)/(download\.php\?id=|dl/)(?P<ID>\w+)' @@ -105,8 +105,8 @@ class ShareonlineBiz(SimpleHoster): self.wait() - def check_file(self): - check = self.check_download({'cookie': re.compile(r'<div id="dl_failure"'), + def check_download(self): + check = self.check_file({'cookie': re.compile(r'<div id="dl_failure"'), 'fail' : re.compile(r"<title>Share-Online")}) if check == "cookie": @@ -117,13 +117,13 @@ class ShareonlineBiz(SimpleHoster): self.captcha.invalid() self.retry(5, 5 * 60, _("Download failed")) - return super(ShareonlineBiz, self).check_file() + return super(ShareonlineBiz, self).check_download() def handle_premium(self, pyfile): #: Should be working better loading (account) api internally html = self.load("https://api.share-online.biz/account.php", - get={'username': self.user, - 'password': self.account.get_info(self.user)['login']['password'], + get={'username': self.account.user, + 'password': self.account.get_login('password'), 'act' : "download", 'lid' : self.info['fileid']}) @@ -170,7 +170,7 @@ class ShareonlineBiz(SimpleHoster): self.fail(_("Premium account needed")) elif errmsg in ("expired", "server"): - self.retry(wait_time=600, msg=errmsg) + self.retry(delay=600, msg=errmsg) elif errmsg == "full": self.retry(10, 600, _("Server is full")) @@ -181,7 +181,7 @@ class ShareonlineBiz(SimpleHoster): else: self.wantReconnect = True - self.retry(wait_time=60, msg=errmsg) + self.retry(delay=60, msg=errmsg) getInfo = create_getInfo(ShareonlineBiz) diff --git a/module/plugins/hoster/SimplyPremiumCom.py b/module/plugins/hoster/SimplyPremiumCom.py index be9b89f24..01b21079d 100644 --- a/module/plugins/hoster/SimplyPremiumCom.py +++ b/module/plugins/hoster/SimplyPremiumCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import seconds_to_midnight class SimplyPremiumCom(MultiHoster): __name__ = "SimplyPremiumCom" __type__ = "hoster" - __version__ = "0.11" + __version__ = "0.12" __status__ = "testing" __pattern__ = r'https?://.+simply-premium\.com' @@ -28,7 +28,7 @@ class SimplyPremiumCom(MultiHoster): def check_errors(self): if '<valid>0</valid>' in self.html or ( "You are not allowed to download from this host" in self.html and self.premium): - self.account.relogin(self.user) + self.account.relogin() self.retry() elif "NOTFOUND" in self.html: @@ -40,7 +40,7 @@ class SimplyPremiumCom(MultiHoster): elif "trafficlimit" in self.html: self.log_warning(_("Reached daily limit for this host")) - self.retry(wait_time=seconds_to_midnight(gmt=2), msg="Daily limit for this host reached") + self.retry(delay=seconds_to_midnight(), msg="Daily limit for this host reached") elif "hostererror" in self.html: self.log_warning(_("Hoster temporarily unavailable, waiting 1 minute and retry")) diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 829609228..d26439d68 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo, rep class SimplydebridCom(MultiHoster): __name__ = "SimplydebridCom" __type__ = "hoster" - __version__ = "0.20" + __version__ = "0.21" __status__ = "testing" __pattern__ = r'http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd\.php' @@ -41,11 +41,11 @@ class SimplydebridCom(MultiHoster): self.wait(5) - def check_file(self): - if self.check_download({'error': "No address associated with hostname"}): + def check_download(self): + if self.check_file({'error': "No address associated with hostname"}): self.retry(24, 3 * 60, _("Bad file downloaded")) - return super(SimplydebridCom, self).check_file() + return super(SimplydebridCom, self).check_download() getInfo = create_getInfo(SimplydebridCom) diff --git a/module/plugins/hoster/SmoozedCom.py b/module/plugins/hoster/SmoozedCom.py index 33d098a00..67e590cec 100644 --- a/module/plugins/hoster/SmoozedCom.py +++ b/module/plugins/hoster/SmoozedCom.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHoster import MultiHoster class SmoozedCom(MultiHoster): __name__ = "SmoozedCom" __type__ = "hoster" - __version__ = "0.08" + __version__ = "0.09" __status__ = "testing" __pattern__ = r'^unmatchable$' #: Since we want to allow the user to specify the list of hoster to use we let MultiHoster.activate @@ -36,7 +36,7 @@ class SmoozedCom(MultiHoster): pyfile.name = ".".join(temp) #: Check the link - get_data = {'session_key': self.account.get_data(self.user)['session'], + get_data = {'session_key': self.account.get_data('session'), 'url' : pyfile.url} data = json_loads(self.load("http://www2.smoozed.com/api/check", get=get_data)) diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index ab96f65a1..ba9ac390e 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -15,7 +15,7 @@ def convert_decimal_prefix(m): class UlozTo(SimpleHoster): __name__ = "UlozTo" __type__ = "hoster" - __version__ = "1.15" + __version__ = "1.16" __status__ = "testing" __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj\.cz|zachowajto\.pl)/(?:live/)?(?P<ID>\w+/[^/?]*)' @@ -120,8 +120,8 @@ class UlozTo(SimpleHoster): return super(UlozTo, self).check_errors() - def check_file(self): - check = self.check_download({ + def check_download(self): + check = self.check_file({ 'wrong_captcha': ">An error ocurred while verifying the user", 'offline' : re.compile(self.OFFLINE_PATTERN), 'passwd' : self.PASSWD_PATTERN, @@ -148,7 +148,7 @@ class UlozTo(SimpleHoster): elif check == "not_found": self.fail(_("Server error, file not downloadable")) - return super(UlozTo, self).check_file() + return super(UlozTo, self).check_download() getInfo = create_getInfo(UlozTo) diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py index d4b7d6dd4..b82c04ad1 100644 --- a/module/plugins/hoster/UnibytesCom.py +++ b/module/plugins/hoster/UnibytesCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class UnibytesCom(SimpleHoster): __name__ = "UnibytesCom" __type__ = "hoster" - __version__ = "0.14" + __version__ = "0.15" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?unibytes\.com/[\w .-]{11}B' @@ -21,7 +21,7 @@ class UnibytesCom(SimpleHoster): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - HOSTER_DOMAIN = "unibytes.com" + PLUGIN_DOMAIN = "unibytes.com" INFO_PATTERN = r'<span[^>]*?id="fileName".*?>(?P<N>[^>]+)</span>\s*\((?P<S>\d.*?)\)' @@ -30,7 +30,7 @@ class UnibytesCom(SimpleHoster): def handle_free(self, pyfile): - domain = "http://www.%s/" % self.HOSTER_DOMAIN + domain = "http://www.%s/" % self.PLUGIN_DOMAIN action, post_data = self.parse_html_form('id="startForm"') self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0) diff --git a/module/plugins/hoster/UpleaCom.py b/module/plugins/hoster/UpleaCom.py index db9517f42..15d47dec5 100644 --- a/module/plugins/hoster/UpleaCom.py +++ b/module/plugins/hoster/UpleaCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class UpleaCom(XFSHoster): __name__ = "UpleaCom" __type__ = "hoster" - __version__ = "0.12" + __version__ = "0.13" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?uplea\.com/dl/\w{15}' @@ -20,7 +20,7 @@ class UpleaCom(XFSHoster): ("GammaC0de", None)] - HOSTER_DOMAIN = "uplea.com" + PLUGIN_DOMAIN = "uplea.com" SIZE_REPLACEMENTS = [('ko','KB'), ('mo','MB'), ('go','GB'), ('Ko','KB'), ('Mo','MB'), ('Go','GB')] diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py index 88d79e9ba..a3d54e8ef 100644 --- a/module/plugins/hoster/UploadableCh.py +++ b/module/plugins/hoster/UploadableCh.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class UploadableCh(SimpleHoster): __name__ = "UploadableCh" __type__ = "hoster" - __version__ = "0.12" + __version__ = "0.13" __status__ = "testing" __pattern__ = r'http://(?:www\.)?uploadable\.ch/file/(?P<ID>\w+)' @@ -65,13 +65,13 @@ class UploadableCh(SimpleHoster): self.download(pyfile.url, post={'download': "normal"}, disposition=True) - def check_file(self): - if self.check_download({'wait': re.compile("Please wait for")}): + def check_download(self): + if self.check_file({'wait': re.compile("Please wait for")}): self.log_info(_("Downloadlimit reached, please wait or reconnect")) self.wait(60 * 60, True) self.retry() - return super(UploadableCh, self).check_file() + return super(UploadableCh, self).check_download() getInfo = create_getInfo(UploadableCh) diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index 0a89363f8..0009cc471 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class WebshareCz(SimpleHoster): __name__ = "WebshareCz" __type__ = "hoster" - __version__ = "0.19" + __version__ = "0.20" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(en\.)?webshare\.cz/(?:#/)?file/(?P<ID>\w+)' @@ -41,7 +41,7 @@ class WebshareCz(SimpleHoster): def handle_free(self, pyfile): - wst = self.account.get_data(self.user).get('wst', None) if self.account else None + wst = self.account.get_data('wst') if self.account else None api_data = get_url("https://webshare.cz/api/file_link/", post={'ident': self.info['pattern']['ID'], 'wst': wst}) diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 8ede709de..c7d8a7761 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class XFileSharingPro(XFSHoster): __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.53" + __version__ = "0.54" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)' @@ -24,25 +24,25 @@ class XFileSharingPro(XFSHoster): def _log(self, level, plugintype, pluginname, messages): return super(XFileSharingPro, self)._log(level, plugintype, - "%s: %s" % (pluginname, self.HOSTER_NAME), + "%s: %s" % (pluginname, self.PLUGIN_NAME), messages) def init(self): self.__pattern__ = self.pyload.pluginManager.hosterPlugins[self.__name__]['pattern'] - self.HOSTER_DOMAIN = re.match(self.__pattern__, self.pyfile.url).group("DOMAIN").lower() - self.HOSTER_NAME = "".join(part.capitalize() for part in re.split(r'(\.|\d+|\-)', self.HOSTER_DOMAIN) if part != '.') + self.PLUGIN_DOMAIN = re.match(self.__pattern__, self.pyfile.url).group("DOMAIN").lower() + self.PLUGIN_NAME = "".join(part.capitalize() for part in re.split(r'(\.|\d+|\-)', self.PLUGIN_DOMAIN) if part != '.') def _setup(self): - account_name = self.__name__ if self.account.HOSTER_DOMAIN is None else self.HOSTER_NAME + account_name = self.__name__ if self.account.PLUGIN_DOMAIN is None else self.PLUGIN_NAME self.chunk_limit = 1 self.multiDL = True if self.account: - self.req = self.pyload.requestFactory.getRequest(accountname, self.user) - self.premium = self.account.is_premium(self.user) + self.req = self.pyload.requestFactory.getRequest(accountname, self.account.user) + self.premium = self.account.premium self.resume_download = self.premium else: self.req = self.pyload.requestFactory.getRequest(account_name) @@ -55,19 +55,19 @@ class XFileSharingPro(XFSHoster): self.req.close() if not self.account: - self.account = self.pyload.accountManager.getAccountPlugin(self.HOSTER_NAME) + self.account = self.pyload.accountManager.getAccountPlugin(self.PLUGIN_NAME) if not self.account: self.account = self.pyload.accountManager.getAccountPlugin(self.__name__) if self.account: - if not self.account.HOSTER_DOMAIN: - self.account.HOSTER_DOMAIN = self.HOSTER_DOMAIN + if not self.account.PLUGIN_DOMAIN: + self.account.PLUGIN_DOMAIN = self.PLUGIN_DOMAIN - if not self.user: - self.user = self.account.select()[0] + if not self.account.user: #@TODO: Move to `Account` in 0.4.10 + self.account.user = self.account.select()[0] - if not self.user or not self.account.is_logged(self.user, True): + if not self.account.logged: self.account = False diff --git a/module/plugins/hoster/ZeveraCom.py b/module/plugins/hoster/ZeveraCom.py index 47286fca1..9f3fea189 100644 --- a/module/plugins/hoster/ZeveraCom.py +++ b/module/plugins/hoster/ZeveraCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class ZeveraCom(MultiHoster): __name__ = "ZeveraCom" __type__ = "hoster" - __version__ = "0.32" + __version__ = "0.33" __status__ = "testing" __pattern__ = r'https?://(?:www\.)zevera\.com/(getFiles\.ashx|Members/download\.ashx)\?.*ourl=.+' @@ -25,7 +25,7 @@ class ZeveraCom(MultiHoster): def handle_premium(self, pyfile): - self.link = "https://%s/getFiles.ashx?ourl=%s" % (self.account.HOSTER_DOMAIN, pyfile.url) + self.link = "https://%s/getFiles.ashx?ourl=%s" % (self.account.PLUGIN_DOMAIN, pyfile.url) getInfo = create_getInfo(ZeveraCom) |