diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-10-25 02:53:05 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-10-25 02:53:05 +0200 |
commit | e3f5280529921100f48bb8a79853bf480c7611e4 (patch) | |
tree | f1005d656b123b1b7c5ffb9e4ef1e39c7fa4460e /module/plugins/hoster | |
parent | Spare code cosmetics (diff) | |
download | pyload-e3f5280529921100f48bb8a79853bf480c7611e4.tar.xz |
Replace single quotes with doubles in self.error and self.fail msg
Diffstat (limited to 'module/plugins/hoster')
30 files changed, 49 insertions, 49 deletions
diff --git a/module/plugins/hoster/BayfilesCom.py b/module/plugins/hoster/BayfilesCom.py index 8622f4dca..69aab78ef 100644 --- a/module/plugins/hoster/BayfilesCom.py +++ b/module/plugins/hoster/BayfilesCom.py @@ -39,7 +39,7 @@ class BayfilesCom(SimpleHoster): # Get download token m = re.search(self.VARS_PATTERN, self.html) if m is None: - self.error('VARS') + self.error("VARS") vfid, delay = m.groups() response = json_loads(self.load('http://bayfiles.com/ajax_download', get={ @@ -48,7 +48,7 @@ class BayfilesCom(SimpleHoster): "vfid": vfid}, decode=True)) if not "token" in response or not response['token']: - self.fail('No token') + self.fail("No token") self.wait(int(delay)) diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py index 8fac72ef2..ae1825c9f 100644 --- a/module/plugins/hoster/CrockoCom.py +++ b/module/plugins/hoster/CrockoCom.py @@ -45,7 +45,7 @@ class CrockoCom(SimpleHoster): m = re.search(self.FORM_PATTERN, self.html, re.S) if m is None: - self.error('ACTION') + self.error("ACTION") action, form = m.groups() inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form)) @@ -64,7 +64,7 @@ class CrockoCom(SimpleHoster): else: break else: - self.fail('No valid captcha solution received') + self.fail("No valid captcha solution received") getInfo = create_getInfo(CrockoCom) diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index be1c3ab97..5c31958d7 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -81,7 +81,7 @@ class CzshareCom(SimpleHoster): # get free url m = re.search(self.FREE_URL_PATTERN, self.html) if m is None: - self.error('Free URL') + self.error("Free URL") parsed_url = "http://sdilej.cz" + m.group(1) self.logDebug("PARSED_URL:" + parsed_url) @@ -96,7 +96,7 @@ class CzshareCom(SimpleHoster): self.pyfile.size = int(inputs['size']) except Exception, e: self.logError(e) - self.error('Form') + self.error("Form") # get and decrypt captcha captcha_url = 'http://sdilej.cz/captcha.php' @@ -120,7 +120,7 @@ class CzshareCom(SimpleHoster): self.logDebug("WAIT URL", self.req.lastEffectiveURL) m = re.search("free_wait.php\?server=(.*?)&(.*)", self.req.lastEffectiveURL) if m is None: - self.error('Download URL') + self.error("Download URL") url = "http://%s/download.php?%s" % (m.group(1), m.group(2)) diff --git a/module/plugins/hoster/DataHu.py b/module/plugins/hoster/DataHu.py index d76444d32..a15e1df39 100644 --- a/module/plugins/hoster/DataHu.py +++ b/module/plugins/hoster/DataHu.py @@ -37,7 +37,7 @@ class DataHu(SimpleHoster): url = m.group(1) self.logDebug("Direct link: " + url) else: - self.error('Unable to get direct link') + self.error("Unable to get direct link") self.download(url, disposition=True) diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py index 6fcbfc2ad..e4dfb0ad1 100644 --- a/module/plugins/hoster/DataportCz.py +++ b/module/plugins/hoster/DataportCz.py @@ -32,19 +32,19 @@ class DataportCz(SimpleHoster): action, inputs = self.parseHtmlForm('free_download_form') self.logDebug(action, inputs) if not action or not inputs: - self.error('free_download_form') + self.error("free_download_form") if "captchaId" in inputs and inputs['captchaId'] in captchas: inputs['captchaCode'] = captchas[inputs['captchaId']] else: - self.error('captcha') + self.error("captcha") self.html = self.download("http://www.dataport.cz%s" % action, post=inputs) check = self.checkDownload({"captcha": 'alert("\u0160patn\u011b opsan\u00fd k\u00f3d z obr\u00e1zu");', "slot": 'alert("Je n\u00e1m l\u00edto, ale moment\u00e1ln\u011b nejsou'}) if check == "captcha": - self.error('invalid captcha') + self.error("invalid captcha") elif check == "slot": self.logDebug("No free slots - wait 60s and retry") self.wait(60, False) diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 1a2e78ef3..5440927e1 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -46,14 +46,14 @@ class DateiTo(SimpleHoster): m = re.search(self.DATA_PATTERN, self.html) if m is None: - self.error('data') + self.error("data") url = 'http://datei.to/' + m.group(1) data = dict(x.split('=') for x in m.group(2).split('&')) if url.endswith('recaptcha.php'): data['recaptcha_challenge_field'], data['recaptcha_response_field'] = recaptcha.challenge() else: - self.fail('Too bad...') + self.fail("Too bad...") download_url = self.html self.download(download_url) diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py index b1a2a4c77..84f9fbb72 100644 --- a/module/plugins/hoster/DebridItaliaCom.py +++ b/module/plugins/hoster/DebridItaliaCom.py @@ -35,7 +35,7 @@ class DebridItaliaCom(Hoster): self.logDebug("XML data: %s" % page) if 'File not available' in page: - self.fail('File not available') + self.fail("File not available") else: new_url = re.search(r'<a href="(?:[^"]+)">(?P<direct>[^<]+)</a>', page).group('direct') diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index 16340036f..3dd2d0ff2 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -92,9 +92,9 @@ class DepositfilesCom(SimpleHoster): self.logDebug("LINK: %s" % link) break else: - self.error('Download link') + self.error("Download link") else: - self.fail('No valid captcha response received') + self.fail("No valid captcha response received") try: self.download(link, disposition=True) diff --git a/module/plugins/hoster/ExtabitCom.py b/module/plugins/hoster/ExtabitCom.py index 15f8b5d1c..36588c4a8 100644 --- a/module/plugins/hoster/ExtabitCom.py +++ b/module/plugins/hoster/ExtabitCom.py @@ -61,16 +61,16 @@ class ExtabitCom(SimpleHoster): else: self.fail("Invalid captcha") else: - self.error('Captcha') + self.error("Captcha") if not "href" in response: - self.error('JSON') + self.error("JSON") self.html = self.load("http://extabit.com/file/%s%s" % (fileID, response['href'])) m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error('Download URL') + self.error("Download URL") url = m.group(1) self.download(url) diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py index 45fb2e644..4090ce92b 100644 --- a/module/plugins/hoster/FilepostCom.py +++ b/module/plugins/hoster/FilepostCom.py @@ -99,7 +99,7 @@ class FilepostCom(SimpleHoster): self.logDebug(json_response) if not 'js' in json_response: - self.error('JSON %s 1' % field) + self.error("JSON %s 1" % field) # i changed js_answer to json_response['js'] since js_answer is nowhere set. # i don't know the JSON-HTTP specs in detail, but the previous author @@ -123,7 +123,7 @@ class FilepostCom(SimpleHoster): # ~? self.fail(js_answer['error']) if not 'answer' in json_response['js'] or not field in json_response['js']['answer']: - self.error('JSON %s 2' % field) + self.error("JSON %s 2" % field) return json_response['js']['answer'][field] diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 9bb00ba92..0d4cb43a4 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -41,7 +41,7 @@ class FilerNet(SimpleHoster): inputs = self.parseHtmlForm(input_names='token')[1] if 'token' not in inputs: - self.error('Unable to detect token') + self.error("Unable to detect token") token = inputs['token'] self.logDebug("Token: " + token) @@ -49,7 +49,7 @@ class FilerNet(SimpleHoster): inputs = self.parseHtmlForm(input_names='hash')[1] if 'hash' not in inputs: - self.error('Unable to detect hash') + self.error("Unable to detect hash") hash_data = inputs['hash'] self.logDebug("Hash: " + hash_data) diff --git a/module/plugins/hoster/FourSharedCom.py b/module/plugins/hoster/FourSharedCom.py index 00dcf4973..2ea061544 100644 --- a/module/plugins/hoster/FourSharedCom.py +++ b/module/plugins/hoster/FourSharedCom.py @@ -44,7 +44,7 @@ class FourSharedCom(SimpleHoster): m = re.search(self.DOWNLOAD_URL_PATTERN, self.html) if m is None: - self.error('Download link') + self.error("Download link") link = m.group(1) try: diff --git a/module/plugins/hoster/FshareVn.py b/module/plugins/hoster/FshareVn.py index 23a66a1c1..217e2d754 100644 --- a/module/plugins/hoster/FshareVn.py +++ b/module/plugins/hoster/FshareVn.py @@ -68,7 +68,7 @@ class FshareVn(SimpleHoster): self.url = self.pyfile.url + action if not inputs: - self.error('FORM') + self.error("FORM") elif 'link_file_pwd_dl' in inputs: for password in self.getPassword().splitlines(): self.logInfo("Password protected link, trying", password) @@ -88,7 +88,7 @@ class FshareVn(SimpleHoster): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error('FREE DL URL') + self.error("FREE DL URL") self.url = m.group(1) self.logDebug("FREE DL URL: %s" % self.url) diff --git a/module/plugins/hoster/HellshareCz.py b/module/plugins/hoster/HellshareCz.py index 8809da5ef..a5cea6b9f 100644 --- a/module/plugins/hoster/HellshareCz.py +++ b/module/plugins/hoster/HellshareCz.py @@ -39,7 +39,7 @@ class HellshareCz(SimpleHoster): m = re.search(self.SHOW_WINDOW_PATTERN, self.html) if m is None: - self.error('SHOW WINDOW') + self.error("SHOW WINDOW") self.url = "http://www.hellshare.com" + m.group(1) self.download(self.url) diff --git a/module/plugins/hoster/LinksnappyCom.py b/module/plugins/hoster/LinksnappyCom.py index b96c9492c..3c417a9d3 100644 --- a/module/plugins/hoster/LinksnappyCom.py +++ b/module/plugins/hoster/LinksnappyCom.py @@ -49,7 +49,7 @@ class LinksnappyCom(Hoster): if j['error']: self.logError("Error converting the link: %s" % j['error']) - self.fail('Error converting the link') + self.fail("Error converting the link") pyfile.name = j['filename'] new_url = j['generated'] diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py index e76105944..5dfe375d1 100644 --- a/module/plugins/hoster/LuckyShareNet.py +++ b/module/plugins/hoster/LuckyShareNet.py @@ -33,7 +33,7 @@ class LuckyShareNet(SimpleHoster): self.logDebug("You have to wait %d seconds between free downloads" % waittime) self.retry(wait_time=waittime) else: - self.error('Unable to detect wait time between free downloads') + self.error("Unable to detect wait time between free downloads") elif 'Hash expired' in rep: self.retry(reason="Hash expired") return json_loads(rep) @@ -64,7 +64,7 @@ class LuckyShareNet(SimpleHoster): elif 'Verification failed' in rep: self.invalidCaptcha() else: - self.error('Unable to get downlaod link') + self.error("Unable to get downlaod link") if not json['link']: self.fail("No Download url retrieved/all captcha attempts failed") diff --git a/module/plugins/hoster/MegasharesCom.py b/module/plugins/hoster/MegasharesCom.py index e674ae7fa..c41e8b9e2 100644 --- a/module/plugins/hoster/MegasharesCom.py +++ b/module/plugins/hoster/MegasharesCom.py @@ -83,7 +83,7 @@ class MegasharesCom(SimpleHoster): # Check traffic left on passport m = re.search(self.PASSPORT_LEFT_PATTERN, self.html, re.M | re.S) if m is None: - self.fail('Passport not found') + self.fail("Passport not found") self.logInfo("Download passport: %s" % m.group(1)) data_left = float(m.group(2)) * 1024 ** {'B': 0, 'KB': 1, 'MB': 2, 'GB': 3}[m.group(3)] diff --git a/module/plugins/hoster/MyfastfileCom.py b/module/plugins/hoster/MyfastfileCom.py index d3a699e98..a9e84a2f2 100644 --- a/module/plugins/hoster/MyfastfileCom.py +++ b/module/plugins/hoster/MyfastfileCom.py @@ -37,7 +37,7 @@ class MyfastfileCom(Hoster): self.logDebug("JSON data: " + page) page = json_loads(page) if page['status'] != 'ok': - self.fail('Unable to unrestrict link') + self.fail("Unable to unrestrict link") new_url = page['link'] if new_url != pyfile.url: diff --git a/module/plugins/hoster/NarodRu.py b/module/plugins/hoster/NarodRu.py index 0a99526f4..473697ac0 100644 --- a/module/plugins/hoster/NarodRu.py +++ b/module/plugins/hoster/NarodRu.py @@ -36,7 +36,7 @@ class NarodRu(SimpleHoster): self.html = self.load('http://narod.ru/disk/getcapchaxml/?rnd=%d' % int(random() * 777)) m = re.search(self.CAPTCHA_PATTERN, self.html) if m is None: - self.error('Captcha') + self.error("Captcha") post_data = {"action": "sendcapcha"} captcha_url, post_data['key'] = m.groups() post_data['rep'] = self.decryptCaptcha(captcha_url) @@ -50,7 +50,7 @@ class NarodRu(SimpleHoster): elif u'<b class="error-msg"><strong>Ошиблись?</strong>' in self.html: self.invalidCaptcha() else: - self.error('Download link') + self.error("Download link") else: self.fail("No valid captcha code entered") diff --git a/module/plugins/hoster/QuickshareCz.py b/module/plugins/hoster/QuickshareCz.py index 12de0fa5b..07b95e1bc 100644 --- a/module/plugins/hoster/QuickshareCz.py +++ b/module/plugins/hoster/QuickshareCz.py @@ -67,7 +67,7 @@ class QuickshareCz(SimpleHoster): m = re.search("Location\s*:\s*(.*)", self.header, re.I) if m is None: - self.fail('File not found') + self.fail("File not found") download_url = m.group(1) self.logDebug("FREE URL2:" + download_url) @@ -79,7 +79,7 @@ class QuickshareCz(SimpleHoster): elif m.group(1) == '2': self.retry(60, 60, "No free slots available") else: - self.fail('Error %d' % m.group(1)) + self.fail("Error %d" % m.group(1)) # download file self.download(download_url) diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index dea82591d..66b1ff222 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -48,7 +48,7 @@ class SimplydebridCom(Hoster): if not re.match(self.__pattern__, new_url): page = self.load('http://simply-debrid.com/api.php', get={'dl': new_url}) # +'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) if 'tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page): - self.fail('Unable to unrestrict link') + self.fail("Unable to unrestrict link") new_url = page self.setWait(5) diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py index 49820bae6..11a402bfd 100644 --- a/module/plugins/hoster/StreamcloudEu.py +++ b/module/plugins/hoster/StreamcloudEu.py @@ -122,7 +122,7 @@ class StreamcloudEu(XFSPHoster): self.errmsg = None else: - self.error('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) + self.error("FORM: %s" % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) getInfo = create_getInfo(StreamcloudEu) diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index c1029ff70..1a6366c4a 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -76,7 +76,7 @@ class TurbobitNet(SimpleHoster): else: m = re.search(self.CAPTCHA_PATTERN, self.html) if m is None: - self.error('captcha') + self.error("captcha") captcha_url = m.group(1) inputs['captcha_response'] = self.decryptCaptcha(captcha_url) diff --git a/module/plugins/hoster/TwoSharedCom.py b/module/plugins/hoster/TwoSharedCom.py index ee48556d4..1c944756b 100644 --- a/module/plugins/hoster/TwoSharedCom.py +++ b/module/plugins/hoster/TwoSharedCom.py @@ -31,7 +31,7 @@ class TwoSharedCom(SimpleHoster): def handleFree(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error('Download link') + self.error("Download link") link = m.group(1) self.download(link) diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index 7b57a0d02..5725d84fc 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -54,7 +54,7 @@ class UlozTo(SimpleHoster): m = re.search(self.TOKEN_PATTERN, self.html) if m is None: - self.error('TOKEN') + self.error("TOKEN") token = m.group(1) self.html = self.load(pyfile.url, get={"do": "askAgeForm-submit"}, diff --git a/module/plugins/hoster/UloziskoSk.py b/module/plugins/hoster/UloziskoSk.py index 2db2ce65e..54620709a 100644 --- a/module/plugins/hoster/UloziskoSk.py +++ b/module/plugins/hoster/UloziskoSk.py @@ -42,19 +42,19 @@ class UloziskoSk(SimpleHoster): def handleFree(self): m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error('URL') + self.error("URL") parsed_url = 'http://www.ulozisko.sk' + m.group(1) m = re.search(self.ID_PATTERN, self.html) if m is None: - self.error('ID') + self.error("ID") id = m.group(1) self.logDebug("URL:" + parsed_url + ' ID:' + id) m = re.search(self.CAPTCHA_PATTERN, self.html) if m is None: - self.error('CAPTCHA') + self.error("CAPTCHA") captcha_url = 'http://www.ulozisko.sk' + m.group(1) captcha = self.decryptCaptcha(captcha_url, cookies=True) diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 69148efbf..bd799005c 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -138,7 +138,7 @@ class UploadedTo(Hoster): elif status == 2: pyfile.name, pyfile.size = name, size else: - self.fail('Parse error - file info') + self.fail("Parse error - file info") elif api == 'Access denied': self.fail(_("API key invalid")) diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index 42f1e9a14..11f7e97b0 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -38,7 +38,7 @@ class WebshareCz(SimpleHoster): self.logDebug("API data: " + api_data) m = re.search('<link>(.+)</link>', api_data) if m is None: - self.error('Unable to detect direct link') + self.error("Unable to detect direct link") direct = m.group(1) self.logDebug("Direct link: " + direct) self.download(direct, disposition=True) diff --git a/module/plugins/hoster/WrzucTo.py b/module/plugins/hoster/WrzucTo.py index b3b917018..28d4f4716 100644 --- a/module/plugins/hoster/WrzucTo.py +++ b/module/plugins/hoster/WrzucTo.py @@ -32,7 +32,7 @@ class WrzucTo(SimpleHoster): def handleFree(self): data = dict(re.findall(r'(md5|file): "(.*?)"', self.html)) if len(data) != 2: - self.error('File ID') + self.error("File ID") self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) self.req.http.lastURL = self.pyfile.url @@ -43,7 +43,7 @@ class WrzucTo(SimpleHoster): data.update(re.findall(r'"(download_link|server_id)":"(.*?)"', self.html)) if len(data) != 4: - self.error('Download URL') + self.error("Download URL") download_url = "http://%s.wrzuc.to/pobierz/%s" % (data['server_id'], data['download_link']) self.download(download_url) diff --git a/module/plugins/hoster/YibaishiwuCom.py b/module/plugins/hoster/YibaishiwuCom.py index 1ea44ddb4..520b5562d 100644 --- a/module/plugins/hoster/YibaishiwuCom.py +++ b/module/plugins/hoster/YibaishiwuCom.py @@ -49,7 +49,7 @@ class YibaishiwuCom(SimpleHoster): except: continue else: - self.fail('No working link found') + self.fail("No working link found") getInfo = create_getInfo(YibaishiwuCom) |