diff options
66 files changed, 238 insertions, 239 deletions
diff --git a/module/plugins/accounts/BitshareCom.py b/module/plugins/accounts/BitshareCom.py index 412aae534..00e546f6d 100644 --- a/module/plugins/accounts/BitshareCom.py +++ b/module/plugins/accounts/BitshareCom.py @@ -28,7 +28,6 @@ class BitshareCom(Account): def login(self, user, data, req): html = req.load("http://bitshare.com/login.html", post={"user": user, "password": data['password'], "submit": "Login"}, - cookies=True, decode=True) if "login" in req.lastEffectiveURL: diff --git a/module/plugins/accounts/FilesMailRu.py b/module/plugins/accounts/FilesMailRu.py index 15926589e..ee309c425 100644 --- a/module/plugins/accounts/FilesMailRu.py +++ b/module/plugins/accounts/FilesMailRu.py @@ -25,7 +25,6 @@ class FilesMailRu(Account): "Login": user, "Password": data['password'], "Page": "http://files.mail.ru/"}, - cookies=True, decode=True) if "Неверное имя пользователя или пароль" in html: diff --git a/module/plugins/accounts/FreakshareCom.py b/module/plugins/accounts/FreakshareCom.py index 83f4a9a84..a1c7b5662 100644 --- a/module/plugins/accounts/FreakshareCom.py +++ b/module/plugins/accounts/FreakshareCom.py @@ -46,7 +46,6 @@ class FreakshareCom(Account): html = req.load("http://freakshare.com/login.html", post={"submit": "Login", "user": user, "pass": data['password']}, - cookies=True, decode=True) if ">Wrong Username or Password" in html: diff --git a/module/plugins/accounts/NetloadIn.py b/module/plugins/accounts/NetloadIn.py index 1abd7fa84..b86ace93b 100644 --- a/module/plugins/accounts/NetloadIn.py +++ b/module/plugins/accounts/NetloadIn.py @@ -38,7 +38,7 @@ class NetloadIn(Account): "txtpass" : data['password'], "txtcheck": "login", "txtlogin": "Login"}, - cookies=True, decode=True) + if "password or it might be invalid!" in html: self.wrongPassword() diff --git a/module/plugins/accounts/OverLoadMe.py b/module/plugins/accounts/OverLoadMe.py index d59944e63..64d04aded 100644 --- a/module/plugins/accounts/OverLoadMe.py +++ b/module/plugins/accounts/OverLoadMe.py @@ -15,7 +15,7 @@ class OverLoadMe(Account): def loadAccountInfo(self, user, req): - https = "https" if self.getConfig("ssl") else "http" + https = "https" if self.getConfig('ssl') else "http" data = self.getAccountData(user) html = req.load(https + "://api.over-load.me/account.php", get={'user': user, @@ -32,7 +32,7 @@ class OverLoadMe(Account): def login(self, user, data, req): - https = "https" if self.getConfig("ssl") else "http" + https = "https" if self.getConfig('ssl') else "http" jsondata = req.load(https + "://api.over-load.me/account.php", get={'user': user, 'auth': data['password']}).strip() diff --git a/module/plugins/captcha/LinksaveIn.py b/module/plugins/captcha/LinksaveIn.py index b5cb0f608..a7ae715fe 100644 --- a/module/plugins/captcha/LinksaveIn.py +++ b/module/plugins/captcha/LinksaveIn.py @@ -46,7 +46,7 @@ class LinksaveIn(OCR): pix = frame.load() for x in xrange(frame.size[0]): for y in xrange(frame.size[1]): - if lut[pix[x, y]] != (0,0,0): + if lut[pix[x, y]] != (0, 0, 0): npix[x, y] = lut[pix[x, y]] frame_nr += 1 new.save(self.data_dir+"unblacked.png") @@ -112,7 +112,7 @@ class LinksaveIn(OCR): rgb_bg = bglut[bgpix[x, y]] rgb_c = lut[pix[x, y]] if rgb_c == rgb_bg: - orgpix[x, y] = (255,255,255) + orgpix[x, y] = (255, 255, 255) def eval_black_white(self): @@ -126,13 +126,13 @@ class LinksaveIn(OCR): r, g, b = rgb pix[x, y] = (255,255,255) if r > max(b, g)+thresh: - pix[x, y] = (0,0,0) + pix[x, y] = (0, 0, 0) if g < min(r, b): - pix[x, y] = (0,0,0) + pix[x, y] = (0, 0, 0) if g > max(r, b)+thresh: - pix[x, y] = (0,0,0) + pix[x, y] = (0, 0, 0) if b > max(r, g)+thresh: - pix[x, y] = (0,0,0) + pix[x, y] = (0, 0, 0) self.image = new self.pixels = self.image.load() diff --git a/module/plugins/container/TXT.py b/module/plugins/container/TXT.py index 98ca426d7..d419ee060 100644 --- a/module/plugins/container/TXT.py +++ b/module/plugins/container/TXT.py @@ -23,7 +23,7 @@ class TXT(Container): def decrypt(self, pyfile): try: - encoding = codecs.lookup(self.getConfig("encoding")).name + encoding = codecs.lookup(self.getConfig('encoding')).name except Exception: encoding = "utf-8" @@ -57,7 +57,7 @@ class TXT(Container): if not value: packages.pop(key, None) - if self.getConfig("flush"): + if self.getConfig('flush'): try: txt = open(fs_filename, 'wb') txt.close() diff --git a/module/plugins/crypter/EmbeduploadCom.py b/module/plugins/crypter/EmbeduploadCom.py index 456e48a32..5336a0d03 100644 --- a/module/plugins/crypter/EmbeduploadCom.py +++ b/module/plugins/crypter/EmbeduploadCom.py @@ -30,7 +30,7 @@ class EmbeduploadCom(Crypter): m = re.findall(self.LINK_PATTERN, self.html) if m: - prefered_set = set(self.getConfig("preferedHoster").split('|')) + prefered_set = set(self.getConfig('preferedHoster').split('|')) prefered_set = map(lambda s: s.lower().split('.')[0], prefered_set) self.logDebug("PF: %s" % prefered_set) @@ -39,7 +39,7 @@ class EmbeduploadCom(Crypter): self.urls = self.getLocation(tmp_links) if not self.urls: - ignored_set = set(self.getConfig("ignoredHoster").split('|')) + ignored_set = set(self.getConfig('ignoredHoster').split('|')) ignored_set = map(lambda s: s.lower().split('.')[0], ignored_set) self.logDebug("IG: %s" % ignored_set) diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index d15d2ae4b..baea8886b 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -39,7 +39,7 @@ class FilecryptCc(Crypter): def decrypt(self, pyfile): - self.html = self.load(pyfile.url, cookies=True) + self.html = self.load(pyfile.url) if "content notfound" in self.html: #@NOTE: "content notfound" is NOT a typo self.offline() @@ -64,7 +64,7 @@ class FilecryptCc(Crypter): self.logInfo(_("Found %d mirrors") % len(mirror)) for i in mirror[1:]: - self.siteWithLinks = self.siteWithLinks + self.load(i, cookies=True).decode("utf-8", "replace") + self.siteWithLinks = self.siteWithLinks + self.load(i).decode("utf-8", "replace") def handlePasswordProtection(self): @@ -78,7 +78,7 @@ class FilecryptCc(Crypter): if not password: self.fail(_("Please enter the password in package section and try again")) - self.html = self.load(self.pyfile.url, post={"password": password}, cookies=True) + self.html = self.load(self.pyfile.url, post={"password": password}) def handleCaptcha(self): @@ -94,7 +94,6 @@ class FilecryptCc(Crypter): self.siteWithLinks = self.load(self.pyfile.url, post={'recaptcha_response_field': captcha_code}, - cookies=True, decode=True) elif m2: #: circle captcha self.logDebug("Captcha-URL: %s" % m2.group(1)) @@ -106,7 +105,6 @@ class FilecryptCc(Crypter): self.siteWithLinks = self.load(self.pyfile.url, post={'button.x': captcha_code[0], 'button.y': captcha_code[1]}, - cookies=True, decode=True) else: @@ -142,9 +140,9 @@ class FilecryptCc(Crypter): weblinks = re.findall(self.WEBLINK_PATTERN, self.siteWithLinks) for link in weblinks: - res = self.load("http://filecrypt.cc/Link/%s.html" % link, cookies=True) + res = self.load("http://filecrypt.cc/Link/%s.html" % link) link2 = re.search('<iframe noresize src="(.*)"></iframe>', res) - res2 = self.load(link2.group(1), just_header=True, cookies=True) + res2 = self.load(link2.group(1), just_header=True) self.links.append(res2['location']) except Exception, e: diff --git a/module/plugins/crypter/LinkdecrypterCom.py b/module/plugins/crypter/LinkdecrypterCom.py index 7f24784c7..7dc174d66 100644 --- a/module/plugins/crypter/LinkdecrypterCom.py +++ b/module/plugins/crypter/LinkdecrypterCom.py @@ -34,7 +34,7 @@ class LinkdecrypterCom(Crypter): retries = 5 post_dict = {"link_cache": "on", "pro_links": pyfile.url, "modo_links": "text"} - self.html = self.load('http://linkdecrypter.com/', post=post_dict, cookies=True, decode=True) + self.html = self.load('http://linkdecrypter.com/', post=post_dict, decode=True) while retries: m = re.search(self.TEXTAREA_PATTERN, self.html, flags=re.S) @@ -65,4 +65,4 @@ class LinkdecrypterCom(Crypter): else: retries -= 1 - self.html = self.load('http://linkdecrypter.com/', cookies=True, decode=True) + self.html = self.load('http://linkdecrypter.com/', decode=True) diff --git a/module/plugins/crypter/MultiloadCz.py b/module/plugins/crypter/MultiloadCz.py index 55f424f36..006408c4b 100644 --- a/module/plugins/crypter/MultiloadCz.py +++ b/module/plugins/crypter/MultiloadCz.py @@ -34,9 +34,9 @@ class MultiloadCz(Crypter): else: m = re.findall(self.LINK_PATTERN, self.html) if m: - prefered_set = set(self.getConfig("usedHoster").split('|')) + prefered_set = set(self.getConfig('usedHoster').split('|')) self.urls.extend(x[1] for x in m if x[0] in prefered_set) if not self.urls: - ignored_set = set(self.getConfig("ignoredHoster").split('|')) + ignored_set = set(self.getConfig('ignoredHoster').split('|')) self.urls.extend(x[1] for x in m if x[0] not in ignored_set) diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py index fd89571eb..517adcb68 100644 --- a/module/plugins/hooks/AlldebridCom.py +++ b/module/plugins/hooks/AlldebridCom.py @@ -23,7 +23,7 @@ class AlldebridCom(MultiHook): def getHosters(self): - https = "https" if self.getConfig("ssl") else "http" + https = "https" if self.getConfig('ssl') else "http" html = self.getURL(https + "://www.alldebrid.com/api.php", get={'action': "get_host"}).replace("\"", "").strip() return [x.strip() for x in html.split(",") if x.strip()] diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py index 7a9e6d6f8..180ad0d78 100644 --- a/module/plugins/hooks/AndroidPhoneNotify.py +++ b/module/plugins/hooks/AndroidPhoneNotify.py @@ -40,19 +40,19 @@ class AndroidPhoneNotify(Hook): def newCaptchaTask(self, task): - if not self.getConfig("notifycaptcha"): + if not self.getConfig('notifycaptcha'): return self.notify(_("Captcha"), _("New request waiting user input")) def packageFinished(self, pypack): - if self.getConfig("notifypackage"): + if self.getConfig('notifypackage'): self.notify(_("Package finished"), pypack.name) def allDownloadsProcessed(self): - if not self.getConfig("notifyprocessed"): + if not self.getConfig('notifyprocessed'): return if any(True for pdata in self.core.api.getQueue() if pdata.linksdone < pdata.linkstotal): @@ -62,13 +62,15 @@ class AndroidPhoneNotify(Hook): @Expose - def notify(self, event, msg=""): - apikey = self.getConfig("apikey") + def notify(self, + event, + msg="", + key=self.getConfig('apikey')): - if not apikey: + if not key: return - if self.core.isClientConnected() and not self.getConfig("ignoreclient"): + if self.core.isClientConnected() and not self.getConfig('ignoreclient'): return elapsed_time = time.time() - self.last_notify @@ -84,7 +86,7 @@ class AndroidPhoneNotify(Hook): getURL("http://www.notifymyandroid.com/publicapi/notify", - get={'apikey' : apikey, + get={'apikey' : key, 'application': "pyLoad", 'event' : event, 'description': msg}) diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index 695852683..b8a659f99 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -13,7 +13,7 @@ class AntiVirus(Hook): __type__ = "hook" __version__ = "0.04" - __config__ = [("action" , "Antivirus default;Delete;Quarantine", "Manage infected files" , "Antivirus default"), + __config__ = [("action" , "Antivirus default;Delete;Quarantine", "Manage infected files" , "Antivirus default"), #@TODO: add trash option (use Send2Trash lib) ("quardir" , "folder" , "Quarantine folder" , "" ), ("scanfailed", "bool" , "Scan incompleted files (failed downloads)", False ), ("cmdfile" , "file" , "Antivirus executable" , "" ), @@ -55,7 +55,7 @@ class AntiVirus(Hook): if err: self.logWarning(filename, err) if not self.getConfig('ignore-err') - self.logDebug("Delete/Quarantine action aborted") + self.logDebug("Delete/Quarantine task is aborted") return if p.returncode: @@ -68,8 +68,7 @@ class AntiVirus(Hook): elif action == "Quarantine": pyfile.setCustomStatus(_("file moving")) pyfile.setProgress(0) - new_filename = save_join(self.getConfig('quardir'), filename) - shutil.move(file, new_filename) + shutil.move(file, self.getConfig('quardir')) except (IOError, shutil.Error), e: self.logError(filename, action + " action failed!", e) diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 777564554..d7995650b 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -57,7 +57,7 @@ class BypassCaptcha(Hook): def getCredits(self): - res = getURL(self.GETCREDITS_URL, post={"key": self.getConfig("passkey")}) + res = getURL(self.GETCREDITS_URL, post={"key": self.getConfig('passkey')}) data = dict(x.split(' ', 1) for x in res.splitlines()) return int(data['Left']) @@ -72,7 +72,7 @@ class BypassCaptcha(Hook): try: res = req.load(self.SUBMIT_URL, post={'vendor_key': self.PYLOAD_KEY, - 'key': self.getConfig("passkey"), + 'key': self.getConfig('passkey'), 'gen_task_id': "1", 'file': (FORM_FILE, captcha)}, multipart=True) @@ -92,7 +92,7 @@ class BypassCaptcha(Hook): def respond(self, ticket, success): try: - res = getURL(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig("passkey"), + res = getURL(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig('passkey'), "cv": 1 if success else 0}) except BadHeader, e: self.logError(_("Could not send response"), e) @@ -105,10 +105,10 @@ class BypassCaptcha(Hook): if not task.isTextual(): return False - if not self.getConfig("passkey"): + if not self.getConfig('passkey'): return False - if self.core.isClientConnected() and not self.getConfig("force"): + if self.core.isClientConnected() and not self.getConfig('force'): return False if self.getCredits() > 0: diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 2b4f405ed..6d42416ff 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -46,13 +46,13 @@ class Captcha9Kw(Hook): def setup(self): self.info = {} #@TODO: Remove in 0.4.10 - if self.getConfig("ssl"): + if self.getConfig('ssl'): self.API_URL = self.API_URL.replace("http://", "https://") def getCredits(self): res = getURL(self.API_URL, - get={'apikey': self.getConfig("passkey"), + get={'apikey': self.getConfig('passkey'), 'pyload': "1", 'source': "pyload", 'action': "usercaptchaguthaben"}) @@ -83,14 +83,14 @@ class Captcha9Kw(Hook): 'numeric' : 0, 'case_sensitive': 0, 'math' : 0, - 'prio' : min(max(self.getConfig("prio"), 0), 10), - 'confirm' : self.getConfig("confirm"), - 'timeout' : min(max(self.getConfig("timeout"), 300), 3999), - 'selfsolve' : self.getConfig("selfsolve"), - 'cph' : self.getConfig("captchaperhour"), - 'cpm' : self.getConfig("captchapermin")} + 'prio' : min(max(self.getConfig('prio'), 0), 10), + 'confirm' : self.getConfig('confirm'), + 'timeout' : min(max(self.getConfig('timeout'), 300), 3999), + 'selfsolve' : self.getConfig('selfsolve'), + 'cph' : self.getConfig('captchaperhour'), + 'cpm' : self.getConfig('captchapermin')} - for opt in str(self.getConfig("hoster_options").split('|')): + for opt in str(self.getConfig('hoster_options').split('|')): details = map(str.strip, opt.split(':')) @@ -109,7 +109,7 @@ class Captcha9Kw(Hook): break - post_data = {'apikey' : self.getConfig("passkey"), + post_data = {'apikey' : self.getConfig('passkey'), 'prio' : option['prio'], 'confirm' : option['confirm'], 'maxtimeout' : option['timeout'], @@ -146,9 +146,9 @@ class Captcha9Kw(Hook): task.data["ticket"] = res - for _i in xrange(int(self.getConfig("timeout") / 5)): + for _i in xrange(int(self.getConfig('timeout') / 5)): result = getURL(self.API_URL, - get={'apikey': self.getConfig("passkey"), + get={'apikey': self.getConfig('passkey'), 'id' : res, 'pyload': "1", 'info' : "1", @@ -172,10 +172,10 @@ class Captcha9Kw(Hook): if not task.isTextual() and not task.isPositional(): return - if not self.getConfig("passkey"): + if not self.getConfig('passkey'): return - if self.core.isClientConnected() and not self.getConfig("force"): + if self.core.isClientConnected() and not self.getConfig('force'): return credits = self.getCredits() @@ -184,8 +184,8 @@ class Captcha9Kw(Hook): self.logError(_("Your captcha 9kw.eu account has not enough credits")) return - queue = min(self.getConfig("queue"), 999) - timeout = min(max(self.getConfig("timeout"), 300), 3999) + queue = min(self.getConfig('queue'), 999) + timeout = min(max(self.getConfig('timeout'), 300), 3999) pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) for _i in xrange(5): @@ -197,7 +197,7 @@ class Captcha9Kw(Hook): else: self.fail(_("Too many captchas in queue")) - for opt in str(self.getConfig("hoster_options").split('|')): + for opt in str(self.getConfig('hoster_options').split('|')): details = map(str.strip, opt.split(':')) if not details or details[0].lower() != pluginname.lower(): @@ -227,7 +227,7 @@ class Captcha9Kw(Hook): self.logDebug("No CaptchaID for %s request (task: %s)" % (type, task)) return - passkey = self.getConfig("passkey") + passkey = self.getConfig('passkey') for _i in xrange(3): res = getURL(self.API_URL, diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 478138c3b..5350b4f7d 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -64,7 +64,7 @@ class CaptchaBrotherhood(Hook): def getCredits(self): res = getURL(self.API_URL + "askCredits.aspx", - get={"username": self.getConfig("username"), "password": self.getConfig("passkey")}) + get={"username": self.getConfig('username'), "password": self.getConfig('passkey')}) if not res.startswith("OK"): raise CaptchaBrotherhoodException(res) else: @@ -93,8 +93,8 @@ class CaptchaBrotherhood(Hook): req = getRequest() url = "%ssendNewCaptcha.aspx?%s" % (self.API_URL, - urlencode({'username' : self.getConfig("username"), - 'password' : self.getConfig("passkey"), + urlencode({'username' : self.getConfig('username'), + 'password' : self.getConfig('passkey'), 'captchaSource': "pyLoad", 'timeout' : "80"})) @@ -127,8 +127,8 @@ class CaptchaBrotherhood(Hook): def api_response(self, api, ticket): res = getURL("%s%s.aspx" % (self.API_URL, api), - get={"username": self.getConfig("username"), - "password": self.getConfig("passkey"), + get={"username": self.getConfig('username'), + "password": self.getConfig('passkey'), "captchaID": ticket}) if not res.startswith("OK"): raise CaptchaBrotherhoodException("Unknown response: %s" % res) @@ -143,10 +143,10 @@ class CaptchaBrotherhood(Hook): if not task.isTextual(): return False - if not self.getConfig("username") or not self.getConfig("passkey"): + if not self.getConfig('username') or not self.getConfig('passkey'): return False - if self.core.isClientConnected() and not self.getConfig("force"): + if self.core.isClientConnected() and not self.getConfig('force'): return False if self.getCredits() > 10: diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 7d08e6552..9474f6968 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -70,7 +70,7 @@ class Checksum(Hook): def coreReady(self): - if not self.getConfig("check_checksum"): + if not self.getConfig('check_checksum'): self.logInfo(_("Checksum validation is disabled in plugin configuration")) @@ -125,7 +125,7 @@ class Checksum(Hook): data.pop('size', None) # validate checksum - if data and self.getConfig("check_checksum"): + if data and self.getConfig('check_checksum'): if not 'md5' in data: for type in ("checksum", "hashsum", "hash"): @@ -152,14 +152,14 @@ class Checksum(Hook): def checkFailed(self, pyfile, local_file, msg): - check_action = self.getConfig("check_action") + check_action = self.getConfig('check_action') if check_action == "retry": - max_tries = self.getConfig("max_tries") - retry_action = self.getConfig("retry_action") + max_tries = self.getConfig('max_tries') + retry_action = self.getConfig('retry_action') if pyfile.plugin.retries < max_tries: if local_file: remove(local_file) - pyfile.plugin.retry(max_tries, self.getConfig("wait_time"), msg) + pyfile.plugin.retry(max_tries, self.getConfig('wait_time'), msg) elif retry_action == "nothing": return elif check_action == "nothing": diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 2f5938101..731c8bd7e 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -45,7 +45,7 @@ class ClickAndLoad(Hook): if not self.config['webinterface']['activated']: return - ip = "" if self.getConfig("extern") else "127.0.0.1" + ip = "" if self.getConfig('extern') else "127.0.0.1" webport = self.config['webinterface']['port'] cnlport = self.getConfig('port') diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index a67e70c7e..4eefb2bff 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -82,8 +82,8 @@ class DeathByCaptcha(Hook): if post: if not isinstance(post, dict): post = {} - post.update({"username": self.getConfig("username"), - "password": self.getConfig("passkey")}) + post.update({"username": self.getConfig('username'), + "password": self.getConfig('passkey')}) res = None try: @@ -136,7 +136,7 @@ class DeathByCaptcha(Hook): def submit(self, captcha, captchaType="file", match=None): #@NOTE: Workaround multipart-post bug in HTTPRequest.py - if re.match("^\w*$", self.getConfig("passkey")): + if re.match("^\w*$", self.getConfig('passkey')): multipart = True data = (FORM_FILE, captcha) else: @@ -172,10 +172,10 @@ class DeathByCaptcha(Hook): if not task.isTextual(): return False - if not self.getConfig("username") or not self.getConfig("passkey"): + if not self.getConfig('username') or not self.getConfig('passkey'): return False - if self.core.isClientConnected() and not self.getConfig("force"): + if self.core.isClientConnected() and not self.getConfig('force'): return False try: diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index 4996e212d..3b7ae524c 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -37,7 +37,7 @@ class DownloadScheduler(Hook): def updateSchedule(self, schedule=None): if schedule is None: - schedule = self.getConfig("timetable") + schedule = self.getConfig('timetable') schedule = re.findall("(\d{1,2}):(\d{2})[\s]*(-?\d+)", schedule.lower().replace("full", "-1").replace("none", "0")) @@ -65,7 +65,7 @@ class DownloadScheduler(Hook): def setDownloadSpeed(self, speed): if speed == 0: - abort = self.getConfig("abort") + abort = self.getConfig('abort') self.logInfo(_("Stopping download server. (Running downloads will %sbe aborted.)") % '' if abort else _('not ')) self.core.api.pauseServer() if abort: diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index d6ecca680..fa1c7a14b 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -38,7 +38,7 @@ class ExpertDecoders(Hook): def getCredits(self): - res = getURL(self.API_URL, post={"key": self.getConfig("passkey"), "action": "balance"}) + res = getURL(self.API_URL, post={"key": self.getConfig('passkey'), "action": "balance"}) if res.isdigit(): self.logInfo(_("%s credits left") % res) @@ -64,7 +64,7 @@ class ExpertDecoders(Hook): try: result = req.load(self.API_URL, post={'action' : "upload", - 'key' : self.getConfig("passkey"), + 'key' : self.getConfig('passkey'), 'file' : b64encode(data), 'gen_task_id': ticket}) finally: @@ -78,10 +78,10 @@ class ExpertDecoders(Hook): if not task.isTextual(): return False - if not self.getConfig("passkey"): + if not self.getConfig('passkey'): return False - if self.core.isClientConnected() and not self.getConfig("force"): + if self.core.isClientConnected() and not self.getConfig('force'): return False if self.getCredits() > 0: @@ -98,7 +98,7 @@ class ExpertDecoders(Hook): try: res = getURL(self.API_URL, - post={'action': "refund", 'key': self.getConfig("passkey"), 'gen_task_id': task.data['ticket']}) + post={'action': "refund", 'key': self.getConfig('passkey'), 'gen_task_id': task.data['ticket']}) self.logInfo(_("Request refund"), res) except BadHeader, e: diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 5f2790656..d17e4740c 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -44,26 +44,25 @@ class ExternalScripts(Hook): for folder in folders: self.scripts[folder] = [] - - self.initPluginType(folder, os.path.join(pypath, 'scripts', folder)) - self.initPluginType(folder, os.path.join('scripts', folder)) + for dir in (pypath, ''): + self.initPluginType(folder, os.path.join(dir, 'scripts', folder)) for script_type, names in self.scripts.iteritems(): if names: self.logInfo(_("Installed scripts for ") + script_type, ", ".join(map(os.path.basename, names))) - def initPluginType(self, folder, path): - if not os.path.exists(path): + def initPluginType(self, name, dir): + if not os.path.isdir(dir): try: - os.makedirs(path) + os.makedirs(dir) except IOError, e: self.logDebug(e) return - for filename in os.listdir(path): - file = os.path.join(path, filename) + for filename in os.listdir(dir): + file = os.path.join(dir, filename) if not os.path.isfile(file): continue @@ -72,9 +71,9 @@ class ExternalScripts(Hook): continue if not os.access(file, os.X_OK): - self.logWarning(_("Script not executable:") + " %s/%s" % (folder, filename)) + self.logWarning(_("Script not executable:") + " %s/%s" % (name, filename)) - self.scripts[folder].append(file) + self.scripts[name].append(file) def callScript(self, script, *args): diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 302bc909f..a046e55e7 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -31,14 +31,14 @@ class HotFolder(Hook): def periodical(self): - folder = fs_encode(self.getConfig("folder")) - file = fs_encode(self.getConfig("file")) + folder = fs_encode(self.getConfig('folder')) + file = fs_encode(self.getConfig('file')) try: if not os.path.isdir(os.path.join(folder, "finished")): os.makedirs(os.path.join(folder, "finished")) - if self.getConfig("watch_file"): + if self.getConfig('watch_file'): with open(file, "a+") as f: f.seek(0) content = f.read().strip() @@ -60,7 +60,7 @@ class HotFolder(Hook): if not os.path.isfile(path) or f.endswith("~") or f.startswith("#") or f.startswith("."): continue - newpath = os.path.join(folder, "finished", f if self.getConfig("keep") else "tmp_" + f) + newpath = os.path.join(folder, "finished", f if self.getConfig('keep') else "tmp_" + f) move(path, newpath) self.logInfo(_("Added %s from HotFolder") % f) diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 623f2d1bf..1c90c0e2f 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -59,7 +59,7 @@ class IRCInterface(Thread, Hook): def packageFinished(self, pypack): try: - if self.getConfig("info_pack"): + if self.getConfig('info_pack'): self.response(_("Package finished: %s") % pypack.name) except Exception: pass @@ -67,7 +67,7 @@ class IRCInterface(Thread, Hook): def downloadFinished(self, pyfile): try: - if self.getConfig("info_file"): + if self.getConfig('info_file'): self.response( _("Download finished: %(name)s @ %(plugin)s ") % {"name": pyfile.name, "plugin": pyfile.pluginname}) except Exception: @@ -75,7 +75,7 @@ class IRCInterface(Thread, Hook): def newCaptchaTask(self, task): - if self.getConfig("captcha") and task.isTextual(): + if self.getConfig('captcha') and task.isTextual(): task.handler.append(self) task.setWaiting(60) @@ -90,16 +90,16 @@ class IRCInterface(Thread, Hook): def run(self): # connect to IRC etc. self.sock = socket.socket() - host = self.getConfig("host") - self.sock.connect((host, self.getConfig("port"))) + host = self.getConfig('host') + self.sock.connect((host, self.getConfig('port'))) - if self.getConfig("ssl"): + if self.getConfig('ssl'): self.sock = ssl.wrap_socket(self.sock, cert_reqs=ssl.CERT_NONE) #@TODO: support certificate - nick = self.getConfig("nick") + nick = self.getConfig('nick') self.sock.send("NICK %s\r\n" % nick) self.sock.send("USER %s %s bla :%s\r\n" % (nick, host, nick)) - for t in self.getConfig("owner").split(): + for t in self.getConfig('owner').split(): if t.strip().startswith("#"): self.sock.send("JOIN %s\r\n" % t.strip()) self.logInfo(_("Connected to"), host) @@ -153,10 +153,10 @@ class IRCInterface(Thread, Hook): def handle_events(self, msg): - if not msg['origin'].split("!", 1)[0] in self.getConfig("owner").split(): + if not msg['origin'].split("!", 1)[0] in self.getConfig('owner').split(): return - if msg['target'].split("!", 1)[0] != self.getConfig("nick"): + if msg['target'].split("!", 1)[0] != self.getConfig('nick'): return if msg['action'] != "PRIVMSG": @@ -197,7 +197,7 @@ class IRCInterface(Thread, Hook): def response(self, msg, origin=""): if origin == "": - for t in self.getConfig("owner").split(): + for t in self.getConfig('owner').split(): self.sock.send("PRIVMSG %s :%s\r\n" % (t.strip(), msg)) else: self.sock.send("PRIVMSG %s :%s\r\n" % (origin.split("!", 1)[0], msg)) diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index b9dbfcdbe..2cf611b9f 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -61,8 +61,8 @@ class ImageTyperz(Hook): def getCredits(self): res = getURL(self.GETCREDITS_URL, post={'action': "REQUESTBALANCE", - 'username': self.getConfig("username"), - 'password': self.getConfig("passkey")}) + 'username': self.getConfig('username'), + 'password': self.getConfig('passkey')}) if res.startswith('ERROR'): raise ImageTyperzException(res) @@ -83,7 +83,7 @@ class ImageTyperz(Hook): try: #@NOTE: Workaround multipart-post bug in HTTPRequest.py - if re.match("^\w*$", self.getConfig("passkey")): + if re.match("^\w*$", self.getConfig('passkey')): multipart = True data = (FORM_FILE, captcha) else: @@ -94,8 +94,8 @@ class ImageTyperz(Hook): res = req.load(self.SUBMIT_URL, post={'action': "UPLOADCAPTCHA", - 'username': self.getConfig("username"), - 'password': self.getConfig("passkey"), "file": data}, + 'username': self.getConfig('username'), + 'password': self.getConfig('passkey'), "file": data}, multipart=multipart) finally: req.close() @@ -119,10 +119,10 @@ class ImageTyperz(Hook): if not task.isTextual(): return False - if not self.getConfig("username") or not self.getConfig("passkey"): + if not self.getConfig('username') or not self.getConfig('passkey'): return False - if self.core.isClientConnected() and not self.getConfig("force"): + if self.core.isClientConnected() and not self.getConfig('force'): return False if self.getCredits() > 0: @@ -139,8 +139,8 @@ class ImageTyperz(Hook): if task.data['service'] == self.__name__ and "ticket" in task.data: res = getURL(self.RESPOND_URL, post={'action': "SETBADIMAGE", - 'username': self.getConfig("username"), - 'password': self.getConfig("passkey"), + 'username': self.getConfig('username'), + 'password': self.getConfig('passkey'), 'imageid': task.data['ticket']}) if res == "SUCCESS": diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index c9f6fc30c..9093c8459 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -25,7 +25,7 @@ class MultiHome(Hook): def setup(self): self.register = {} self.interfaces = [] - self.parseInterfaces(self.getConfig("interfaces").split(";")) + self.parseInterfaces(self.getConfig('interfaces').split(";")) if not self.interfaces: self.parseInterfaces([self.config['download']['interface']]) self.setConfig("interfaces", self.toConfig()) diff --git a/module/plugins/hooks/OverLoadMe.py b/module/plugins/hooks/OverLoadMe.py index b15ce2766..5e1040da7 100644 --- a/module/plugins/hooks/OverLoadMe.py +++ b/module/plugins/hooks/OverLoadMe.py @@ -23,7 +23,7 @@ class OverLoadMe(MultiHook): def getHosters(self): - https = "https" if self.getConfig("ssl") else "http" + https = "https" if self.getConfig('ssl') else "http" html = self.getURL(https + "://api.over-load.me/hoster.php", get={'auth': "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"}).replace("\"", "").strip() self.logDebug("Hosterlist", html) diff --git a/module/plugins/hooks/RealdebridCom.py b/module/plugins/hooks/RealdebridCom.py index d9c9407dd..c97bc257c 100644 --- a/module/plugins/hooks/RealdebridCom.py +++ b/module/plugins/hooks/RealdebridCom.py @@ -23,7 +23,7 @@ class RealdebridCom(MultiHook): def getHosters(self): - https = "https" if self.getConfig("ssl") else "http" + https = "https" if self.getConfig('ssl') else "http" html = self.getURL(https + "://real-debrid.com/api/hosters.php").replace("\"", "").strip() return [x.strip() for x in html.split(",") if x.strip()] diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 07fb80967..7752b6a61 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -17,13 +17,13 @@ class RestartFailed(Hook): # event_list = ["pluginConfigChanged"] - MIN_INTERVAL = 15 * 60 #: 15m minimum check interval (value is in seconds) + MIN_CHECK_INTERVAL = 15 * 60 #: 15 minutes def pluginConfigChanged(self, plugin, name, value): if name == "interval": interval = value * 60 - if self.MIN_INTERVAL <= interval != self.interval: + if self.MIN_CHECK_INTERVAL <= interval != self.interval: self.core.scheduler.removeJob(self.cb) self.interval = interval self.initPeriodical() @@ -37,8 +37,8 @@ class RestartFailed(Hook): def setup(self): - self.interval = self.MIN_INTERVAL + self.interval = self.MIN_CHECK_INTERVAL def coreReady(self): - self.pluginConfigChanged(self.__name__, "interval", self.getConfig("interval")) + self.pluginConfigChanged(self.__name__, "interval", self.getConfig('interval')) diff --git a/module/plugins/hooks/RestartSlow.py b/module/plugins/hooks/RestartSlow.py index c3e1e5468..834128489 100644 --- a/module/plugins/hooks/RestartSlow.py +++ b/module/plugins/hooks/RestartSlow.py @@ -36,7 +36,7 @@ class RestartSlow(Hook): if not self.pyfile.plugin.req.dl: return - if self.getConfig("safe_mode") and not self.pyfile.plugin.resumeDownload: + if self.getConfig('safe_mode') and not self.pyfile.plugin.resumeDownload: time = 30 limit = 5 else: @@ -55,7 +55,7 @@ class RestartSlow(Hook): def downloadStarts(self, pyfile, url, filename): - if self.cb or (self.getConfig("safe_mode") and not pyfile.plugin.resumeDownload): + 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/SkipRev.py b/module/plugins/hooks/SkipRev.py index 521c2c39e..88ffb0103 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -11,16 +11,10 @@ from module.plugins.Hook import Hook from module.plugins.Plugin import SkipDownload -def _setup(self): - self.pyfile.plugin._setup() - if self.pyfile.hasStatus("skipped"): - raise SkipDownload(self.pyfile.statusname or self.pyfile.pluginname) - - class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.28" + __version__ = "0.29" __config__ = [("mode" , "Auto;Manual", "Choose rev files to skip for package", "Auto"), ("revtokeep", "int" , "Number of rev files to keep" , 0 )] @@ -35,6 +29,13 @@ class SkipRev(Hook): pass + @staticmethod + def _setup(self): + self.pyfile.plugin._setup() + if self.pyfile.hasStatus("skipped"): + raise SkipDownload(self.pyfile.statusname or self.pyfile.pluginname) + + def _name(self, pyfile): if hasattr(pyfile.pluginmodule, "getInfo"): #@NOTE: getInfo is deprecated in 0.4.10 return pyfile.pluginmodule.getInfo([pyfile.url]).next()[0] @@ -59,7 +60,7 @@ class SkipRev(Hook): def downloadPreparing(self, pyfile): name = self._name(pyfile) - if pyfile.statusname is "unskipped" or not name.endswith(".rev") or not ".part" in name: + if pyfile.statusname is _("unskipped") or not name.endswith(".rev") or not ".part" in name: return revtokeep = -1 if self.getConfig('mode') == "Auto" else self.getConfig('revtokeep') @@ -77,8 +78,9 @@ class SkipRev(Hook): pyfile.setCustomStatus("SkipRev", "skipped") if not hasattr(pyfile.plugin, "_setup"): + # Work-around: inject status checker inside the preprocessing routine of the plugin pyfile.plugin._setup = pyfile.plugin.setup - pyfile.plugin.setup = MethodType(_setup, pyfile.plugin) #: work-around: inject status checker inside the preprocessing routine of the plugin + pyfile.plugin.setup = MethodType(self._setup, pyfile.plugin) def downloadFailed(self, pyfile): @@ -101,7 +103,7 @@ class SkipRev(Hook): if revtokeep > -1 or pyfile.name.endswith(".rev"): pylink.setStatus("queued") else: - pylink.setCustomStatus("unskipped", "queued") + pylink.setCustomStatus(_("unskipped"), "queued") self.core.files.save() pylink.release() diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 1becb937a..7a5ae8e09 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -43,7 +43,7 @@ class UnSkipOnFail(Hook): # the core.files-manager to save its data. pylink = _pyfile(link) - pylink.setCustomStatus("UnSkipOnFail", "queued") + pylink.setCustomStatus(_("unskipped"), "queued") self.core.files.save() pylink.release() diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index a0b044edb..45d666f45 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -46,13 +46,13 @@ class UpdateManager(Hook): SERVER_URL = "http://updatemanager.pyload.org" VERSION = re.compile(r'__version__.*=.*("|\')([\d.]+)') - MIN_INTERVAL = 3 * 60 * 60 #: 3h minimum check interval (value is in seconds) + MIN_CHECK_INTERVAL = 3 * 60 * 60 #: 3 hours def pluginConfigChanged(self, plugin, name, value): if name == "interval": interval = value * 60 * 60 - if self.MIN_INTERVAL <= interval != self.interval: + if self.MIN_CHECK_INTERVAL <= interval != self.interval: self.core.scheduler.removeJob(self.cb) self.interval = interval self.initPeriodical() @@ -67,8 +67,8 @@ class UpdateManager(Hook): def coreReady(self): - self.pluginConfigChanged(self.__name__, "interval", self.getConfig("interval")) - x = lambda: self.pluginConfigChanged(self.__name__, "reloadplugins", self.getConfig("reloadplugins")) + self.pluginConfigChanged(self.__name__, "interval", self.getConfig('interval')) + x = lambda: self.pluginConfigChanged(self.__name__, "reloadplugins", self.getConfig('reloadplugins')) self.core.scheduler.addJob(10, x, threaded=False) @@ -78,7 +78,7 @@ class UpdateManager(Hook): def setup(self): self.cb2 = None - self.interval = self.MIN_INTERVAL + self.interval = self.MIN_CHECK_INTERVAL self.updating = False self.info = {'pyload': False, 'version': None, 'plugins': False} self.mtimes = {} #: store modification time for each plugin @@ -122,7 +122,7 @@ class UpdateManager(Hook): def periodical(self): - if not self.info['pyload'] and not (self.getConfig("nodebugupdate") and self.core.debug): + if not self.info['pyload'] and not (self.getConfig('nodebugupdate') and self.core.debug): self.updateThread() @@ -138,9 +138,9 @@ class UpdateManager(Hook): def updateThread(self): self.updating = True - status = self.update(onlyplugin=self.getConfig("mode") == "plugins only") + status = self.update(onlyplugin=self.getConfig('mode') == "plugins only") - if status is 2 and self.getConfig("autorestart"): + if status is 2 and self.getConfig('autorestart'): self.core.api.restart() else: self.updating = False diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index 010198bf1..a1068ead5 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -41,19 +41,19 @@ class WindowsPhoneNotify(Hook): def newCaptchaTask(self, task): - if not self.getConfig("notifycaptcha"): + if not self.getConfig('notifycaptcha'): return self.notify(_("Captcha"), _("New request waiting user input")) def packageFinished(self, pypack): - if self.getConfig("notifypackage"): + if self.getConfig('notifypackage'): self.notify(_("Package finished"), pypack.name) def allDownloadsProcessed(self): - if not self.getConfig("notifyprocessed"): + if not self.getConfig('notifyprocessed'): return if any(True for pdata in self.core.api.getQueue() if pdata.linksdone < pdata.linkstotal): @@ -69,14 +69,17 @@ class WindowsPhoneNotify(Hook): @Expose - def notify(self, event, msg=""): - id = self.getConfig("id") - url = self.getConfig("url") + def notify(self, + event, + msg="", + key=(self.getConfig('id'), self.getConfig('url'))): + + id, url = key if not id or not url: return - if self.core.isClientConnected() and not self.getConfig("ignoreclient"): + if self.core.isClientConnected() and not self.getConfig('ignoreclient'): return elapsed_time = time.time() - self.last_notify diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 495140652..d9552051e 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.32" + __version__ = "0.33" __config__ = [("activated" , "bool", "Activated" , True ), ("use_hoster_list" , "bool", "Load listed hosters only" , False), @@ -23,15 +23,15 @@ class XFileSharingPro(Hook): # event_list = ["pluginConfigChanged"] - regexp = {'hoster' : (r'https?://(?:www\.)?(?P<DOMAIN>[\w.^_]+(?:\.[a-zA-Z]{2,})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)', + regexp = {'hoster' : (r'https?://(?:www\.)?(?P<DOMAIN>[\w\-.^_]{3,63}(?:\.[a-zA-Z]{2,})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)', r'https?://(?:[^/]+\.)?(?P<DOMAIN>%s)/(?:embed-)?\w+'), - 'crypter': (r'https?://(?:www\.)?(?P<DOMAIN>[\w.^_]+(?:\.[a-zA-Z]{2,})(?:\:\d+)?)/(?:user|folder)s?/\w+', + 'crypter': (r'https?://(?:www\.)?(?P<DOMAIN>[\w\-.^_]{3,63}(?:\.[a-zA-Z]{2,})(?:\:\d+)?)/(?:user|folder)s?/\w+', r'https?://(?:[^/]+\.)?(?P<DOMAIN>%s)/(?:user|folder)s?/\w+')} HOSTER_BUILTIN = [#WORKING HOSTERS: - "backin.net", "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", - "fileparadox.in", "filevice.com", "hostingbulk.com", "junkyvideo.com", "linestorage.com", "ravishare.com", - "ryushare.com", "salefiles.com", "sendmyway.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + "backin.net", "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "fileparadox.in", + "filevice.com", "hostingbulk.com", "junkyvideo.com", "linestorage.com", "ravishare.com", "ryushare.com", + "salefiles.com", "sendmyway.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", #NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", @@ -126,7 +126,7 @@ class XFileSharingPro(Hook): # def downloadFailed(self, pyfile): # if pyfile.pluginname == "BasePlugin" \ # and pyfile.hasStatus("failed") \ - # and not self.getConfig("use_hoster_list") \ + # and not self.getConfig('use_hoster_list') \ # and self.unloadHoster("BasePlugin"): # self.logDebug("Unloaded XFileSharingPro from BasePlugin") # pyfile.setStatus("queued") diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index b8e9fc1ad..b61428392 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -33,14 +33,14 @@ class XMPPInterface(IRCInterface, JabberClient): def __init__(self, core, manager): IRCInterface.__init__(self, core, manager) - self.jid = JID(self.getConfig("jid")) - password = self.getConfig("pw") + self.jid = JID(self.getConfig('jid')) + password = self.getConfig('pw') # if bare JID is provided add a resource -- it is required if not self.jid.resource: self.jid = JID(self.jid.node, self.jid.domain, "pyLoad") - if self.getConfig("tls"): + if self.getConfig('tls'): tls_settings = streamtls.TLSSettings(require=True, verify_peer=False) auth = ("sasl:PLAIN", "sasl:DIGEST-MD5") else: @@ -67,7 +67,7 @@ class XMPPInterface(IRCInterface, JabberClient): def packageFinished(self, pypack): try: - if self.getConfig("info_pack"): + if self.getConfig('info_pack'): self.announce(_("Package finished: %s") % pypack.name) except Exception: pass @@ -75,7 +75,7 @@ class XMPPInterface(IRCInterface, JabberClient): def downloadFinished(self, pyfile): try: - if self.getConfig("info_file"): + if self.getConfig('info_file'): self.announce( _("Download finished: %(name)s @ %(plugin)s") % {"name": pyfile.name, "plugin": pyfile.pluginname}) except Exception: @@ -139,7 +139,7 @@ class XMPPInterface(IRCInterface, JabberClient): to_name = to_jid.as_utf8() from_name = from_jid.as_utf8() - names = self.getConfig("owners").split(";") + names = self.getConfig('owners').split(";") if to_name in names or to_jid.node + "@" + to_jid.domain in names: messages = [] @@ -182,7 +182,7 @@ class XMPPInterface(IRCInterface, JabberClient): def announce(self, message): """ send message to all owners""" - for user in self.getConfig("owners").split(";"): + for user in self.getConfig('owners').split(";"): self.logDebug("Send message to", user) to_jid = JID(user) diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py index 427eb42f0..90590adac 100644 --- a/module/plugins/hoster/AlldebridCom.py +++ b/module/plugins/hoster/AlldebridCom.py @@ -58,7 +58,7 @@ class AlldebridCom(MultiHoster): pyfile.size = parseFileSize(data['filesize']) self.link = data['link'] - if self.getConfig("ssl"): + if self.getConfig('ssl'): self.link = self.link.replace("http://", "https://") else: self.link = self.link.replace("https://", "http://") diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index 657e70e56..3bcc76146 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -80,7 +80,7 @@ class BitshareCom(SimpleHoster): def getDownloadUrl(self): # Return location if direct download is active if self.premium: - header = self.load(self.pyfile.url, cookies=True, just_header=True) + header = self.load(self.pyfile.url, just_header=True) if 'location' in header: return header['location'] diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index 49c7a6648..d055f49ba 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -43,7 +43,7 @@ class CzshareCom(SimpleHoster): m = re.search(self.USER_CREDIT_PATTERN, self.html) if m is None: self.account.relogin(self.user) - self.html = self.load(self.pyfile.url, cookies=True, decode=True) + self.html = self.load(self.pyfile.url, decode=True) m = re.search(self.USER_CREDIT_PATTERN, self.html) if m is None: return False @@ -87,7 +87,7 @@ class CzshareCom(SimpleHoster): self.logDebug("PARSED_URL:" + parsed_url) # get download ticket and parse html - self.html = self.load(parsed_url, cookies=True, decode=True) + self.html = self.load(parsed_url, decode=True) if re.search(self.MULTIDL_PATTERN, self.html): self.longWait(5 * 60, 12) @@ -104,7 +104,7 @@ class CzshareCom(SimpleHoster): captcha_url = 'http://sdilej.cz/captcha.php' for _i in xrange(5): inputs['captchastring2'] = self.decryptCaptcha(captcha_url) - self.html = self.load(parsed_url, cookies=True, post=inputs, decode=True) + self.html = self.load(parsed_url, post=inputs, decode=True) if u"<li>Zadaný ověřovací kód nesouhlasí!</li>" in self.html: self.invalidCaptcha() diff --git a/module/plugins/hoster/DailymotionCom.py b/module/plugins/hoster/DailymotionCom.py index 02df9dde7..c6939e5e5 100644 --- a/module/plugins/hoster/DailymotionCom.py +++ b/module/plugins/hoster/DailymotionCom.py @@ -72,7 +72,7 @@ class DailymotionCom(Hoster): def getQuality(self): - q = self.getConfig("quality") + q = self.getConfig('quality') if q == "Lowest": quality = 0 diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index 7e6130739..ac669ab1b 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -108,7 +108,7 @@ class FileSharkPl(SimpleHoster): self.load = tmp_load - self.download(link, post=inputs, cookies=True, disposition=True) + self.download(link, post=inputs, disposition=True) def checkFile(self): diff --git a/module/plugins/hoster/FlyFilesNet.py b/module/plugins/hoster/FlyFilesNet.py index 49705958d..636e02acf 100644 --- a/module/plugins/hoster/FlyFilesNet.py +++ b/module/plugins/hoster/FlyFilesNet.py @@ -32,7 +32,7 @@ class FlyFilesNet(SimpleHoster): url = "http://flyfiles.net" # get download URL - parsed_url = getURL(url, post={"getDownLink": session}, cookies=True) + parsed_url = getURL(url, post={"getDownLink": session}) self.logDebug("Parsed URL: %s" % parsed_url) if parsed_url == '#downlink|' or parsed_url == "#downlink|#": diff --git a/module/plugins/hoster/GooIm.py b/module/plugins/hoster/GooIm.py index 2cb012e50..1e1ffbc08 100644 --- a/module/plugins/hoster/GooIm.py +++ b/module/plugins/hoster/GooIm.py @@ -31,7 +31,7 @@ class GooIm(SimpleHoster): def handleFree(self, pyfile): self.wait(10) - self.download(pyfile.url, cookies=True) + self.download(pyfile.url) getInfo = create_getInfo(GooIm) diff --git a/module/plugins/hoster/IfolderRu.py b/module/plugins/hoster/IfolderRu.py index 249c2feb1..04c08ef0a 100644 --- a/module/plugins/hoster/IfolderRu.py +++ b/module/plugins/hoster/IfolderRu.py @@ -38,23 +38,23 @@ class IfolderRu(SimpleHoster): def handleFree(self, pyfile): - self.html = self.load("http://rusfolder.com/%s" % self.info['pattern']['ID'], cookies=True, decode=True) + self.html = self.load("http://rusfolder.com/%s" % self.info['pattern']['ID'], decode=True) self.getFileInfo() url = re.search(r"location\.href = '(http://ints\..*?=)'", self.html).group(1) - self.html = self.load(url, cookies=True, decode=True) + self.html = self.load(url, decode=True) url, session_id = re.search(self.SESSION_ID_PATTERN, self.html).groups() - self.html = self.load(url, cookies=True, decode=True) + self.html = self.load(url, decode=True) url = "http://ints.rusfolder.com/ints/frame/?session=%s" % session_id - self.html = self.load(url, cookies=True) + self.html = self.load(url) self.wait(31, False) captcha_url = "http://ints.rusfolder.com/random/images/?session=%s" % session_id for _i in xrange(5): - self.html = self.load(url, cookies=True) + self.html = self.load(url) action, inputs = self.parseHtmlForm('ID="Form1"') inputs['ints_session'] = re.search(self.INTS_SESSION_PATTERN, self.html).group(1) inputs[re.search(self.HIDDEN_INPUT_PATTERN, self.html).group(1)] = '1' @@ -62,7 +62,7 @@ class IfolderRu(SimpleHoster): inputs['action'] = '1' self.logDebug(inputs) - self.html = self.load(url, decode=True, cookies=True, post=inputs) + self.html = self.load(url, decode=True, post=inputs) if self.WRONG_CAPTCHA_PATTERN in self.html: self.invalidCaptcha() else: diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index 2d1c3b096..0030513cf 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -43,7 +43,7 @@ class KingfilesNet(SimpleHoster): 'referer' : "", 'method_free': "+"} - self.html = self.load(pyfile.url, post=post_data, cookies=True, decode=True) + self.html = self.load(pyfile.url, post=post_data, decode=True) solvemedia = SolveMedia(self) response, challenge = solvemedia.challenge() @@ -66,7 +66,7 @@ class KingfilesNet(SimpleHoster): 'adcopy_challenge': challenge, 'down_direct' : "1"} - self.html = self.load(pyfile.url, post=post_data, cookies=True, decode=True) + self.html = self.load(pyfile.url, post=post_data, decode=True) m = re.search(self.LINK_FREE_PATTERN, self.html) if m is None: diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py index 2c725427d..273cea871 100644 --- a/module/plugins/hoster/LetitbitNet.py +++ b/module/plugins/hoster/LetitbitNet.py @@ -75,7 +75,7 @@ class LetitbitNet(SimpleHoster): self.logDebug(action, inputs) inputs['desc'] = "" - self.html = self.load(urljoin("http://letitbit.net/", action), post=inputs, cookies=True) + self.html = self.load(urljoin("http://letitbit.net/", action), post=inputs) m = re.search(self.SECONDS_PATTERN, self.html) seconds = int(m.group(1)) if m else 60 @@ -89,7 +89,7 @@ class LetitbitNet(SimpleHoster): self.wait(seconds) - res = self.load("http://letitbit.net/ajax/download3.php", post=" ", cookies=True) + res = self.load("http://letitbit.net/ajax/download3.php", post=" ") if res != '1': self.error(_("Unknown response - ajax_check_url")) @@ -104,7 +104,7 @@ class LetitbitNet(SimpleHoster): self.logDebug("Post data to send", post_data) - res = self.load("http://letitbit.net/ajax/check_recaptcha.php", post=post_data, cookies=True) + res = self.load("http://letitbit.net/ajax/check_recaptcha.php", post=post_data) self.logDebug(res) diff --git a/module/plugins/hoster/MegaDebridEu.py b/module/plugins/hoster/MegaDebridEu.py index b42362800..fa66e74e6 100644 --- a/module/plugins/hoster/MegaDebridEu.py +++ b/module/plugins/hoster/MegaDebridEu.py @@ -79,7 +79,7 @@ class MegaDebridEu(MultiHoster): exit the plugin on fail case And display the reason of this failure """ - if self.getConfig("unloadFailing"): + if self.getConfig('unloadFailing'): self.logError(_(msg)) self.resetAccount() else: diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 3efbdce23..16728ad43 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -172,7 +172,7 @@ class NetloadIn(Hoster): self.url = self.get_file_url(page) - def check_free_wait(self,page): + def check_free_wait(self, page): if ">An access request has been made from IP address <" in page: self.wantReconnect = True self.setWait(self.get_wait_time(page) or 30) diff --git a/module/plugins/hoster/NosuploadCom.py b/module/plugins/hoster/NosuploadCom.py index aeedd54f6..241ee3a29 100644 --- a/module/plugins/hoster/NosuploadCom.py +++ b/module/plugins/hoster/NosuploadCom.py @@ -26,14 +26,14 @@ class NosuploadCom(XFSHoster): def getDownloadLink(self): # stage1: press the "Free Download" button data = self.getPostParameters() - self.html = self.load(self.pyfile.url, post=data, ref=True, decode=True) + self.html = self.load(self.pyfile.url, post=data, decode=True) # stage2: wait some time and press the "Download File" button data = self.getPostParameters() wait_time = re.search(self.WAIT_PATTERN, self.html, re.M | re.S).group(1) self.logDebug("Hoster told us to wait %s seconds" % wait_time) self.wait(wait_time) - self.html = self.load(self.pyfile.url, post=data, ref=True, decode=True) + self.html = self.load(self.pyfile.url, post=data, decode=True) # stage3: get the download link return re.search(self.LINK_PATTERN, self.html, re.S).group(1) diff --git a/module/plugins/hoster/OverLoadMe.py b/module/plugins/hoster/OverLoadMe.py index 67563ca3d..e92d927f3 100644 --- a/module/plugins/hoster/OverLoadMe.py +++ b/module/plugins/hoster/OverLoadMe.py @@ -39,7 +39,7 @@ class OverLoadMe(MultiHoster): def handlePremium(self, pyfile): - https = "https" if self.getConfig("ssl") else "http" + https = "https" if self.getConfig('ssl') else "http" data = self.account.getAccountData(self.user) page = self.load(https + "://api.over-load.me/getdownload.php", get={'auth': data['password'], @@ -58,7 +58,7 @@ class OverLoadMe(MultiHoster): pyfile.size = parseFileSize(data['filesize']) http_repl = ["http://", "https://"] - self.link = data['downloadlink'].replace(*http_repl if self.getConfig("ssl") else *http_repl[::-1]) + self.link = data['downloadlink'].replace(*http_repl if self.getConfig('ssl') else *http_repl[::-1]) if pyfile.name.startswith("http") or pyfile.name.startswith("Unknown") or pyfile.name.endswith('..'): # only use when name wasn't already set diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py index d0010b3bd..14c46f522 100644 --- a/module/plugins/hoster/RealdebridCom.py +++ b/module/plugins/hoster/RealdebridCom.py @@ -58,7 +58,7 @@ class RealdebridCom(MultiHoster): pyfile.size = parseFileSize(data['file_size']) self.link = data['generated_links'][0][-1] - if self.getConfig("ssl"): + if self.getConfig('ssl'): self.link = self.link.replace("http://", "https://") else: self.link = self.link.replace("https://", "http://") diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index 3552942ff..035562962 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -46,7 +46,7 @@ class UlozTo(SimpleHoster): def process(self, pyfile): pyfile.url = re.sub(r"(?<=http://)([^/]+)", "www.ulozto.net", pyfile.url) - self.html = self.load(pyfile.url, decode=True, cookies=True) + self.html = self.load(pyfile.url, decode=True) if re.search(self.ADULT_PATTERN, self.html): self.logInfo(_("Adult content confirmation needed")) @@ -57,7 +57,7 @@ class UlozTo(SimpleHoster): token = m.group(1) self.html = self.load(pyfile.url, get={'do': "askAgeForm-submit"}, - post={"agree": "Confirm", "_token_": token}, cookies=True) + post={"agree": "Confirm", "_token_": token}) if self.PASSWD_PATTERN in self.html: password = self.getPassword() @@ -65,7 +65,7 @@ class UlozTo(SimpleHoster): if password: self.logInfo(_("Password protected link, trying ") + password) self.html = self.load(pyfile.url, get={'do': "passwordProtectedForm-submit"}, - post={"password": password, "password_send": 'Send'}, cookies=True) + post={"password": password, "password_send": 'Send'}) if self.PASSWD_PATTERN in self.html: self.fail(_("Incorrect password")) @@ -117,7 +117,7 @@ class UlozTo(SimpleHoster): self.error(_("CAPTCHA form changed")) self.multiDL = True - self.download("http://www.ulozto.net" + action, post=inputs, cookies=True, disposition=True) + self.download("http://www.ulozto.net" + action, post=inputs, disposition=True) def handlePremium(self, pyfile): diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py index 99fe01257..0a5c2081f 100644 --- a/module/plugins/hoster/UnrestrictLi.py +++ b/module/plugins/hoster/UnrestrictLi.py @@ -70,7 +70,7 @@ class UnrestrictLi(MultiHoster): def checkFile(self): super(UnrestrictLi, self).checkFile() - if self.getConfig("history"): + if self.getConfig('history'): self.load("https://unrestrict.li/history/", get={'delete': "all"}) self.logInfo(_("Download history deleted")) diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py index 11cf3d321..d09b99d92 100644 --- a/module/plugins/hoster/UploadableCh.py +++ b/module/plugins/hoster/UploadableCh.py @@ -35,13 +35,13 @@ class UploadableCh(SimpleHoster): def handleFree(self, pyfile): # Click the "free user" button and wait - a = self.load(pyfile.url, cookies=True, post={'downloadLink': "wait"}, decode=True) + a = self.load(pyfile.url, post={'downloadLink': "wait"}, decode=True) self.logDebug(a) self.wait(30) # Make the recaptcha appear and show it the pyload interface - b = self.load(pyfile.url, cookies=True, post={'checkDownload': "check"}, decode=True) + b = self.load(pyfile.url, post={'checkDownload': "check"}, decode=True) self.logDebug(b) #: Expected output: {"success":"showCaptcha"} recaptcha = ReCaptcha(self) @@ -50,7 +50,6 @@ class UploadableCh(SimpleHoster): # Submit the captcha solution self.load("http://www.uploadable.ch/checkReCaptcha.php", - cookies=True, post={'recaptcha_challenge_field' : challenge, 'recaptcha_response_field' : response, 'recaptcha_shortencode_field': self.info['pattern']['ID']}, @@ -59,12 +58,12 @@ class UploadableCh(SimpleHoster): self.wait(3) # Get ready for downloading - self.load(pyfile.url, cookies=True, post={'downloadLink': "show"}, decode=True) + self.load(pyfile.url, post={'downloadLink': "show"}, decode=True) self.wait(3) # Download the file - self.download(pyfile.url, cookies=True, post={'download': "normal"}, disposition=True) + self.download(pyfile.url, post={'download': "normal"}, disposition=True) def checkFile(self): diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index 219efa8e1..567f8e867 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -33,7 +33,7 @@ class VeohCom(SimpleHoster): def handleFree(self, pyfile): - quality = self.getConfig("quality") + quality = self.getConfig('quality') if quality == "Auto": quality = ("High", "Low") diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index d427c1511..e47751c65 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -46,14 +46,14 @@ class VimeoCom(SimpleHoster): link = dict((l.group('QL').lower(), l.group('URL')) for l in re.finditer(pattern, html)) - if self.getConfig("original"): + if self.getConfig('original'): if "original" in link: self.download(link[q]) return else: self.logInfo(_("Original file not downloadable")) - quality = self.getConfig("quality") + quality = self.getConfig('quality') if quality == "Highest": qlevel = ("hd", "sd", "mobile") elif quality == "Lowest": diff --git a/module/plugins/hoster/XHamsterCom.py b/module/plugins/hoster/XHamsterCom.py index c6e789fa8..d68f46283 100644 --- a/module/plugins/hoster/XHamsterCom.py +++ b/module/plugins/hoster/XHamsterCom.py @@ -35,8 +35,8 @@ class XHamsterCom(Hoster): if not self.file_exists(): self.offline() - if self.getConfig("type"): - self.desired_fmt = self.getConfig("type") + if self.getConfig('type'): + self.desired_fmt = self.getConfig('type') pyfile.name = self.get_file_name() + self.desired_fmt self.download(self.get_file_url()) diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index d00bf2a0e..4fccbba65 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -95,7 +95,7 @@ class YoutubeCom(Hoster): self.tempOffline() #get config - use3d = self.getConfig("3d") + use3d = self.getConfig('3d') if use3d: quality = {"sd": 82, "hd": 84, "fullhd": 85, "240p": 83, "360p": 82, @@ -104,10 +104,10 @@ class YoutubeCom(Hoster): quality = {"sd": 18, "hd": 22, "fullhd": 37, "240p": 5, "360p": 18, "480p": 35, "720p": 22, "1080p": 37, "3072p": 38} - desired_fmt = self.getConfig("fmt") + desired_fmt = self.getConfig('fmt') if not desired_fmt: - desired_fmt = quality.get(self.getConfig("quality"), 18) + desired_fmt = quality.get(self.getConfig('quality'), 18) elif desired_fmt not in self.formats: self.logWarning(_("FMT %d unknown, using default") % desired_fmt) diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index 4b21cc49c..79864818e 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -23,9 +23,9 @@ class Extractor: __description__ = """Base extractor plugin""" __license__ = "GPLv3" - __authors__ = [("RaNaN", "ranan@pyload.org"), + __authors__ = [("RaNaN" , "ranan@pyload.org" ), ("Walter Purcaro", "vuolter@gmail.com"), - ("Immenz", "immenz@gmx.net")] + ("Immenz" , "immenz@gmx.net" )] EXTENSIONS = [] @@ -40,7 +40,7 @@ class Extractor: @classmethod - def isMultipart(cls,filename): + def isMultipart(cls, filename): return False diff --git a/module/plugins/internal/SevenZip.py b/module/plugins/internal/SevenZip.py index 82901f8cc..482b1802c 100644 --- a/module/plugins/internal/SevenZip.py +++ b/module/plugins/internal/SevenZip.py @@ -14,7 +14,7 @@ class SevenZip(UnRar): __description__ = """7-Zip extractor plugin""" __license__ = "GPLv3" - __authors__ = [("Michael Nowak", ""), + __authors__ = [("Michael Nowak" , "" ), ("Walter Purcaro", "vuolter@gmail.com")] @@ -41,7 +41,7 @@ class SevenZip(UnRar): if os.name == "nt": cls.CMD = os.path.join(pypath, "7z.exe") p = subprocess.Popen([cls.CMD], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out,err = p.communicate() + out, err = p.communicate() else: p = subprocess.Popen([cls.CMD], stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index 856b548f0..696cc0848 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -20,9 +20,9 @@ class SimpleCrypter(Crypter, SimpleHoster): __description__ = """Simple decrypter plugin""" __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it"), - ("zoidberg", "zoidberg@mujmail.cz"), - ("Walter Purcaro", "vuolter@gmail.com")] + __authors__ = [("stickell" , "l.stickell@yahoo.it"), + ("zoidberg" , "zoidberg@mujmail.cz"), + ("Walter Purcaro", "vuolter@gmail.com" )] """ diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 0adfc64b3..df6e78485 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -153,11 +153,11 @@ def getFileURL(self, url, follow_location=None): for i in xrange(redirect): try: self.logDebug("Redirect #%d to: %s" % (i, url)) - header = self.load(url, ref=True, cookies=True, just_header=True, decode=True) + header = self.load(url, just_header=True, decode=True) except Exception: #: Bad bad bad... req = pyreq.getHTTPRequest() - res = req.load(url, cookies=True, just_header=True, decode=True) + res = req.load(url, just_header=True, decode=True) req.close() @@ -252,9 +252,9 @@ class SimpleHoster(Hoster): __description__ = """Simple hoster plugin""" __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it"), - ("Walter Purcaro", "vuolter@gmail.com")] + __authors__ = [("zoidberg" , "zoidberg@mujmail.cz"), + ("stickell" , "l.stickell@yahoo.it"), + ("Walter Purcaro", "vuolter@gmail.com" )] """ diff --git a/module/plugins/internal/UnRar.py b/module/plugins/internal/UnRar.py index 45e1640bf..2ba6ff90d 100644 --- a/module/plugins/internal/UnRar.py +++ b/module/plugins/internal/UnRar.py @@ -26,9 +26,9 @@ class UnRar(Extractor): __description__ = """Rar extractor plugin""" __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org"), + __authors__ = [("RaNaN" , "RaNaN@pyload.org" ), ("Walter Purcaro", "vuolter@gmail.com"), - ("Immenz", "immenz@gmx.net"),] + ("Immenz" , "immenz@gmx.net" )] CMD = "unrar" @@ -79,7 +79,7 @@ class UnRar(Extractor): @classmethod - def isMultipart(cls,filename): + def isMultipart(cls, filename): multipart = cls.re_multipart.search(filename) if multipart: # First Multipart file (part1.rar for *.part1-9.rar format or *.rar for .r1-9 format) handled as normal Archive diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index 845ea3230..9315fb68f 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -16,8 +16,8 @@ class XFSAccount(Account): __description__ = """XFileSharing account plugin""" __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("Walter Purcaro", "vuolter@gmail.com")] + __authors__ = [("zoidberg" , "zoidberg@mujmail.cz"), + ("Walter Purcaro", "vuolter@gmail.com" )] HOSTER_DOMAIN = None diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py index c4fc969ba..e0c6d8824 100644 --- a/module/plugins/internal/XFSHoster.py +++ b/module/plugins/internal/XFSHoster.py @@ -22,9 +22,9 @@ class XFSHoster(SimpleHoster): __description__ = """XFileSharing hoster plugin""" __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it"), - ("Walter Purcaro", "vuolter@gmail.com")] + __authors__ = [("zoidberg" , "zoidberg@mujmail.cz"), + ("stickell" , "l.stickell@yahoo.it"), + ("Walter Purcaro", "vuolter@gmail.com" )] HOSTER_DOMAIN = None @@ -103,7 +103,7 @@ class XFSHoster(SimpleHoster): self.req.http.c.setopt(FOLLOWLOCATION, 0) - self.html = self.load(pyfile.url, post=data, ref=True, decode=True) + self.html = self.load(pyfile.url, post=data, decode=True) self.req.http.c.setopt(FOLLOWLOCATION, 1) |