summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/OronCom.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-10-09 20:12:20 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-10-09 20:12:20 +0200
commit98a9f43b5585efbe6b69622040a602089c93f58a (patch)
treebf538c28d15dc7d347fe0545528260db6637513a /module/plugins/accounts/OronCom.py
parentMerged in mineo/pyload (pull request #1) (diff)
downloadpyload-98a9f43b5585efbe6b69622040a602089c93f58a.tar.xz
closed #400
Diffstat (limited to 'module/plugins/accounts/OronCom.py')
-rw-r--r--module/plugins/accounts/OronCom.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/module/plugins/accounts/OronCom.py b/module/plugins/accounts/OronCom.py
new file mode 100644
index 000000000..4e4d26e7c
--- /dev/null
+++ b/module/plugins/accounts/OronCom.py
@@ -0,0 +1,47 @@
+# -*- coding: utf-8 -*-
+
+"""
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License,
+ or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+ @author: DHMH
+"""
+
+from module.plugins.Account import Account
+import re
+from time import strptime, mktime
+
+class OronCom(Account):
+ __name__ = "OronCom"
+ __version__ = "0.1"
+ __type__ = "account"
+ __description__ = """oron.com account plugin"""
+ __author_name__ = ("DHMH")
+ __author_mail__ = ("webmaster@pcProfil.de")
+
+ def loadAccountInfo(self, user, req):
+ req.load("http://oron.com/?op=change_lang&lang=german")
+ src = req.load("http://oron.com/?op=my_account").replace("\n", "")
+ validuntil = re.search(r"<td>Premiumaccount läuft bis:</td>\s*<td>(.*?)</td>", src).group(1)
+ validuntil = int(mktime(strptime(validuntil, "%d %B %Y")))
+ trafficleft = re.search(r'<td>Download Traffic verfügbar:</td>\s*<td>(.*?)</td>', src).group(1)
+ self.logDebug("Oron left: " + trafficleft)
+ trafficleft = int(self.parseTraffic(trafficleft))
+ tmp = {"validuntil": validuntil, "trafficleft": trafficleft}
+ return tmp
+
+ def login(self, user, data, req):
+ req.load("http://oron.com/?op=change_lang&lang=german")
+ page = req.load("http://oron.com/login", post={"login": user, "password": data["password"], "op": "login"})
+ if r'<b class="err">Login oder Passwort falsch</b>' in page:
+ self.wrongPassword()