summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-09-18 17:59:50 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-09-18 17:59:50 +0200
commit6130a2377ca6754fee88773097ce220abef1aa47 (patch)
tree76bea0d76393100fcf393c164c96d34f286aba7a /module/plugins/accounts
parentAdded DuckcryptInfo decrypter, smaller fixes (diff)
parentdropdowns in navbar (diff)
downloadpyload-6130a2377ca6754fee88773097ce220abef1aa47.tar.xz
merged stable into default
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r--module/plugins/accounts/FilesonicCom.py13
-rwxr-xr-xmodule/plugins/accounts/OronCom.py12
-rw-r--r--module/plugins/accounts/Premium4Me.py24
-rw-r--r--module/plugins/accounts/RealdebridCom.py60
-rw-r--r--module/plugins/accounts/RyushareCom.py3
-rw-r--r--module/plugins/accounts/ShareonlineBiz.py66
6 files changed, 107 insertions, 71 deletions
diff --git a/module/plugins/accounts/FilesonicCom.py b/module/plugins/accounts/FilesonicCom.py
index 1207f1b56..1b0104b2a 100644
--- a/module/plugins/accounts/FilesonicCom.py
+++ b/module/plugins/accounts/FilesonicCom.py
@@ -37,10 +37,10 @@ class FilesonicCom(Account):
decode=True)
return json_loads(xml)["FSApi_Utility"]["getFilesonicDomainForCurrentIp"]["response"]
- def loadAccountInfo(self, user, req):
+ def loadAccountInfo(self, req):
xml = req.load(self.API_URL + "/user?method=getInfo&format=json",
- post={"u": user,
- "p": self.accounts[user]["password"]}, decode=True)
+ post={"u": self.loginname,
+ "p": self.password}, decode=True)
self.logDebug("account status retrieved from api %s" % xml)
@@ -56,15 +56,16 @@ class FilesonicCom(Account):
validuntil = -1
return {"validuntil": validuntil, "trafficleft": -1, "premium": premium}
- def login(self, user, data, req):
+ def login(self, req):
domain = self.getDomain(req)
post_vars = {
- "email": user,
- "password": data["password"],
+ "email": self.loginname,
+ "password": self.password,
"rememberMe": 1
}
page = req.load("http://www%s/user/login" % domain, cookies=True, post=post_vars, decode=True)
if "Provided password does not match." in page or "You must be logged in to view this page." in page:
self.wrongPassword()
+
diff --git a/module/plugins/accounts/OronCom.py b/module/plugins/accounts/OronCom.py
index 793984121..2c1d33162 100755
--- a/module/plugins/accounts/OronCom.py
+++ b/module/plugins/accounts/OronCom.py
@@ -20,16 +20,17 @@
from module.plugins.Account import Account
import re
from time import strptime, mktime
+from module.utils import formatSize, parseFileSize
class OronCom(Account):
__name__ = "OronCom"
- __version__ = "0.12"
+ __version__ = "0.13"
__type__ = "account"
__description__ = """oron.com account plugin"""
__author_name__ = ("DHMH")
__author_mail__ = ("DHMH@pyload.org")
- def loadAccountInfo(self, user, req):
+ def loadAccountInfo(self, 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)
@@ -37,7 +38,7 @@ class OronCom(Account):
validuntil = validuntil.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)
+ self.logDebug("Oron left: " + formatSize(parseFileSize(trafficleft)))
trafficleft = int(self.parseTraffic(trafficleft))
premium = True
else:
@@ -47,8 +48,9 @@ class OronCom(Account):
tmp = {"validuntil": validuntil, "trafficleft": trafficleft, "premium" : premium}
return tmp
- def login(self, user, data, req):
+ def login(self, 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"})
+ page = req.load("http://oron.com/login", post={"login": self.loginname, "password": self.password, "op": "login"})
if r'<b class="err">Login oder Passwort falsch</b>' in page:
self.wrongPassword()
+
diff --git a/module/plugins/accounts/Premium4Me.py b/module/plugins/accounts/Premium4Me.py
index de4fdc219..6a52cb61a 100644
--- a/module/plugins/accounts/Premium4Me.py
+++ b/module/plugins/accounts/Premium4Me.py
@@ -1,23 +1,27 @@
-from module.plugins.Account import Account
+# -*- coding: utf-8 -*-
+from module.plugins.MultiHoster import MultiHoster
-class Premium4Me(Account):
+class Premium4Me(MultiHoster):
__name__ = "Premium4Me"
- __version__ = "0.02"
+ __version__ = "0.10"
__type__ = "account"
__description__ = """Premium4.me account plugin"""
__author_name__ = ("RaNaN", "zoidberg")
__author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz")
- def loadAccountInfo(self, user, req):
+ def loadAccountInfo(self, req):
traffic = req.load("http://premium4.me/api/traffic.php?authcode=%s" % self.authcode)
- account_info = {"trafficleft": int(traffic) / 1024,
- "validuntil": -1}
+ account_info = {"trafficleft": int(traffic) / 1024, "validuntil": -1}
return account_info
- def login(self, user, data, req):
- self.authcode = req.load("http://premium4.me/api/getauthcode.php?username=%s&password=%s" % (user, data["password"])).strip()
-
+ def login(self, req):
+ self.authcode = req.load("http://premium4.me/api/getauthcode.php?username=%s&password=%s" % (self.loginname, self.password)).strip()
+
if "wrong username" in self.authcode:
- self.wrongPassword() \ No newline at end of file
+ self.wrongPassword()
+
+ def loadHosterList(self, req):
+ page = req.load("http://premium4.me/api/hosters.php?authcode=%s" % self.authcode)
+ return [x.strip() for x in page.replace("\"", "").split(";")] \ No newline at end of file
diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py
index adbd090db..9460fc815 100644
--- a/module/plugins/accounts/RealdebridCom.py
+++ b/module/plugins/accounts/RealdebridCom.py
@@ -1,25 +1,35 @@
-from module.plugins.Account import Account
-import xml.dom.minidom as dom
-
-class RealdebridCom(Account):
- __name__ = "RealdebridCom"
- __version__ = "0.41"
- __type__ = "account"
- __description__ = """Real-Debrid.com account plugin"""
- __author_name__ = ("Devirex, Hazzard")
- __author_mail__ = ("naibaf_11@yahoo.de")
-
- def loadAccountInfo(self, user, req):
- page = req.load("http://real-debrid.com/api/account.php")
- xml = dom.parseString(page)
- account_info = {"validuntil": int(xml.getElementsByTagName("expiration")[0].childNodes[0].nodeValue),
- "trafficleft": -1}
-
- return account_info
-
- def login(self, user, data, req):
- page = req.load("https://real-debrid.com/ajax/login.php", get = {"user": user, "pass": data["password"]})
- #page = req.load("https://real-debrid.com/login.html", post={"user": user, "pass": data["password"]}, cookies=True)
-
- if "Your login informations are incorrect" in page:
- self.wrongPassword()
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from module.plugins.MultiHoster import MultiHoster
+import xml.dom.minidom as dom
+
+class RealdebridCom(MultiHoster):
+ __name__ = "RealdebridCom"
+ __version__ = "0.5"
+ __type__ = "account"
+ __description__ = """Real-Debrid.com account plugin"""
+ __author_name__ = ("Devirex, Hazzard")
+ __author_mail__ = ("naibaf_11@yahoo.de")
+
+ def loadAccountInfo(self, req):
+ page = req.load("http://real-debrid.com/api/account.php")
+ xml = dom.parseString(page)
+ account_info = {"validuntil": int(xml.getElementsByTagName("expiration")[0].childNodes[0].nodeValue),
+ "trafficleft": -1}
+
+ return account_info
+
+ def login(self, req):
+ page = req.load("https://real-debrid.com/ajax/login.php?user=%s&pass=%s" % (self.loginname, self.password))
+ #page = req.load("https://real-debrid.com/login.html", post={"user": user, "pass": data["password"]}, cookies=True)
+
+ if "Your login informations are incorrect" in page:
+ self.wrongPassword()
+
+
+ def loadHosterList(self, req):
+ https = "https" if self.getConfig("https") else "http"
+ page = req.load(https + "://real-debrid.com/api/hosters.php").replace("\"","").strip()
+
+ return[x.strip() for x in page.split(",") if x.strip()] \ No newline at end of file
diff --git a/module/plugins/accounts/RyushareCom.py b/module/plugins/accounts/RyushareCom.py
index 055680ea0..f734eb11b 100644
--- a/module/plugins/accounts/RyushareCom.py
+++ b/module/plugins/accounts/RyushareCom.py
@@ -3,7 +3,7 @@ from module.plugins.internal.XFSPAccount import XFSPAccount
class RyushareCom(XFSPAccount):
__name__ = "RyushareCom"
- __version__ = "0.02"
+ __version__ = "0.03"
__type__ = "account"
__description__ = """ryushare.com account plugin"""
__author_name__ = ("zoidberg", "trance4us")
@@ -12,6 +12,7 @@ class RyushareCom(XFSPAccount):
MAIN_PAGE = "http://ryushare.com/"
def login(self, user, data, req):
+ req.lastURL = "http://ryushare.com/login.python"
html = req.load("http://ryushare.com/login.python", post={"login": user, "password": data["password"], "op": "login"})
if 'Incorrect Login or Password' in html or '>Error<' in html:
self.wrongPassword() \ No newline at end of file
diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py
index cdc4ebb63..4dd398d6d 100644
--- a/module/plugins/accounts/ShareonlineBiz.py
+++ b/module/plugins/accounts/ShareonlineBiz.py
@@ -23,35 +23,53 @@ import re
class ShareonlineBiz(Account):
__name__ = "ShareonlineBiz"
- __version__ = "0.23"
+ __version__ = "0.3"
__type__ = "account"
__description__ = """share-online.biz account plugin"""
- __author_name__ = ("mkaay", "zoidberg")
- __author_mail__ = ("mkaay@mkaay.de", "zoidberg@mujmail.cz")
+ __author_name__ = ("mkaay")
+ __author_mail__ = ("mkaay@mkaay.de")
- def getUserAPI(self, user, req):
- return req.load("http://api.share-online.biz/account.php?username=%s&password=%s&act=userDetails" % (user, self.accounts[user]["password"]))
-
- def loadAccountInfo(self, user, req):
- src = self.getUserAPI(user, req)
-
+ def getUserAPI(self, req):
+ src = req.load("http://api.share-online.biz/account.php?username=%s&password=%s&act=userDetails" % (self.loginname, self.password))
info = {}
for line in src.splitlines():
- if "=" in line:
- key, value = line.split("=")
- info[key] = value
- self.logDebug(info)
+ key, value = line.split("=")
+ info[key] = value
+ return info
+
+ def loadAccountInfo(self, user, req):
+ try:
+ info = self.getUserAPI(req)
+ return {"validuntil": int(info["expire_date"]), "trafficleft": -1, "premium": not info["group"] == "Sammler"}
+ except:
+ pass
+
+ #fallback
+ src = req.load("http://www.share-online.biz/members.php?setlang=en")
+ validuntil = re.search(r'<td align="left"><b>Package Expire Date:</b></td>\s*<td align="left">(\d+/\d+/\d+)</td>', src)
+ if validuntil:
+ validuntil = int(mktime(strptime(validuntil.group(1), "%m/%d/%y")))
+ else:
+ validuntil = -1
- if "dl" in info and info["dl"].lower() != "not_available":
- req.cj.setCookie("share-online.biz", "dl", info["dl"])
- if "a" in info and info["a"].lower() != "not_available":
- req.cj.setCookie("share-online.biz", "a", info["a"])
-
- return {"validuntil": int(info["expire_date"]) if "expire_date" in info else -1,
- "trafficleft": -1,
- "premium": True if ("dl" in info or "a" in info) and (info["group"] != "Sammler") else False}
+ acctype = re.search(r'<td align="left" ><b>Your Package:</b></td>\s*<td align="left">\s*<b>(.*?)</b>\s*</td>', src)
+ if acctype:
+ if acctype.group(1) == "Collector account (free)":
+ premium = False
+ else:
+ premium = True
+
+ tmp = {"validuntil": validuntil, "trafficleft": -1, "premium": premium}
+ return tmp
def login(self, user, data, req):
- src = self.getUserAPI(user, req)
- if "EXCEPTION" in src:
- self.wrongPassword() \ No newline at end of file
+ post_vars = {
+ "act": "login",
+ "location": "index.php",
+ "dieseid": "",
+ "user": user,
+ "pass": data["password"],
+ "login": "Login"
+ }
+ req.lastURL = "http://www.share-online.biz/"
+ req.load("https://www.share-online.biz/login.php", cookies=True, post=post_vars)