summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/BasePlugin.py2
-rw-r--r--module/plugins/hoster/DateiTo.py4
-rw-r--r--module/plugins/hoster/DlFreeFr.py2
-rw-r--r--module/plugins/hoster/FilecloudIo.py4
-rw-r--r--module/plugins/hoster/FilepostCom.py2
-rw-r--r--module/plugins/hoster/FilesMailRu.py2
-rw-r--r--module/plugins/hoster/FlyFilesNet.py2
-rw-r--r--module/plugins/hoster/LetitbitNet.py4
-rw-r--r--module/plugins/hoster/MegaCoNz.py2
-rw-r--r--module/plugins/hoster/PremiumTo.py2
-rw-r--r--module/plugins/hoster/QuickshareCz.py6
-rw-r--r--module/plugins/hoster/RPNetBiz.py2
-rw-r--r--module/plugins/hoster/RapiduNet.py4
-rw-r--r--module/plugins/hoster/ShareonlineBiz.py4
-rw-r--r--module/plugins/hoster/TurbobitNet.py4
-rw-r--r--module/plugins/hoster/TusfilesNet.py2
-rw-r--r--module/plugins/hoster/UnibytesCom.py4
-rw-r--r--module/plugins/hoster/VkCom.py2
-rw-r--r--module/plugins/hoster/XHamsterCom.py2
-rw-r--r--module/plugins/hoster/Xdcc.py8
-rw-r--r--module/plugins/hoster/YibaishiwuCom.py2
-rw-r--r--module/plugins/hoster/YoutubeCom.py2
-rw-r--r--module/plugins/hoster/ZippyshareCom.py4
23 files changed, 36 insertions, 36 deletions
diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py
index 538e5ded2..dd7490365 100644
--- a/module/plugins/hoster/BasePlugin.py
+++ b/module/plugins/hoster/BasePlugin.py
@@ -60,7 +60,7 @@ class BasePlugin(Hoster):
self.fail(_("File not found"))
except BadHeader, e:
- if e.code is 404:
+ if e.code == 404:
self.offline()
elif e.code in (401, 403):
diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py
index 753494c53..d90fc5864 100644
--- a/module/plugins/hoster/DateiTo.py
+++ b/module/plugins/hoster/DateiTo.py
@@ -41,10 +41,10 @@ class DateiTo(SimpleHoster):
self.check_errors()
if url.endswith('download.php') and 'P' in data:
- if data['P'] == 'I':
+ if data['P'] == "I":
self.do_wait()
- elif data['P'] == 'IV':
+ elif data['P'] == "IV":
break
m = re.search(self.DATA_PATTERN, self.html)
diff --git a/module/plugins/hoster/DlFreeFr.py b/module/plugins/hoster/DlFreeFr.py
index e8df5e3f0..f9d427c1b 100644
--- a/module/plugins/hoster/DlFreeFr.py
+++ b/module/plugins/hoster/DlFreeFr.py
@@ -124,7 +124,7 @@ class DlFreeFr(SimpleHoster):
value = value.strip()
if key in header:
- if type(header[key]) == list:
+ if type(header[key]) is list:
header[key].append(value)
else:
header[key] = [header[key], value]
diff --git a/module/plugins/hoster/FilecloudIo.py b/module/plugins/hoster/FilecloudIo.py
index 9de7c9c06..7d828f706 100644
--- a/module/plugins/hoster/FilecloudIo.py
+++ b/module/plugins/hoster/FilecloudIo.py
@@ -30,7 +30,7 @@ class FilecloudIo(SimpleHoster):
TEMP_OFFLINE_PATTERN = r'l10n\.FILES__WARNING'
UKEY_PATTERN = r'\'ukey\'\s*:\'(\w+)'
- AB1_PATTERN = r'if\( __ab1 == \'(\w+)\' \)'
+ AB1_PATTERN = r'if\( __ab1 is \'(\w+)\' \)'
ERROR_MSG_PATTERN = r'var __error_msg\s*=\s*l10n\.(.*?);'
@@ -118,7 +118,7 @@ class FilecloudIo(SimpleHoster):
post={'akey': akey, 'ukey': ukey})
self.log_debug("FetchDownloadUrl: " + rep)
rep = json_loads(rep)
- if rep['status'] == 'ok':
+ if rep['status'] == "ok":
self.link = rep['download_url']
else:
self.fail(rep['message'])
diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py
index 49837ec28..d8c626ef2 100644
--- a/module/plugins/hoster/FilepostCom.py
+++ b/module/plugins/hoster/FilepostCom.py
@@ -100,7 +100,7 @@ class FilepostCom(SimpleHoster):
#: See the two lines commented out with "# ~?".
if 'error' in res['js']:
- if res['js']['error'] == 'download_delay':
+ if res['js']['error'] == "download_delay":
self.retry(wait_time=res['js']['params']['next_download'])
#: ~? self.retry(wait_time=js_answer['params']['next_download'])
diff --git a/module/plugins/hoster/FilesMailRu.py b/module/plugins/hoster/FilesMailRu.py
index b3dbcbeb4..a6dd56152 100644
--- a/module/plugins/hoster/FilesMailRu.py
+++ b/module/plugins/hoster/FilesMailRu.py
@@ -99,7 +99,7 @@ class FilesMailRu(Hoster):
#: then the download will be restarted. It's only bad for these
#: who want download a HTML-File (it's one in a million ;-) )
#
- #: The maximum UploadSize allowed on files.mail.ru at the moment is 100MB
+ #: The maximum UploadSize allowed on files.mail.ru at the moment == 100MB
#: so i set it to check every download because sometimes there are downloads
#: that contain the HTML-Text and 60MB ZEROs after that in a xyzfile.part1.rar file
#: (Loading 100MB in to ram is not an option)
diff --git a/module/plugins/hoster/FlyFilesNet.py b/module/plugins/hoster/FlyFilesNet.py
index 72274ba40..ca2f7f270 100644
--- a/module/plugins/hoster/FlyFilesNet.py
+++ b/module/plugins/hoster/FlyFilesNet.py
@@ -35,7 +35,7 @@ class FlyFilesNet(SimpleHoster):
parsed_url = self.load(url, post={'getDownLink': session})
self.log_debug("Parsed URL: %s" % parsed_url)
- if parsed_url == '#downlink|' or parsed_url == "#downlink|#":
+ if parsed_url == "#downlink|" or parsed_url == "#downlink|#":
self.log_warning(_("Could not get the download URL. Please wait 10 minutes"))
self.wait(10 * 60, True)
self.retry()
diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py
index b08fd515f..03314548c 100644
--- a/module/plugins/hoster/LetitbitNet.py
+++ b/module/plugins/hoster/LetitbitNet.py
@@ -25,7 +25,7 @@ def api_response(url):
def get_info(urls):
for url in urls:
api_rep = api_response(url)
- if api_rep['status'] == 'OK':
+ if api_rep['status'] == "OK":
info = api_rep['data'][0]
yield (info['name'], info['size'], 2, url)
else:
@@ -131,7 +131,7 @@ class LetitbitNet(SimpleHoster):
self.log_debug("API Data: " + api_rep)
api_rep = json_loads(api_rep)
- if api_rep['status'] == 'FAIL':
+ if api_rep['status'] == "FAIL":
self.fail(api_rep['data'])
self.link = api_rep['data'][0][0]
diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py
index 8bec3b37e..e4902f2fc 100644
--- a/module/plugins/hoster/MegaCoNz.py
+++ b/module/plugins/hoster/MegaCoNz.py
@@ -163,7 +163,7 @@ class MegaCoNz(Hoster):
f.close()
df.close()
- # if file_mac[0] ^ file_mac[1], file_mac[2] ^ file_mac[3] != meta_mac:
+ # if file_mac[0] ^ file_mac[1], file_mac[2] ^ file_mac[3] not is meta_mac:
# os.remove(file_decrypted)
# self.fail(_("Checksum mismatch"))
diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py
index dcb9ecceb..bade22519 100644
--- a/module/plugins/hoster/PremiumTo.py
+++ b/module/plugins/hoster/PremiumTo.py
@@ -42,7 +42,7 @@ class PremiumTo(MultiHoster):
self.retry(60, 5 * 60, "No premium account available")
err = ""
- if self.req.http.code == '420':
+ if self.req.http.code == "420":
#: Custom error code send - fail
file = fs_encode(self.last_download)
with open(file, "rb") as f:
diff --git a/module/plugins/hoster/QuickshareCz.py b/module/plugins/hoster/QuickshareCz.py
index cb3d34027..4311a82aa 100644
--- a/module/plugins/hoster/QuickshareCz.py
+++ b/module/plugins/hoster/QuickshareCz.py
@@ -37,7 +37,7 @@ class QuickshareCz(SimpleHoster):
#: Determine download type - free or premium
if self.premium:
if 'UU_prihlasen' in self.jsvars:
- if self.jsvars['UU_prihlasen'] == '0':
+ if self.jsvars['UU_prihlasen'] == "0":
self.log_warning(_("User not logged in"))
self.relogin(self.user)
self.retry()
@@ -75,9 +75,9 @@ class QuickshareCz(SimpleHoster):
#: Check errors
m = re.search(r'/chyba/(\d+)', self.link)
if m:
- if m.group(1) == '1':
+ if m.group(1) == "1":
self.retry(60, 2 * 60, "This IP is already downloading")
- elif m.group(1) == '2':
+ elif m.group(1) == "2":
self.retry(60, 60, "No free slots available")
else:
self.fail(_("Error %d") % m.group(1))
diff --git a/module/plugins/hoster/RPNetBiz.py b/module/plugins/hoster/RPNetBiz.py
index d8cdd59e9..c7c90d01c 100644
--- a/module/plugins/hoster/RPNetBiz.py
+++ b/module/plugins/hoster/RPNetBiz.py
@@ -56,7 +56,7 @@ class RPNetBiz(MultiHoster):
self.log_debug("JSON data hdd query: %s" % res)
download_status = json_loads(res)['download']
- if download_status['status'] == '100':
+ if download_status['status'] == "100":
link_status['generated'] = download_status['rpnet_link']
self.log_debug("Successfully downloaded to rpnet HDD: %s" % link_status['generated'])
break
diff --git a/module/plugins/hoster/RapiduNet.py b/module/plugins/hoster/RapiduNet.py
index 8767e23b9..267f41f36 100644
--- a/module/plugins/hoster/RapiduNet.py
+++ b/module/plugins/hoster/RapiduNet.py
@@ -46,7 +46,7 @@ class RapiduNet(SimpleHoster):
get={'a': "getLoadTimeToDownload"},
post={'_go': ""})
- if str(jsvars['timeToDownload']) is "stop":
+ if str(jsvars['timeToDownload']) == "stop":
t = (24 * 60 * 60) - (int(time.time()) % (24 * 60 * 60)) + time.altzone
self.log_info(_("You've reach your daily download transfer"))
@@ -66,7 +66,7 @@ class RapiduNet(SimpleHoster):
'captcha2': response,
'fileId' : self.info['pattern']['ID']})
- if jsvars['message'] == 'success':
+ if jsvars['message'] == "success":
self.link = jsvars['url']
diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py
index c16604ab0..bdbaa1e6f 100644
--- a/module/plugins/hoster/ShareonlineBiz.py
+++ b/module/plugins/hoster/ShareonlineBiz.py
@@ -79,7 +79,7 @@ class ShareonlineBiz(SimpleHoster):
post={'dl_free' : "1",
'recaptcha_challenge_field': challenge,
'recaptcha_response_field' : response})
- if not res == '0':
+ if not res == "0":
self.captcha.correct()
return res
else:
@@ -163,7 +163,7 @@ class ShareonlineBiz(SimpleHoster):
except Exception:
self.log_error(_("Unknown error occurred"), errmsg)
- if errmsg is "invalid":
+ if errmsg == "invalid":
self.fail(_("File not available"))
elif errmsg in ("full", "freelimit", "size", "proxy"):
diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py
index 2b1304470..25b8d90c4 100644
--- a/module/plugins/hoster/TurbobitNet.py
+++ b/module/plugins/hoster/TurbobitNet.py
@@ -73,7 +73,7 @@ class TurbobitNet(SimpleHoster):
self.error(_("Captcha form not found"))
self.log_debug(inputs)
- if inputs['captcha_type'] == 'recaptcha':
+ if inputs['captcha_type'] == "recaptcha":
recaptcha = ReCaptcha(self)
inputs['recaptcha_response_field'], inputs['recaptcha_challenge_field'] = recaptcha.challenge()
else:
@@ -98,7 +98,7 @@ class TurbobitNet(SimpleHoster):
def get_rt_update(self):
rtUpdate = self.retrieve("rtUpdate")
if not rtUpdate:
- if self.retrieve("version") != self.__version__ \
+ if self.retrieve("version") not is self.__version__ \
or int(self.retrieve("timestamp", 0)) + 86400000 < timestamp():
#: that's right, we are even using jdownloader updates
rtUpdate = self.load("http://update0.jdownloader.org/pluginstuff/tbupdate.js")
diff --git a/module/plugins/hoster/TusfilesNet.py b/module/plugins/hoster/TusfilesNet.py
index 2bac6b69f..8fadb41c3 100644
--- a/module/plugins/hoster/TusfilesNet.py
+++ b/module/plugins/hoster/TusfilesNet.py
@@ -33,7 +33,7 @@ class TusfilesNet(XFSHoster):
return super(TusfilesNet, self).download(url, *args, **kwargs)
except BadHeader, e:
- if e.code is 503:
+ if e.code == 503:
self.multiDL = False
raise Retry("503")
diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py
index 1410a7e59..3ea53e719 100644
--- a/module/plugins/hoster/UnibytesCom.py
+++ b/module/plugins/hoster/UnibytesCom.py
@@ -48,7 +48,7 @@ class UnibytesCom(SimpleHoster):
self.wait(10 * 60, True)
self.retry()
- if post_data['step'] == 'last':
+ if post_data['step'] == "last"':
m = re.search(self.LINK_FREE_PATTERN, self.html)
if m:
self.link = m.group(1)
@@ -60,7 +60,7 @@ class UnibytesCom(SimpleHoster):
last_step = post_data['step']
action, post_data = self.parse_html_form('id="stepForm"')
- if last_step == 'timer':
+ if last_step == "timer":
m = re.search(self.WAIT_PATTERN, self.html)
self.wait(m.group(1) if m else 60, False)
diff --git a/module/plugins/hoster/VkCom.py b/module/plugins/hoster/VkCom.py
index b720344e1..d0b0b780e 100644
--- a/module/plugins/hoster/VkCom.py
+++ b/module/plugins/hoster/VkCom.py
@@ -29,7 +29,7 @@ class VkCom(SimpleHoster):
def handle_free(self, pyfile):
- self.link = re.findall(self.LINK_FREE_PATTERN, self.html)[0 if self.get_config('quality') is "Low" else -1]
+ self.link = re.findall(self.LINK_FREE_PATTERN, self.html)[0 if self.get_config('quality') == "Low" else -1]
getInfo = create_getInfo(VkCom)
diff --git a/module/plugins/hoster/XHamsterCom.py b/module/plugins/hoster/XHamsterCom.py
index 268c7e800..8df1a441f 100644
--- a/module/plugins/hoster/XHamsterCom.py
+++ b/module/plugins/hoster/XHamsterCom.py
@@ -88,7 +88,7 @@ class XHamsterCom(Hoster):
else:
self.error(_("file_url not found"))
- if url_mode == '3':
+ if url_mode == "3":
long_url = file_url
self.log_debug("long_url = " + long_url)
else:
diff --git a/module/plugins/hoster/Xdcc.py b/module/plugins/hoster/Xdcc.py
index 84401498e..9fa64ff0c 100644
--- a/module/plugins/hoster/Xdcc.py
+++ b/module/plugins/hoster/Xdcc.py
@@ -150,7 +150,7 @@ class Xdcc(Hoster):
'text': msg[3][1:]
}
- if nick == msg['target'][0:len(nick)] and "PRIVMSG" == msg['action']:
+ if nick is msg['target'][0:len(nick)] and "PRIVMSG" is msg['action']:
if msg['text'] == "\x01VERSION\x01":
self.log_debug("Sending CTCP VERSION")
sock.send("NOTICE %s :%s\r\n" % (msg['origin'], "pyLoad! IRC Interface"))
@@ -160,8 +160,8 @@ class Xdcc(Hoster):
elif msg['text'] == "\x01LAG\x01":
pass #: don't know how to answer
- if not (bot == msg['origin'][0:len(bot)]
- and nick == msg['target'][0:len(nick)]
+ if not (bot is msg['origin'][0:len(bot)]
+ and nick is msg['target'][0:len(nick)]
and msg['action'] in ("PRIVMSG", "NOTICE")):
continue
@@ -195,7 +195,7 @@ class Xdcc(Hoster):
self.pyfile.setStatus("downloading")
newname = self.req.download(ip, port, filename, sock, self.pyfile.setProgress)
- if newname and newname != filename:
+ if newname and newname not is filename:
self.log_info(_("%(name)s saved as %(newname)s") % {'name': self.pyfile.name, 'newname': newname})
filename = newname
diff --git a/module/plugins/hoster/YibaishiwuCom.py b/module/plugins/hoster/YibaishiwuCom.py
index 46ea673d5..e0e90a311 100644
--- a/module/plugins/hoster/YibaishiwuCom.py
+++ b/module/plugins/hoster/YibaishiwuCom.py
@@ -35,7 +35,7 @@ class YibaishiwuCom(SimpleHoster):
url = m.group(1)
- self.log_debug(('FREEUSER' if m.group(2) == 'download' else 'GUEST') + ' URL', url)
+ self.log_debug(('FREEUSER' if m.group(2) == "download" else 'GUEST') + ' URL', url)
res = json_loads(self.load(urlparse.urljoin("http://115.com", url), decode=False))
if "urls" in res:
diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py
index 5dfeb8ac7..865eeef2e 100644
--- a/module/plugins/hoster/YoutubeCom.py
+++ b/module/plugins/hoster/YoutubeCom.py
@@ -131,7 +131,7 @@ class YoutubeCom(Hoster):
if not streams:
self.fail(_("No available stream meets your preferences"))
- fmt_dict = dict([x for x in streams if self.formats[x[0]][4] == use3d] or streams)
+ fmt_dict = dict([x for x in streams if self.formats[x[0]][4] is use3d] or streams)
self.log_debug("DESIRED STREAM: ITAG:%d (%s) %sfound, %sallowed" %
(desired_fmt, "%s %dx%d Q:%d 3D:%s" % self.formats[desired_fmt],
diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py
index f75068e58..e48627618 100644
--- a/module/plugins/hoster/ZippyshareCom.py
+++ b/module/plugins/hoster/ZippyshareCom.py
@@ -54,7 +54,7 @@ class ZippyshareCom(SimpleHoster):
else:
self.link = self.get_link()
- if self.link and pyfile.name == 'file.html':
+ if self.link and pyfile.name == "file.html":
pyfile.name = urllib.unquote(self.link.split('/')[-1])
@@ -73,7 +73,7 @@ class ZippyshareCom(SimpleHoster):
varName = re.sub(r'-', '', 'GVAR[%s+"_%s"]' %(id, attr))
realid = id.strip('"\'')
- if id != realid: #: Id is not a variable, so look for realid.attr in the html
+ if id not is realid: #: Id is not a variable, so look for realid.attr in the html
initValues = filter(None, [elt.get(attr, None) for elt in soup.findAll(id=realid)])
initValue = '"%s"' % initValues[-1] if initValues else 'null'
initScripts.add('%s = %s;' % (varName, initValue))