diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-03-10 01:55:52 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-03-10 01:55:52 +0100 |
commit | 7beb65e991bc6d1913c3b5bb2ef69e659d5b8342 (patch) | |
tree | e076082f6cb799a820eee287c47f24f082b3a41c /module/plugins/hoster | |
parent | [DDLMusicOrg] Removed (diff) | |
download | pyload-7beb65e991bc6d1913c3b5bb2ef69e659d5b8342.tar.xz |
Spare code cosmetics
Diffstat (limited to 'module/plugins/hoster')
22 files changed, 44 insertions, 45 deletions
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) |