From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/accounts/AlldebridCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index acfb6874a..ee0a2ff28 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -33,7 +33,7 @@ class AlldebridCom(Account): except: data = self.getAccountData(user) page = req.load("http://www.alldebrid.com/api.php?action=info_user&login=%s&pw=%s" % (user, - data["password"])) + data['password'])) self.logDebug(page) xml = dom.parseString(page) exp_time = time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60 @@ -41,7 +41,7 @@ class AlldebridCom(Account): return account_info def login(self, user, data, req): - urlparams = urllib.urlencode({'action': 'login', 'login_login': user, 'login_password': data["password"]}) + urlparams = urllib.urlencode({'action': 'login', 'login_login': user, 'login_password': data['password']}) page = req.load("http://www.alldebrid.com/register/?%s" % urlparams) if "This login doesn't exist" in page: -- cgit v1.2.3 From 8e47b0de30a25d0fd5dfb518bfe4e1e7beff93fd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:27:44 +0200 Subject: Key attributes cleanup for account, container and crypter plugins --- module/plugins/accounts/AlldebridCom.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index ee0a2ff28..122d23447 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -13,10 +13,12 @@ class AlldebridCom(Account): __name__ = "AlldebridCom" __version__ = "0.22" __type__ = "account" + __description__ = """AllDebrid.com account plugin""" __author_name__ = "Andy Voigt" __author_mail__ = "spamsales@online.de" + def loadAccountInfo(self, user, req): data = self.getAccountData(user) page = req.load("http://www.alldebrid.com/account/") -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/accounts/AlldebridCom.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'module/plugins/accounts/AlldebridCom.py') diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py index 122d23447..dbf4ad800 100644 --- a/module/plugins/accounts/AlldebridCom.py +++ b/module/plugins/accounts/AlldebridCom.py @@ -1,18 +1,20 @@ # -*- coding: utf-8 -*- +import re import xml.dom.minidom as dom + from time import time -import re -import urllib +from urllib import urlencode -from module.plugins.Account import Account from BeautifulSoup import BeautifulSoup +from module.plugins.Account import Account + class AlldebridCom(Account): __name__ = "AlldebridCom" - __version__ = "0.22" __type__ = "account" + __version__ = "0.22" __description__ = """AllDebrid.com account plugin""" __author_name__ = "Andy Voigt" @@ -23,7 +25,7 @@ class AlldebridCom(Account): data = self.getAccountData(user) page = req.load("http://www.alldebrid.com/account/") soup = BeautifulSoup(page) - #Try to parse expiration date directly from the control panel page (better accuracy) + #Try to parse expiration date directly from the control panel page (better accuracy) try: time_text = soup.find('div', attrs={'class': 'remaining_time_text'}).strong.string self.logDebug("Account expires in: %s" % time_text) @@ -43,7 +45,7 @@ class AlldebridCom(Account): return account_info def login(self, user, data, req): - urlparams = urllib.urlencode({'action': 'login', 'login_login': user, 'login_password': data['password']}) + urlparams = urlencode({'action': 'login', 'login_login': user, 'login_password': data['password']}) page = req.load("http://www.alldebrid.com/register/?%s" % urlparams) if "This login doesn't exist" in page: -- cgit v1.2.3