summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/AlldebridCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-07 23:40:50 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 10:58:42 +0200
commit887ad58e4c6c20b992311bbdf931bcd18e73d384 (patch)
treef31beb241bacca0bfea4c1acc4e9ace813755cef /module/plugins/accounts/AlldebridCom.py
parent[AccountManager] Fixed #733 (diff)
parent[File4safe] distributing LINK_PATTERN (diff)
downloadpyload-887ad58e4c6c20b992311bbdf931bcd18e73d384.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: module/plugins/Account.py module/plugins/AccountManager.py module/plugins/Hook.py module/plugins/OCR.py module/plugins/Plugin.py module/plugins/PluginManager.py module/plugins/ReCaptcha.py module/plugins/accounts/Ftp.py module/plugins/accounts/Http.py module/plugins/internal/MultiHoster.py module/plugins/ocr/GigasizeCom.py module/plugins/ocr/LinksaveIn.py module/plugins/ocr/NetloadIn.py module/plugins/ocr/ShareonlineBiz.py
Diffstat (limited to 'module/plugins/accounts/AlldebridCom.py')
-rw-r--r--module/plugins/accounts/AlldebridCom.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py
index acfb6874a..dbf4ad800 100644
--- a/module/plugins/accounts/AlldebridCom.py
+++ b/module/plugins/accounts/AlldebridCom.py
@@ -1,27 +1,31 @@
# -*- 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"
__author_mail__ = "spamsales@online.de"
+
def loadAccountInfo(self, user, req):
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)
@@ -33,7 +37,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 +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: