summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r--module/plugins/accounts/AlldebridCom.py4
-rw-r--r--module/plugins/accounts/DebridItaliaCom.py2
-rw-r--r--module/plugins/accounts/FastshareCz.py2
-rw-r--r--module/plugins/accounts/FilefactoryCom.py2
-rw-r--r--module/plugins/accounts/FilejungleCom.py2
-rw-r--r--module/plugins/accounts/FreakshareCom.py2
-rw-r--r--module/plugins/accounts/FreeWayMe.py8
-rw-r--r--module/plugins/accounts/FshareVn.py2
-rw-r--r--module/plugins/accounts/Keep2ShareCc.py4
-rw-r--r--module/plugins/accounts/MegaRapidCz.py6
-rw-r--r--module/plugins/accounts/MegaRapidoNet.py2
-rw-r--r--module/plugins/accounts/MyfastfileCom.py3
-rw-r--r--module/plugins/accounts/NitroflareCom.py4
-rw-r--r--module/plugins/accounts/NowVideoSx.py2
-rw-r--r--module/plugins/accounts/OneFichierCom.py2
-rw-r--r--module/plugins/accounts/OverLoadMe.py4
-rw-r--r--module/plugins/accounts/PremiumTo.py5
-rw-r--r--module/plugins/accounts/QuickshareCz.py2
-rw-r--r--module/plugins/accounts/RapiduNet.py4
-rw-r--r--module/plugins/accounts/RealdebridCom.py4
-rw-r--r--module/plugins/accounts/RehostTo.py2
-rw-r--r--module/plugins/accounts/ShareonlineBiz.py2
-rw-r--r--module/plugins/accounts/SimplydebridCom.py2
-rw-r--r--module/plugins/accounts/SmoozedCom.py2
-rw-r--r--module/plugins/accounts/TurbobitNet.py2
-rw-r--r--module/plugins/accounts/UploadedTo.py6
-rw-r--r--module/plugins/accounts/UploadingCom.py2
27 files changed, 40 insertions, 44 deletions
diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py
index 32113c890..12d0582a8 100644
--- a/module/plugins/accounts/AlldebridCom.py
+++ b/module/plugins/accounts/AlldebridCom.py
@@ -26,8 +26,8 @@ class AlldebridCom(Account):
def grab_hosters(self, user, password, data):
html = self.load("https://www.alldebrid.com/api.php",
- get={'action': "get_host"}).replace("\"", "").strip()
- return [x.strip() for x in html.split(",") if x.strip()]
+ get={'action': "get_host"})
+ return [x for x in map(str.strip, html.replace("\"", "").split(",")) if x]
def grab_info(self, user, password, data):
diff --git a/module/plugins/accounts/DebridItaliaCom.py b/module/plugins/accounts/DebridItaliaCom.py
index 3e9a5e283..50d849a98 100644
--- a/module/plugins/accounts/DebridItaliaCom.py
+++ b/module/plugins/accounts/DebridItaliaCom.py
@@ -35,7 +35,7 @@ class DebridItaliaCom(Account):
if 'Account premium not activated' not in html:
m = re.search(self.WALID_UNTIL_PATTERN, html)
- if m:
+ if m is not None:
validuntil = time.mktime(time.strptime(m.group(1), "%d/%m/%Y %H:%M"))
info = {'premium': True, 'validuntil': validuntil, 'trafficleft': -1}
else:
diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py
index a6a2e2ac6..68c65bd3f 100644
--- a/module/plugins/accounts/FastshareCz.py
+++ b/module/plugins/accounts/FastshareCz.py
@@ -29,7 +29,7 @@ class FastshareCz(Account):
html = self.load("http://www.fastshare.cz/user")
m = re.search(self.CREDIT_PATTERN, html)
- if m:
+ if m is not None:
trafficleft = self.parse_traffic(m.group(1))
premium = bool(trafficleft)
diff --git a/module/plugins/accounts/FilefactoryCom.py b/module/plugins/accounts/FilefactoryCom.py
index 0bb814039..0f8f709c6 100644
--- a/module/plugins/accounts/FilefactoryCom.py
+++ b/module/plugins/accounts/FilefactoryCom.py
@@ -26,7 +26,7 @@ class FilefactoryCom(Account):
html = self.load("http://www.filefactory.com/account/")
m = re.search(self.VALID_UNTIL_PATTERN, html)
- if m:
+ if m is not None:
premium = True
validuntil = re.sub(self.VALID_UNTIL_PATTERN, '\g<D> \g<M> \g<Y>', m.group(0))
validuntil = time.mktime(time.strptime(validuntil, "%d %b %Y"))
diff --git a/module/plugins/accounts/FilejungleCom.py b/module/plugins/accounts/FilejungleCom.py
index a7a1c3f56..230aa9939 100644
--- a/module/plugins/accounts/FilejungleCom.py
+++ b/module/plugins/accounts/FilejungleCom.py
@@ -28,7 +28,7 @@ class FilejungleCom(Account):
def grab_info(self, user, password, data):
html = self.load(self.URL + "dashboard.php")
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- if m:
+ if m is not None:
premium = True
validuntil = time.mktime(time.strptime(m.group(1), "%d %b %Y"))
else:
diff --git a/module/plugins/accounts/FreakshareCom.py b/module/plugins/accounts/FreakshareCom.py
index 42551b732..a319096db 100644
--- a/module/plugins/accounts/FreakshareCom.py
+++ b/module/plugins/accounts/FreakshareCom.py
@@ -26,7 +26,7 @@ class FreakshareCom(Account):
try:
m = re.search(r'ltig bis:</td>\s*<td><b>([\d.:-]+)</b></td>', html, re.M)
- validuntil = time.mktime(time.strptime(m.group(1).strip(), "%d.%m.%Y - %H:%M"))
+ validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y - %H:%M"))
except Exception:
pass
diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py
index 536280acc..b554f592a 100644
--- a/module/plugins/accounts/FreeWayMe.py
+++ b/module/plugins/accounts/FreeWayMe.py
@@ -20,11 +20,9 @@ class FreeWayMe(Account):
def grab_hosters(self, user, password, data):
- hostis = self.load("http://www.free-way.bz/ajax/jd.php",
- get={'id' : 3,
- 'user': user,
- 'pass': password}).replace("\"", "") #@TODO: Revert to `https` in 0.4.10
- return [x.strip() for x in hostis.split(",") if x.strip()]
+ html = self.load("http://www.free-way.bz/ajax/jd.php",
+ get={'id' : 3, 'user': user, 'pass': password}) #@TODO: Revert to `https` in 0.4.10
+ return [x for x in map(str.strip, html.replace("\"", "").split(",")) if x]
def grab_info(self, user, password, data):
diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py
index 4e078ccc9..24a858274 100644
--- a/module/plugins/accounts/FshareVn.py
+++ b/module/plugins/accounts/FshareVn.py
@@ -33,7 +33,7 @@ class FshareVn(Account):
return {'validuntil': -1, 'trafficleft': trafficleft, 'premium': True}
m = re.search(self.VALID_UNTIL_PATTERN, html)
- if m:
+ if m is not None:
premium = True
validuntil = time.mktime(time.strptime(m.group(1), '%I:%M:%S %p %d-%m-%Y'))
trafficleft = self.get_traffic_left()
diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py
index e76ec212c..32bccc2e4 100644
--- a/module/plugins/accounts/Keep2ShareCc.py
+++ b/module/plugins/accounts/Keep2ShareCc.py
@@ -33,7 +33,7 @@ class Keep2ShareCc(Account):
html = self.load("http://keep2share.cc/site/profile.html")
m = re.search(self.VALID_UNTIL_PATTERN, html)
- if m:
+ if m is not None:
expiredate = m.group(1).strip()
self.log_debug("Expire date: " + expiredate)
@@ -51,7 +51,7 @@ class Keep2ShareCc(Account):
premium = True if validuntil > time.mktime(time.gmtime()) else False
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- if m:
+ if m is not None:
try:
trafficleft = self.parse_traffic(m.group(1))
diff --git a/module/plugins/accounts/MegaRapidCz.py b/module/plugins/accounts/MegaRapidCz.py
index 00ffcb742..050e3e4c6 100644
--- a/module/plugins/accounts/MegaRapidCz.py
+++ b/module/plugins/accounts/MegaRapidCz.py
@@ -29,16 +29,16 @@ class MegaRapidCz(Account):
htmll = self.load("http://megarapid.cz/mujucet/")
m = re.search(self.LIMITDL_PATTERN, htmll)
- if m:
+ if m is not None:
data['options']['limitDL'] = [int(m.group(1))]
m = re.search(self.VALID_UNTIL_PATTERN, htmll)
- if m:
+ if m is not None:
validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y - %H:%M"))
return {'premium': True, 'trafficleft': -1, 'validuntil': validuntil}
m = re.search(self.TRAFFIC_LEFT_PATTERN, htmll)
- if m:
+ if m is not None:
trafficleft = float(m.group(1)) * (1 << 20)
return {'premium': True, 'trafficleft': trafficleft, 'validuntil': -1}
diff --git a/module/plugins/accounts/MegaRapidoNet.py b/module/plugins/accounts/MegaRapidoNet.py
index 44b154344..d8291e0e2 100644
--- a/module/plugins/accounts/MegaRapidoNet.py
+++ b/module/plugins/accounts/MegaRapidoNet.py
@@ -117,7 +117,7 @@ class MegaRapidoNet(Account):
self.fail_login()
else:
m = re.search(self.USER_ID_PATTERN, html)
- if m:
+ if m is not None:
data['uid'] = m.group(1)
else:
self.fail_login("Couldn't find the user ID")
diff --git a/module/plugins/accounts/MyfastfileCom.py b/module/plugins/accounts/MyfastfileCom.py
index 75fd9fda9..eff112a2f 100644
--- a/module/plugins/accounts/MyfastfileCom.py
+++ b/module/plugins/accounts/MyfastfileCom.py
@@ -46,5 +46,4 @@ class MyfastfileCom(Account):
self.json_data = json_loads(html)
if self.json_data['status'] != 'ok':
- self.log_error(_('Invalid login. The password to use is the API-Password you find in your "My Account" page'))
- self.fail_login()
+ self.fail_login(_("Invalid username or password"))
diff --git a/module/plugins/accounts/NitroflareCom.py b/module/plugins/accounts/NitroflareCom.py
index 11a3a43e7..70804d4e9 100644
--- a/module/plugins/accounts/NitroflareCom.py
+++ b/module/plugins/accounts/NitroflareCom.py
@@ -33,7 +33,7 @@ class NitroflareCom(Account):
get={'s': "premium"})
m = re.search(self.VALID_UNTIL_PATTERN, html)
- if m:
+ if m is not None:
expiredate = m.group(1).strip()
self.log_debug("Time Left: " + expiredate)
@@ -54,7 +54,7 @@ class NitroflareCom(Account):
validuntil = -1
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- if m:
+ if m is not None:
try:
trafficleft = self.parse_traffic(str(max(0, 50 - float(m.group(1)))) + " GB")
diff --git a/module/plugins/accounts/NowVideoSx.py b/module/plugins/accounts/NowVideoSx.py
index 3d8484b8b..36d26930a 100644
--- a/module/plugins/accounts/NowVideoSx.py
+++ b/module/plugins/accounts/NowVideoSx.py
@@ -28,7 +28,7 @@ class NowVideoSx(Account):
html = self.load("http://www.nowvideo.sx/premium.php")
m = re.search(self.VALID_UNTIL_PATTERN, html)
- if m:
+ if m is not None:
expiredate = m.group(1).strip()
self.log_debug("Expire date: " + expiredate)
diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py
index 9be982bee..0249f2b93 100644
--- a/module/plugins/accounts/OneFichierCom.py
+++ b/module/plugins/accounts/OneFichierCom.py
@@ -30,7 +30,7 @@ class OneFichierCom(Account):
html = self.load("https://1fichier.com/console/abo.pl")
m = re.search(self.VALID_UNTIL_PATTERN, html)
- if m:
+ if m is not None:
expiredate = m.group(1)
self.log_debug("Expire date: " + expiredate)
diff --git a/module/plugins/accounts/OverLoadMe.py b/module/plugins/accounts/OverLoadMe.py
index 60dddeb5a..02d0d2649 100644
--- a/module/plugins/accounts/OverLoadMe.py
+++ b/module/plugins/accounts/OverLoadMe.py
@@ -21,8 +21,8 @@ class OverLoadMe(Account):
def grab_hosters(self, user, password, data):
html = self.load("https://api.over-load.me/hoster.php",
- get={'auth': "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"}).replace("\"", "").strip()
- return [x.strip() for x in html.split(",") if x.strip()]
+ get={'auth': "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"})
+ return [x for x in map(str.strip, html.replace("\"", "").split(",")) if x]
def grab_info(self, user, password, data):
diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py
index 96f81d075..74859d8a5 100644
--- a/module/plugins/accounts/PremiumTo.py
+++ b/module/plugins/accounts/PremiumTo.py
@@ -22,9 +22,8 @@ class PremiumTo(Account):
def grab_hosters(self, user, password, data):
html = self.load("http://premium.to/api/hosters.php",
- get={'username': user,
- 'password': password})
- return [x.strip() for x in html.replace("\"", "").split(";")]
+ get={'username': user, 'password': password})
+ return [x for x in map(str.strip, html.replace("\"", "").split(",")) if x]
def grab_info(self, user, password, data):
diff --git a/module/plugins/accounts/QuickshareCz.py b/module/plugins/accounts/QuickshareCz.py
index 74377a052..19cde51c4 100644
--- a/module/plugins/accounts/QuickshareCz.py
+++ b/module/plugins/accounts/QuickshareCz.py
@@ -23,7 +23,7 @@ class QuickshareCz(Account):
html = self.load("http://www.quickshare.cz/premium")
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- if m:
+ if m is not None:
trafficleft = self.parse_traffic(m.group(1))
premium = True if trafficleft else False
else:
diff --git a/module/plugins/accounts/RapiduNet.py b/module/plugins/accounts/RapiduNet.py
index 2566aacf6..c11eb9214 100644
--- a/module/plugins/accounts/RapiduNet.py
+++ b/module/plugins/accounts/RapiduNet.py
@@ -37,11 +37,11 @@ class RapiduNet(Account):
premium = True
m = re.search(self.VALID_UNTIL_PATTERN, html)
- if m:
+ if m is not None:
validuntil = time.time() + (86400 * int(m.group(1)))
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- if m:
+ if m is not None:
trafficleft = self.parse_traffic(m.group(1))
return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium}
diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py
index c8e020bd6..63ef62da0 100644
--- a/module/plugins/accounts/RealdebridCom.py
+++ b/module/plugins/accounts/RealdebridCom.py
@@ -21,8 +21,8 @@ class RealdebridCom(Account):
def grab_hosters(self, user, password, data):
- html = self.load("https://real-debrid.com/api/hosters.php").replace("\"", "").strip()
- return [x.strip() for x in html.split(",") if x.strip()]
+ html = self.load("https://real-debrid.com/api/hosters.php")
+ return [x for x in map(str.strip, html.replace("\"", "").split(",")) if x]
def grab_info(self, user, password, data):
diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py
index a9f2746c2..2ad4cdceb 100644
--- a/module/plugins/accounts/RehostTo.py
+++ b/module/plugins/accounts/RehostTo.py
@@ -22,7 +22,7 @@ class RehostTo(Account):
html = self.load("http://rehost.to/api.php",
get={'cmd' : "get_supported_och_dl",
'long_ses': data['session']})
- return [x.strip() for x in html.replace("\"", "").split(",")]
+ return [x for x in map(str.strip, html.replace("\"", "").split(",")) if x]
def grab_info(self, user, password, data):
diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py
index d7eb14bd6..f5d213ecd 100644
--- a/module/plugins/accounts/ShareonlineBiz.py
+++ b/module/plugins/accounts/ShareonlineBiz.py
@@ -30,7 +30,7 @@ class ShareonlineBiz(Account):
api = dict(line.split("=") for line in res.splitlines() if "=" in line)
if not 'a' in api:
- self.fail_login(res.strip('*').strip())
+ self.fail_login(res.strip('*'))
if api['a'].lower() == "not_available":
self.fail_login(_("No info available"))
diff --git a/module/plugins/accounts/SimplydebridCom.py b/module/plugins/accounts/SimplydebridCom.py
index d09ae36ad..bd56dd5ec 100644
--- a/module/plugins/accounts/SimplydebridCom.py
+++ b/module/plugins/accounts/SimplydebridCom.py
@@ -22,7 +22,7 @@ class SimplydebridCom(Account):
def grab_hosters(self, user, password, data):
html = self.load("http://simply-debrid.com/api.php", get={'list': 1})
- return [x.strip() for x in html.rstrip(';').replace("\"", "").split(";")]
+ return [x for x in map(str.strip, html.rstrip(';').replace("\"", "").split(";")) if x]
def grab_info(self, user, password, data):
diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py
index 16b4fe7fc..1c3da5269 100644
--- a/module/plugins/accounts/SmoozedCom.py
+++ b/module/plugins/accounts/SmoozedCom.py
@@ -35,7 +35,7 @@ class SmoozedCom(Account):
__description__ = """Smoozed.com account plugin"""
__license__ = "GPLv3"
- __authors__ = [("", "")]
+ __authors__ = [(None, None)]
def grab_hosters(self, user, password, data):
diff --git a/module/plugins/accounts/TurbobitNet.py b/module/plugins/accounts/TurbobitNet.py
index b73f95fa5..c3edd0c09 100644
--- a/module/plugins/accounts/TurbobitNet.py
+++ b/module/plugins/accounts/TurbobitNet.py
@@ -22,7 +22,7 @@ class TurbobitNet(Account):
html = self.load("http://turbobit.net")
m = re.search(r'<u>Turbo Access</u> to ([\d.]+)', html)
- if m:
+ if m is not None:
premium = True
validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y"))
else:
diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py
index c5cd9dd9f..0d1bb7bcb 100644
--- a/module/plugins/accounts/UploadedTo.py
+++ b/module/plugins/accounts/UploadedTo.py
@@ -34,20 +34,20 @@ class UploadedTo(Account):
premium = True if re.search(self.PREMIUM_PATTERN, html) else False
m = re.search(self.VALID_UNTIL_PATTERN, html, re.M)
- if m:
+ if m is not None:
expiredate = m.group(1).lower().strip()
if expiredate == "unlimited":
validuntil = -1
else:
m = re.findall(r'(\d+) (week|day|hour)', expiredate)
- if m:
+ if m is not None:
validuntil = time.time()
for n, u in m:
validuntil += float(n) * 60 * 60 * {'week': 168, 'day': 24, 'hour': 1}[u]
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- if m:
+ if m is not None:
traffic = m.groupdict()
size = traffic['S'].replace('.', '')
unit = traffic['U'].lower()
diff --git a/module/plugins/accounts/UploadingCom.py b/module/plugins/accounts/UploadingCom.py
index cacc8df14..c038d1ebc 100644
--- a/module/plugins/accounts/UploadingCom.py
+++ b/module/plugins/accounts/UploadingCom.py
@@ -32,7 +32,7 @@ class UploadingCom(Account):
premium = False if re.search(self.PREMIUM_PATTERN, html) else True
m = re.search(self.VALID_UNTIL_PATTERN, html)
- if m:
+ if m is not None:
expiredate = m.group(1).strip()
self.log_debug("Expire date: " + expiredate)