From a0073934475c4955d4c6a7b6c805ca37c0b6d30b Mon Sep 17 00:00:00 2001 From: Guidobelix Date: Sun, 14 Sep 2014 16:34:01 +0200 Subject: Fixed EasybytezCom to work properly for registered (free) users Expire date is meaningful only for Premium users. For registered (free) users expire date is set to -1 (free accounts never expire). --- module/plugins/accounts/EasybytezCom.py | 36 +++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/EasybytezCom.py b/module/plugins/accounts/EasybytezCom.py index 3b8517686..105c365b5 100644 --- a/module/plugins/accounts/EasybytezCom.py +++ b/module/plugins/accounts/EasybytezCom.py @@ -11,11 +11,11 @@ from module.utils import parseFileSize class EasybytezCom(Account): __name__ = "EasybytezCom" __type__ = "account" - __version__ = "0.04" + __version__ = "0.05" __description__ = """EasyBytez.com account plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __author_name__ = ("zoidberg", "guidobelix") + __author_mail__ = ("zoidberg@mujmail.cz", "guidobelix@hotmail.it") VALID_UNTIL_PATTERN = r'Premium account expire:([^<]+)' TRAFFIC_LEFT_PATTERN = r'Traffic available today:(?P[^<]+)' @@ -24,30 +24,36 @@ class EasybytezCom(Account): def loadAccountInfo(self, user, req): html = req.load("http://www.easybytez.com/?op=my_account", decode=True) - validuntil = trafficleft = None + validuntil = -1 + trafficleft = None premium = False m = re.search(self.VALID_UNTIL_PATTERN, html) if m: try: - self.logDebug("Expire date: " + m.group(1)) - validuntil = mktime(strptime(m.group(1), "%d %B %Y")) + expiredate = m.group(1) + self.logDebug("Expire date: " + expiredate) + validuntil = mktime(strptime(expiredate, "%d %B %Y")) except Exception, e: self.logError(e) - if validuntil > mktime(gmtime()): - premium = True - trafficleft = -1 - else: - m = re.search(self.TRAFFIC_LEFT_PATTERN, html) - if m: - trafficleft = m.group(1) - if "Unlimited" in trafficleft: + else: + if validuntil > mktime(gmtime()): + premium = True trafficleft = -1 else: - trafficleft = parseFileSize(trafficleft) / 1024 + premium = False + + m = re.search(self.TRAFFIC_LEFT_PATTERN, html) + if m: + trafficleft = m.group(1) + if "Unlimited" in trafficleft: + trafficleft = -1 + else: + trafficleft = parseFileSize(trafficleft) / 1024 return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} + def login(self, user, data, req): html = req.load('http://www.easybytez.com/login.html', decode=True) action, inputs = parseHtmlForm('name="FL"', html) -- cgit v1.2.3 From 8d2ce2b8c169b801c9e98d96cb2c2e6aa1c25f19 Mon Sep 17 00:00:00 2001 From: Guidobelix Date: Tue, 16 Sep 2014 17:02:29 +0200 Subject: Update EasybytezCom --- module/plugins/accounts/EasybytezCom.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/EasybytezCom.py b/module/plugins/accounts/EasybytezCom.py index 105c365b5..564549521 100644 --- a/module/plugins/accounts/EasybytezCom.py +++ b/module/plugins/accounts/EasybytezCom.py @@ -11,7 +11,7 @@ from module.utils import parseFileSize class EasybytezCom(Account): __name__ = "EasybytezCom" __type__ = "account" - __version__ = "0.05" + __version__ = "0.06" __description__ = """EasyBytez.com account plugin""" __author_name__ = ("zoidberg", "guidobelix") @@ -24,24 +24,26 @@ class EasybytezCom(Account): def loadAccountInfo(self, user, req): html = req.load("http://www.easybytez.com/?op=my_account", decode=True) - validuntil = -1 + validuntil = None trafficleft = None premium = False m = re.search(self.VALID_UNTIL_PATTERN, html) if m: + expiredate = m.group(1) + self.logDebug("Expire date: " + expiredate) + try: - expiredate = m.group(1) - self.logDebug("Expire date: " + expiredate) validuntil = mktime(strptime(expiredate, "%d %B %Y")) except Exception, e: self.logError(e) + + if validuntil > mktime(gmtime()): + premium = True + trafficleft = -1 else: - if validuntil > mktime(gmtime()): - premium = True - trafficleft = -1 - else: - premium = False + premium = False + validuntil = -1 m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: -- cgit v1.2.3 From 4a077f1ab66b201eb6e819ca3a8d18d54cc54cbf Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 26 Sep 2014 12:56:29 +0200 Subject: [TusfilesNet] Added support for Premium users https://github.com/pyload/pyload/pull/755 --- module/plugins/accounts/TusfilesNet.py | 69 ++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 module/plugins/accounts/TusfilesNet.py (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/TusfilesNet.py b/module/plugins/accounts/TusfilesNet.py new file mode 100644 index 000000000..d7cdbaebb --- /dev/null +++ b/module/plugins/accounts/TusfilesNet.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- + +import re + +from time import mktime, strptime, gmtime + +from module.plugins.Account import Account +from module.plugins.internal.SimpleHoster import parseHtmlForm +from module.utils import parseFileSize + + +class TusfilesNet(Account): + __name__ = "TusfilesNet" + __type__ = "account" + __version__ = "0.01" + + __description__ = """ Tusfile.net account plugin """ + __author_name__ = "guidobelix" + __author_mail__ = "guidobelix@hotmail.it" + + VALID_UNTIL_PATTERN = r'([^<]+)' + TRAFFIC_LEFT_PATTERN = r'\n (?P[^<]+)' + + + def loadAccountInfo(self, user, req): + html = req.load("http://www.tusfiles.net/?op=my_account", decode=True) + + validuntil = None + trafficleft = None + premium = False + + m = re.search(self.VALID_UNTIL_PATTERN, html) + if m: + expiredate = m.group(1) + self.logDebug("Expire date: " + expiredate) + + try: + validuntil = mktime(strptime(expiredate, "%d %B %Y")) + except Exception, e: + self.logError(e) + + if validuntil > mktime(gmtime()): + premium = True + else: + premium = False + validuntil = None + + m = re.search(self.TRAFFIC_LEFT_PATTERN, html) + if m: + trafficleft = m.group(1) + if "Unlimited" in trafficleft: + trafficleft = -1 + else: + trafficleft = parseFileSize(trafficleft) * 1024 + + return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} + + + def login(self, user, data, req): + html = req.load("http://www.tusfiles.net/login.html", decode=True) + action, inputs = parseHtmlForm('name="FL"', html) + inputs.update({'login': user, + 'password': data['password'], + 'redirect': "http://www.tusfiles.net/"}) + + html = req.load("http://www.tusfiles.net/", post=inputs, decode=True) + + if 'Incorrect Login or Password' in html or '>Error<' in html: + self.wrongPassword() -- cgit v1.2.3 From 0d220d634e512d89bda540f91c643b361c82ea8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 01:38:32 +0200 Subject: Logging string cosmetics --- module/plugins/accounts/DebridItaliaCom.py | 2 +- module/plugins/accounts/EgoFilesCom.py | 2 +- module/plugins/accounts/FilerNet.py | 2 +- module/plugins/accounts/FreeWayMe.py | 2 +- module/plugins/accounts/HellshareCz.py | 8 ++++---- module/plugins/accounts/LetitbitNet.py | 4 ++-- module/plugins/accounts/MyfastfileCom.py | 4 ++-- module/plugins/accounts/RealdebridCom.py | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/DebridItaliaCom.py b/module/plugins/accounts/DebridItaliaCom.py index f4441c356..bc0de31dc 100644 --- a/module/plugins/accounts/DebridItaliaCom.py +++ b/module/plugins/accounts/DebridItaliaCom.py @@ -27,7 +27,7 @@ class DebridItaliaCom(Account): validuntil = int(time.mktime(time.strptime(m.group('D'), "%d/%m/%Y %H:%M"))) return {"premium": True, "validuntil": validuntil, "trafficleft": -1} else: - self.logError('Unable to retrieve account information - Plugin may be out of date') + self.logError("Unable to retrieve account information - Plugin may be out of date") def login(self, user, data, req): self.html = req.load("http://debriditalia.com/login.php", diff --git a/module/plugins/accounts/EgoFilesCom.py b/module/plugins/accounts/EgoFilesCom.py index 41b58c4e7..fc263e776 100644 --- a/module/plugins/accounts/EgoFilesCom.py +++ b/module/plugins/accounts/EgoFilesCom.py @@ -30,7 +30,7 @@ class EgoFilesCom(Account): trafficleft = parseFileSize(m.group('T'), m.group('U')) / 1024 return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} else: - self.logError('Unable to retrieve account information - Plugin may be out of date') + self.logError("Unable to retrieve account information - Plugin may be out of date") def login(self, user, data, req): # Set English language diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py index 2e50298d7..cc00411d6 100644 --- a/module/plugins/accounts/FilerNet.py +++ b/module/plugins/accounts/FilerNet.py @@ -36,7 +36,7 @@ class FilerNet(Account): trafficleft = parseFileSize(traffic.group(1)) / 1024 return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} else: - self.logError('Unable to retrieve account information - Plugin may be out of date') + self.logError("Unable to retrieve account information - Plugin may be out of date") return {"premium": False, "validuntil": None, "trafficleft": None} def login(self, user, data, req): diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index fe5a79949..0132eb921 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -45,7 +45,7 @@ class FreeWayMe(Account): def getAccountStatus(self, user, req): answer = req.load("https://www.free-way.me/ajax/jd.php", get={"id": 4, "user": user, "pass": self.accounts[user]['password']}) - self.logDebug("login: %s" % answer) + self.logDebug("Login: %s" % answer) if answer == "Invalid login": self.wrongPassword() return False diff --git a/module/plugins/accounts/HellshareCz.py b/module/plugins/accounts/HellshareCz.py index 9207cddab..ac78bda8f 100644 --- a/module/plugins/accounts/HellshareCz.py +++ b/module/plugins/accounts/HellshareCz.py @@ -43,7 +43,7 @@ class HellshareCz(Account): trafficleft = int(credit) * 1024 validuntil = -1 except Exception, e: - self.logError('Unable to parse credit info', e) + self.logError("Unable to parse credit info", e) validuntil = -1 trafficleft = -1 @@ -53,14 +53,14 @@ class HellshareCz(Account): html = req.load('http://www.hellshare.com/') if req.lastEffectiveURL != 'http://www.hellshare.com/': #Switch to English - self.logDebug('Switch lang - URL: %s' % req.lastEffectiveURL) + self.logDebug("Switch lang - URL: %s" % req.lastEffectiveURL) json = req.load("%s?do=locRouter-show" % req.lastEffectiveURL) hash = re.search(r"(--[0-9a-f]+-)", json).group(1) - self.logDebug('Switch lang - HASH: %s' % hash) + self.logDebug("Switch lang - HASH: %s" % hash) html = req.load('http://www.hellshare.com/%s/' % hash) if re.search(self.CREDIT_LEFT_PATTERN, html): - self.logDebug('Already logged in') + self.logDebug("Already logged in") return html = req.load('http://www.hellshare.com/login?do=loginForm-submit', post={ diff --git a/module/plugins/accounts/LetitbitNet.py b/module/plugins/accounts/LetitbitNet.py index c849f9d2d..b3f9fb532 100644 --- a/module/plugins/accounts/LetitbitNet.py +++ b/module/plugins/accounts/LetitbitNet.py @@ -19,7 +19,7 @@ class LetitbitNet(Account): # api_key = self.accounts[user]['password'] # json_data = [api_key, ['key/info']] # api_rep = req.load('http://api.letitbit.net/json', post={'r': json_dumps(json_data)}) - # self.logDebug('API Key Info: ' + api_rep) + # self.logDebug("API Key Info: " + api_rep) # api_rep = json_loads(api_rep) # # if api_rep['status'] == 'FAIL': @@ -30,4 +30,4 @@ class LetitbitNet(Account): def login(self, user, data, req): # API_KEY is the username and the PREMIUM_KEY is the password - self.logInfo('You must use your API KEY as username and the PREMIUM KEY as password.') + self.logInfo("You must use your API KEY as username and the PREMIUM KEY as password.") diff --git a/module/plugins/accounts/MyfastfileCom.py b/module/plugins/accounts/MyfastfileCom.py index 8db9c9ade..bd566330e 100644 --- a/module/plugins/accounts/MyfastfileCom.py +++ b/module/plugins/accounts/MyfastfileCom.py @@ -19,13 +19,13 @@ class MyfastfileCom(Account): validuntil = int(time() + self.json_data['days_left'] * 24 * 60 * 60) return {"premium": True, "validuntil": validuntil, "trafficleft": -1} else: - self.logError('Unable to get account information') + self.logError("Unable to get account information") def login(self, user, data, req): # Password to use is the API-Password written in http://myfastfile.com/myaccount html = req.load("http://myfastfile.com/api.php", get={"user": user, "pass": data['password']}) - self.logDebug('JSON data: ' + html) + self.logDebug("JSON data: " + html) self.json_data = json_loads(html) if self.json_data['status'] != 'ok': self.logError('Invalid login. The password to use is the API-Password you find in your "My Account" page') diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py index 9d1939c60..4305c47c6 100644 --- a/module/plugins/accounts/RealdebridCom.py +++ b/module/plugins/accounts/RealdebridCom.py @@ -31,5 +31,5 @@ class RealdebridCom(Account): if "Your login informations are incorrect" in page: self.wrongPassword() elif "PIN Code required" in page: - self.logWarning('PIN code required. Please login to https://real-debrid.com using the PIN or disable the double authentication in your control panel on https://real-debrid.com.') + self.logWarning("PIN code required. Please login to https://real-debrid.com using the PIN or disable the double authentication in your control panel on https://real-debrid.com.") self.pin_code = True -- cgit v1.2.3