diff options
Diffstat (limited to 'pyload/plugin/account')
33 files changed, 123 insertions, 118 deletions
diff --git a/pyload/plugin/account/AlldebridCom.py b/pyload/plugin/account/AlldebridCom.py index 7fc11e343..75ac430f1 100644 --- a/pyload/plugin/account/AlldebridCom.py +++ b/pyload/plugin/account/AlldebridCom.py @@ -1,10 +1,9 @@ # -*- coding: utf-8 -*- import re +import time import xml.dom.minidom as dom -from time import time - from BeautifulSoup import BeautifulSoup from pyload.plugin.Account import Account @@ -33,7 +32,7 @@ class AlldebridCom(Account): p = re.compile('\d+') exp_data = p.findall(time_text) - exp_time = time() + int(exp_data[0]) * 24 * 60 * 60 + int( + exp_time = time.time() + int(exp_data[0]) * 24 * 60 * 60 + int( exp_data[1]) * 60 * 60 + (int(exp_data[2]) - 1) * 60 #Get expiration date from API @@ -45,7 +44,7 @@ class AlldebridCom(Account): self.logDebug(html) xml = dom.parseString(html) - exp_time = time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60 + exp_time = time.time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60 account_info = {"validuntil": exp_time, "trafficleft": -1} return account_info diff --git a/pyload/plugin/account/BitshareCom.py b/pyload/plugin/account/BitshareCom.py index 4774b9062..7d7b18ff4 100644 --- a/pyload/plugin/account/BitshareCom.py +++ b/pyload/plugin/account/BitshareCom.py @@ -28,7 +28,6 @@ class BitshareCom(Account): def login(self, user, data, req): html = req.load("http://bitshare.com/login.html", post={"user": user, "password": data['password'], "submit": "Login"}, - cookies=True, decode=True) if "login" in req.lastEffectiveURL: diff --git a/pyload/plugin/account/CatShareNet.py b/pyload/plugin/account/CatShareNet.py index a604ebff1..0dcd4a7ad 100644 --- a/pyload/plugin/account/CatShareNet.py +++ b/pyload/plugin/account/CatShareNet.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import mktime, strptime +import time from pyload.plugin.Account import Account @@ -36,7 +35,7 @@ class CatShareNet(Account): expiredate = re.search(self.VALID_UNTIL_PATTERN, html).group(1) self.logDebug("Expire date: " + expiredate) - validuntil = mktime(strptime(expiredate, "%Y-%m-%d %H:%M:%S")) + validuntil = time.mktime(time.strptime(expiredate, "%Y-%m-%d %H:%M:%S")) except Exception: pass diff --git a/pyload/plugin/account/CzshareCom.py b/pyload/plugin/account/CzshareCom.py index dfe78c21c..c57e8195b 100644 --- a/pyload/plugin/account/CzshareCom.py +++ b/pyload/plugin/account/CzshareCom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime import re +import time from pyload.plugin.Account import Account @@ -30,7 +30,7 @@ class CzshareCom(Account): try: m = re.search(self.CREDIT_LEFT_PATTERN, html) trafficleft = self.parseTraffic(m.group(1).replace(' ', '').replace(',', '.')) + m.group(2) - validuntil = mktime(strptime(m.group(3), '%d.%m.%y %H:%M')) + validuntil = time.mktime(time.strptime(m.group(3), '%d.%m.%y %H:%M')) except Exception, e: self.logError(e) diff --git a/pyload/plugin/account/DebridItaliaCom.py b/pyload/plugin/account/DebridItaliaCom.py index de97f6e64..563a7c531 100644 --- a/pyload/plugin/account/DebridItaliaCom.py +++ b/pyload/plugin/account/DebridItaliaCom.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import mktime, strptime +import time from pyload.plugin.Account import Account @@ -28,7 +27,7 @@ class DebridItaliaCom(Account): if 'Account premium not activated' not in html: m = re.search(self.WALID_UNTIL_PATTERN, html) if m: - validuntil = mktime(strptime(m.group(1), "%d/%m/%Y %H:%M")) + validuntil = time.mktime(time.strptime(m.group(1), "%d/%m/%Y %H:%M")) info = {'premium': True, 'validuntil': validuntil, 'trafficleft': -1} else: self.logError(_("Unable to retrieve account information")) diff --git a/pyload/plugin/account/DepositfilesCom.py b/pyload/plugin/account/DepositfilesCom.py index b3e896d31..28d2178c4 100644 --- a/pyload/plugin/account/DepositfilesCom.py +++ b/pyload/plugin/account/DepositfilesCom.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import strptime, mktime +import time from pyload.plugin.Account import Account @@ -23,7 +22,7 @@ class DepositfilesCom(Account): html = req.load("https://dfiles.eu/de/gold/") validuntil = re.search(r"Sie haben Gold Zugang bis: <b>(.*?)</b></div>", html).group(1) - validuntil = mktime(strptime(validuntil, "%Y-%m-%d %H:%M:%S")) + validuntil = time.mktime(time.strptime(validuntil, "%Y-%m-%d %H:%M:%S")) return {"validuntil": validuntil, "trafficleft": -1} diff --git a/pyload/plugin/account/DropboxCom.py b/pyload/plugin/account/DropboxCom.py index 862b7a8df..d18504926 100644 --- a/pyload/plugin/account/DropboxCom.py +++ b/pyload/plugin/account/DropboxCom.py @@ -11,6 +11,7 @@ class DropboxCom(SimpleHoster): __version__ = "0.04" __pattern__ = r'https?://(?:www\.)?dropbox\.com/.+' + __config__ = [("use_premium", "bool", "Use premium account if available", True)] __description__ = """Dropbox.com hoster plugin""" __license__ = "GPLv3" diff --git a/pyload/plugin/account/EuroshareEu.py b/pyload/plugin/account/EuroshareEu.py index b37fc68fa..6fa9f35b0 100644 --- a/pyload/plugin/account/EuroshareEu.py +++ b/pyload/plugin/account/EuroshareEu.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime import re +import time from pyload.plugin.Account import Account @@ -25,7 +25,7 @@ class EuroshareEu(Account): premium, validuntil = False, -1 else: premium = True - validuntil = mktime(strptime(m.group(1), "%d.%m.%Y %H:%M")) + validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y %H:%M")) return {"validuntil": validuntil, "trafficleft": -1, "premium": premium} diff --git a/pyload/plugin/account/FastshareCz.py b/pyload/plugin/account/FastshareCz.py index 8fe98438b..ce79e26ad 100644 --- a/pyload/plugin/account/FastshareCz.py +++ b/pyload/plugin/account/FastshareCz.py @@ -9,7 +9,7 @@ from pyload.utils import parseFileSize class FastshareCz(Account): __name__ = "FastshareCz" __type__ = "account" - __version__ = "0.05" + __version__ = "0.06" __description__ = """Fastshare.cz account plugin""" __license__ = "GPLv3" @@ -17,13 +17,13 @@ class FastshareCz(Account): ("stickell", "l.stickell@yahoo.it")] - CREDIT_PATTERN = r'My account\s*\((.+?)\)' + CREDIT_PATTERN = r'Credit\s*:\s*</td>\s*<td>(.+?)\s*<' def loadAccountInfo(self, user, req): - validuntil = None + validuntil = -1 trafficleft = None - premium = None + premium = False html = req.load("http://www.fastshare.cz/user", decode=True) @@ -31,13 +31,11 @@ class FastshareCz(Account): if m: trafficleft = self.parseTraffic(m.group(1)) - if trafficleft: - premium = True - validuntil = -1 - else: - premium = False + premium = bool(trafficleft) - return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} + return {'validuntil' : validuntil, + 'trafficleft': trafficleft, + 'premium' : premium} def login(self, user, data, req): diff --git a/pyload/plugin/account/FilefactoryCom.py b/pyload/plugin/account/FilefactoryCom.py index 3395b3f90..36720595f 100644 --- a/pyload/plugin/account/FilefactoryCom.py +++ b/pyload/plugin/account/FilefactoryCom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import re -from time import mktime, strptime +import time from pycurl import REFERER @@ -29,7 +29,7 @@ class FilefactoryCom(Account): if m: premium = True validuntil = re.sub(self.VALID_UNTIL_PATTERN, '\g<D> \g<M> \g<Y>', m.group(0)) - validuntil = mktime(strptime(validuntil, "%d %b %Y")) + validuntil = time.mktime(time.strptime(validuntil, "%d %b %Y")) else: premium = False validuntil = -1 diff --git a/pyload/plugin/account/FilejungleCom.py b/pyload/plugin/account/FilejungleCom.py index 2c476bffb..dfa7edddb 100644 --- a/pyload/plugin/account/FilejungleCom.py +++ b/pyload/plugin/account/FilejungleCom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import re -from time import mktime, strptime +import time from pyload.plugin.Account import Account @@ -28,7 +28,7 @@ class FilejungleCom(Account): m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: premium = True - validuntil = mktime(strptime(m.group(1), "%d %b %Y")) + validuntil = time.mktime(time.strptime(m.group(1), "%d %b %Y")) else: premium = False validuntil = -1 diff --git a/pyload/plugin/account/FilesMailRu.py b/pyload/plugin/account/FilesMailRu.py index e6afd0168..5989b5f1a 100644 --- a/pyload/plugin/account/FilesMailRu.py +++ b/pyload/plugin/account/FilesMailRu.py @@ -25,7 +25,6 @@ class FilesMailRu(Account): "Login": user, "Password": data['password'], "Page": "http://files.mail.ru/"}, - cookies=True, decode=True) if "Неверное имя пользователя или пароль" in html: diff --git a/pyload/plugin/account/FileserveCom.py b/pyload/plugin/account/FileserveCom.py index 9aab88d2b..08dfe24c7 100644 --- a/pyload/plugin/account/FileserveCom.py +++ b/pyload/plugin/account/FileserveCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime +import time from pyload.plugin.Account import Account from pyload.utils import json_loads @@ -24,7 +24,7 @@ class FileserveCom(Account): res = json_loads(html) if res['type'] == "premium": - validuntil = mktime(strptime(res['expireTime'], "%Y-%m-%d %H:%M:%S")) + validuntil = time.mktime(time.strptime(res['expireTime'], "%Y-%m-%d %H:%M:%S")) return {"trafficleft": res['traffic'], "validuntil": validuntil} else: return {"premium": False, "trafficleft": None, "validuntil": None} diff --git a/pyload/plugin/account/FreakshareCom.py b/pyload/plugin/account/FreakshareCom.py index 9c61ac513..5aef6f86c 100644 --- a/pyload/plugin/account/FreakshareCom.py +++ b/pyload/plugin/account/FreakshareCom.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import strptime, mktime +import time from pyload.plugin.Account import Account @@ -26,7 +25,7 @@ class FreakshareCom(Account): try: m = re.search(r'ltig bis:</td>\s*<td><b>([\d.:-]+)</b></td>', html, re.M) - validuntil = mktime(strptime(m.group(1).strip(), "%d.%m.%Y - %H:%M")) + validuntil = time.mktime(time.strptime(m.group(1).strip(), "%d.%m.%Y - %H:%M")) except Exception: pass @@ -46,7 +45,6 @@ class FreakshareCom(Account): html = req.load("http://freakshare.com/login.html", post={"submit": "Login", "user": user, "pass": data['password']}, - cookies=True, decode=True) if ">Wrong Username or Password" in html: diff --git a/pyload/plugin/account/FshareVn.py b/pyload/plugin/account/FshareVn.py index 282a17751..539a739df 100644 --- a/pyload/plugin/account/FshareVn.py +++ b/pyload/plugin/account/FshareVn.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import mktime, strptime +import time from pyload.plugin.Account import Account @@ -35,7 +34,7 @@ class FshareVn(Account): m = re.search(self.VALID_UNTIL_PATTERN, html) if m: premium = True - validuntil = mktime(strptime(m.group(1), '%I:%M:%S %p %d-%m-%Y')) + validuntil = time.mktime(time.strptime(m.group(1), '%I:%M:%S %p %d-%m-%Y')) trafficleft = self.getTrafficLeft() else: premium = False diff --git a/pyload/plugin/account/MegaRapidCz.py b/pyload/plugin/account/MegaRapidCz.py index 5596fd623..cdb5c732b 100644 --- a/pyload/plugin/account/MegaRapidCz.py +++ b/pyload/plugin/account/MegaRapidCz.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- import re +import time -from time import mktime, strptime from pyload.plugin.Account import Account @@ -34,7 +34,7 @@ class MegaRapidCz(Account): m = re.search(self.VALID_UNTIL_PATTERN, htmll) if m: - validuntil = mktime(strptime(m.group(1), "%d.%m.%Y - %H:%M")) + 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) diff --git a/pyload/plugin/account/MegasharesCom.py b/pyload/plugin/account/MegasharesCom.py index 53b854f65..7c5d0d357 100644 --- a/pyload/plugin/account/MegasharesCom.py +++ b/pyload/plugin/account/MegasharesCom.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import re -from time import mktime, strptime +import time from pyload.plugin.Account import Account @@ -29,7 +29,7 @@ class MegasharesCom(Account): try: timestr = re.search(self.VALID_UNTIL_PATTERN, html).group(1) self.logDebug(timestr) - validuntil = mktime(strptime(timestr, "%b %d, %Y")) + validuntil = time.mktime(time.strptime(timestr, "%b %d, %Y")) except Exception, e: self.logError(e) diff --git a/pyload/plugin/account/MyfastfileCom.py b/pyload/plugin/account/MyfastfileCom.py index 838a1eefd..350d77c57 100644 --- a/pyload/plugin/account/MyfastfileCom.py +++ b/pyload/plugin/account/MyfastfileCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from time import time +import time from pyload.plugin.Account import Account from pyload.utils import json_loads @@ -18,7 +18,7 @@ class MyfastfileCom(Account): def loadAccountInfo(self, user, req): if 'days_left' in self.json_data: - validuntil = time() + self.json_data['days_left'] * 24 * 60 * 60 + validuntil = time.time() + self.json_data['days_left'] * 24 * 60 * 60 return {"premium": True, "validuntil": validuntil, "trafficleft": -1} else: self.logError(_("Unable to get account information")) diff --git a/pyload/plugin/account/NetloadIn.py b/pyload/plugin/account/NetloadIn.py index 68982e828..bec4690a8 100644 --- a/pyload/plugin/account/NetloadIn.py +++ b/pyload/plugin/account/NetloadIn.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import re -from time import time +import time from pyload.plugin.Account import Account @@ -9,36 +9,55 @@ from pyload.plugin.Account import Account class NetloadIn(Account): __name__ = "NetloadIn" __type__ = "account" - __version__ = "0.23" + __version__ = "0.24" __description__ = """Netload.in account plugin""" __license__ = "GPLv3" - __authors__ = [("RaNaN", "RaNaN@pyload.org"), - ("CryNickSystems", "webmaster@pcProfil.de")] + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + def api_response(self, id, password, req): + return req.load("http://api.netload.in/user_info.php", + get={'auth' : "BVm96BWDSoB4WkfbEhn42HgnjIe1ilMt", + 'user_id' : id, + 'user_password': password}).strip() def loadAccountInfo(self, user, req): - html = req.load("http://netload.in/index.php", get={'id': 2, 'lang': "de"}) - left = r'>(\d+) (Tag|Tage), (\d+) Stunden<' - left = re.search(left, html) - if left: - validuntil = time() + int(left.group(1)) * 24 * 60 * 60 + int(left.group(3)) * 60 * 60 - trafficleft = -1 + validuntil = None + trafficleft = -1 + premium = False + + html = self.api_response(user, self.getAccountData(user)['password'], req) + + if html == "-1": premium = True + + elif html == "0": + validuntil = -1 + else: - validuntil = None - premium = False - trafficleft = None - return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium} + try: + validuntil = time.mktime(time.strptime(html, "%Y-%m-%d %H:%M")) + + except Exception, e: + self.logError(e) + + else: + self.logDebug("Valid until: %s" % validuntil) + + if validuntil > time.mktime(time.gmtime()): + premium = True + else: + validuntil = -1 + + return {'validuntil' : validuntil, + 'trafficleft': trafficleft, + 'premium' : premium} def login(self, user, data, req): - html = req.load("http://netload.in/index.php", - post={"txtuser" : user, - "txtpass" : data['password'], - "txtcheck": "login", - "txtlogin": "Login"}, - cookies=True, - decode=True) - if "password or it might be invalid!" in html: + html = self.api_response(user, data['password'], req) + + if not html or re.search(r'disallowed_agent|unknown_auth|login_failed', html): self.wrongPassword() diff --git a/pyload/plugin/account/NoPremiumPl.py b/pyload/plugin/account/NoPremiumPl.py index 929e8f7d9..49f20b1f2 100644 --- a/pyload/plugin/account/NoPremiumPl.py +++ b/pyload/plugin/account/NoPremiumPl.py @@ -1,9 +1,8 @@ # -*- coding: utf-8 -*- +import datetime import hashlib - -from datetime import datetime -from time import mktime +import time from pyload.plugin.Account import Account from pyload.utils import json_loads @@ -45,7 +44,7 @@ class NoPremiumPl(Account): if "expire" in result.keys() and result["expire"]: premium = True - valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) + valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result["expire"])).timetuple()) traffic_left = result["balance"] * 1024 return ({ diff --git a/pyload/plugin/account/NowVideoSx.py b/pyload/plugin/account/NowVideoSx.py index 8359e0410..3c63149ae 100644 --- a/pyload/plugin/account/NowVideoSx.py +++ b/pyload/plugin/account/NowVideoSx.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import gmtime, mktime, strptime +import time from pyload.plugin.Account import Account @@ -33,13 +32,13 @@ class NowVideoSx(Account): self.logDebug("Expire date: " + expiredate) try: - validuntil = mktime(strptime(expiredate, "%Y-%b-%d")) + validuntil = time.mktime(time.strptime(expiredate, "%Y-%b-%d")) except Exception, e: self.logError(e) else: - if validuntil > mktime(gmtime()): + if validuntil > time.mktime(time.gmtime()): premium = True else: premium = False diff --git a/pyload/plugin/account/OneFichierCom.py b/pyload/plugin/account/OneFichierCom.py index 65ec841c4..0c37654ca 100644 --- a/pyload/plugin/account/OneFichierCom.py +++ b/pyload/plugin/account/OneFichierCom.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import strptime, mktime +import time from pycurl import REFERER @@ -36,7 +35,7 @@ class OneFichierCom(Account): self.logDebug("Expire date: " + expiredate) try: - validuntil = mktime(strptime(expiredate, "%d/%m/%Y")) + validuntil = time.mktime(time.strptime(expiredate, "%d/%m/%Y")) except Exception, e: self.logError(e) else: diff --git a/pyload/plugin/account/OverLoadMe.py b/pyload/plugin/account/OverLoadMe.py index d945dd7bd..8677ecf47 100644 --- a/pyload/plugin/account/OverLoadMe.py +++ b/pyload/plugin/account/OverLoadMe.py @@ -15,7 +15,7 @@ class OverLoadMe(Account): def loadAccountInfo(self, user, req): - https = "https" if self.getConfig("ssl") else "http" + https = "https" if self.getConfig('ssl') else "http" data = self.getAccountData(user) html = req.load(https + "://api.over-load.me/account.php", get={'user': user, @@ -32,7 +32,7 @@ class OverLoadMe(Account): def login(self, user, data, req): - https = "https" if self.getConfig("ssl") else "http" + https = "https" if self.getConfig('ssl') else "http" jsondata = req.load(https + "://api.over-load.me/account.php", get={'user': user, 'auth': data['password']}).strip() diff --git a/pyload/plugin/account/RapideoPl.py b/pyload/plugin/account/RapideoPl.py index b4b74fab5..f14e222c3 100644 --- a/pyload/plugin/account/RapideoPl.py +++ b/pyload/plugin/account/RapideoPl.py @@ -1,9 +1,8 @@ # -*- coding: utf-8 -*- +import datetime import hashlib - -from datetime import datetime -from time import mktime +import time from pyload.plugin.Account import Account from pyload.utils import json_loads @@ -44,7 +43,7 @@ class RapideoPl(Account): valid_untill = -1 if "expire" in result.keys() and result["expire"]: premium = True - valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) + valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result["expire"])).timetuple()) traffic_left = result["balance"] diff --git a/pyload/plugin/account/RapiduNet.py b/pyload/plugin/account/RapiduNet.py index 5c165f486..b03bde6e0 100644 --- a/pyload/plugin/account/RapiduNet.py +++ b/pyload/plugin/account/RapiduNet.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import time +import time from pyload.plugin.Account import Account from pyload.utils import json_loads @@ -38,7 +37,7 @@ class RapiduNet(Account): m = re.search(self.VALID_UNTIL_PATTERN, html) if m: - validuntil = time() + (86400 * int(m.group(1))) + validuntil = time.time() + (86400 * int(m.group(1))) m = re.search(self.TRAFFIC_LEFT_PATTERN, html) if m: diff --git a/pyload/plugin/account/SimplydebridCom.py b/pyload/plugin/account/SimplydebridCom.py index a826e44c7..1d5ba201c 100644 --- a/pyload/plugin/account/SimplydebridCom.py +++ b/pyload/plugin/account/SimplydebridCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime +import time from pyload.plugin.Account import Account @@ -22,7 +22,7 @@ class SimplydebridCom(Account): if str(data[0]) != "1": return {"premium": False} else: - return {"trafficleft": -1, "validuntil": mktime(strptime(str(data[2]), "%d/%m/%Y"))} + return {"trafficleft": -1, "validuntil": time.mktime(time.strptime(str(data[2]), "%d/%m/%Y"))} def login(self, user, data, req): diff --git a/pyload/plugin/account/SmoozedCom.py b/pyload/plugin/account/SmoozedCom.py index 27249c7c2..686903553 100644 --- a/pyload/plugin/account/SmoozedCom.py +++ b/pyload/plugin/account/SmoozedCom.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- import hashlib +import time from beaker.crypto.pbkdf2 import PBKDF2 -from time import time from pyload.utils import json_loads from pyload.plugin.Account import Account @@ -36,7 +36,7 @@ class SmoozedCom(Account): 'session' : status["data"]["session_key"], 'hosters' : [hoster["name"] for hoster in status["data"]["hoster"]]} - if info['validuntil'] < time(): + if info['validuntil'] < time.time(): info['premium'] = False else: info['premium'] = True diff --git a/pyload/plugin/account/TurbobitNet.py b/pyload/plugin/account/TurbobitNet.py index e3c07da2a..d00f4c0e4 100644 --- a/pyload/plugin/account/TurbobitNet.py +++ b/pyload/plugin/account/TurbobitNet.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import re -from time import mktime, strptime +import time from pyload.plugin.Account import Account @@ -22,7 +22,7 @@ class TurbobitNet(Account): m = re.search(r'<u>Turbo Access</u> to ([\d.]+)', html) if m: premium = True - validuntil = mktime(strptime(m.group(1), "%d.%m.%Y")) + validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y")) else: premium = False validuntil = -1 diff --git a/pyload/plugin/account/TusfilesNet.py b/pyload/plugin/account/TusfilesNet.py index 84e9ef9c6..48f70b4f3 100644 --- a/pyload/plugin/account/TusfilesNet.py +++ b/pyload/plugin/account/TusfilesNet.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import mktime, strptime, gmtime +import time from pyload.plugin.internal.XFSAccount import XFSAccount diff --git a/pyload/plugin/account/UploadedTo.py b/pyload/plugin/account/UploadedTo.py index 3b0d957a5..37900c7d3 100644 --- a/pyload/plugin/account/UploadedTo.py +++ b/pyload/plugin/account/UploadedTo.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import re -from time import time +import time from pyload.plugin.Account import Account @@ -39,7 +39,7 @@ class UploadedTo(Account): else: m = re.findall(r'(\d+) (week|day|hour)', expiredate) if m: - validuntil = time() + validuntil = time.time() for n, u in m: validuntil += float(n) * 60 * 60 * {'week': 168, 'day': 24, 'hour': 1}[u] diff --git a/pyload/plugin/account/UploadingCom.py b/pyload/plugin/account/UploadingCom.py index 6d54469e8..e1f0d07f7 100644 --- a/pyload/plugin/account/UploadingCom.py +++ b/pyload/plugin/account/UploadingCom.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from time import time, strptime, mktime +import time from pyload.plugin.Account import Account from pyload.plugin.internal.SimpleHoster import set_cookies @@ -11,7 +10,7 @@ from pyload.plugin.internal.SimpleHoster import set_cookies class UploadingCom(Account): __name__ = "UploadingCom" __type__ = "account" - __version__ = "0.11" + __version__ = "0.12" __description__ = """Uploading.com account plugin""" __license__ = "GPLv3" @@ -37,27 +36,30 @@ class UploadingCom(Account): self.logDebug("Expire date: " + expiredate) try: - validuntil = mktime(strptime(expiredate, "%b %d, %Y")) + validuntil = time.mktime(time.strptime(expiredate, "%b %d, %Y")) except Exception, e: self.logError(e) else: - if validuntil > mktime(gmtime()): - premium = True + if validuntil > time.mktime(time.gmtime()): + premium = True else: - premium = False + premium = False validuntil = None - return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium} + return {'validuntil' : validuntil, + 'trafficleft': trafficleft, + 'premium' : premium} def login(self, user, data, req): - set_cookies([("uploading.com", "lang", "1"), - ("uploading.com", "language", "1"), - ("uploading.com", "setlang", "en"), - ("uploading.com", "_lang", "en")] + set_cookies(req.cj, + [("uploading.com", "lang" , "1" ), + ("uploading.com", "language", "1" ), + ("uploading.com", "setlang" , "en"), + ("uploading.com", "_lang" , "en")]) req.load("http://uploading.com/") - req.load("http://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time() * 1000), + req.load("http://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time.time() * 1000), post={'email': user, 'password': data['password'], 'remember': "on"}) diff --git a/pyload/plugin/account/WebshareCz.py b/pyload/plugin/account/WebshareCz.py index efa2a0045..5384134ad 100644 --- a/pyload/plugin/account/WebshareCz.py +++ b/pyload/plugin/account/WebshareCz.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- import re +import time from hashlib import md5, sha1 from passlib.hash import md5_crypt -from time import mktime, strptime, time from pyload.plugin.Account import Account @@ -34,9 +34,9 @@ class WebshareCz(Account): expiredate = re.search(self.VALID_UNTIL_PATTERN, html).group(1) self.logDebug("Expire date: " + expiredate) - validuntil = mktime(strptime(expiredate, "%Y-%m-%d %H:%M:%S")) + validuntil = time.mktime(time.strptime(expiredate, "%Y-%m-%d %H:%M:%S")) trafficleft = self.parseTraffic(re.search(self.TRAFFIC_LEFT_PATTERN, html).group(1)) - premium = validuntil > time() + premium = validuntil > time.time() return {'validuntil': validuntil, 'trafficleft': -1, 'premium': premium} diff --git a/pyload/plugin/account/ZeveraCom.py b/pyload/plugin/account/ZeveraCom.py index db23170f3..0e6d50a9b 100644 --- a/pyload/plugin/account/ZeveraCom.py +++ b/pyload/plugin/account/ZeveraCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from time import mktime, strptime +import time from pyload.plugin.Account import Account @@ -40,7 +40,7 @@ class ZeveraCom(Account): api = self.api_response(req) if "No trafic" not in api and api['endsubscriptiondate'] != "Expired!": - validuntil = mktime(strptime(api['endsubscriptiondate'], "%Y/%m/%d %H:%M:%S")) + validuntil = time.mktime(time.strptime(api['endsubscriptiondate'], "%Y/%m/%d %H:%M:%S")) trafficleft = float(api['availabletodaytraffic']) * 1024 if api['orondaytrafficlimit'] != '0' else -1 premium = True |