summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r--module/plugins/accounts/DepositfilesCom.py50
-rw-r--r--module/plugins/accounts/FileserveCom.py59
-rw-r--r--module/plugins/accounts/HotfileCom.py88
-rw-r--r--module/plugins/accounts/NetloadIn.py33
-rw-r--r--module/plugins/accounts/RapidshareCom.py78
-rw-r--r--module/plugins/accounts/ShareonlineBiz.py50
-rw-r--r--module/plugins/accounts/UploadedTo.py55
-rw-r--r--module/plugins/accounts/__init__.py0
8 files changed, 413 insertions, 0 deletions
diff --git a/module/plugins/accounts/DepositfilesCom.py b/module/plugins/accounts/DepositfilesCom.py
new file mode 100644
index 000000000..044f647be
--- /dev/null
+++ b/module/plugins/accounts/DepositfilesCom.py
@@ -0,0 +1,50 @@
+# -*- 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: mkaay
+"""
+
+from module.plugins.Account import Account
+import re
+from time import strptime, mktime
+import hashlib
+
+class DepositfilesCom(Account):
+ __name__ = "DepositfilesCom"
+ __version__ = "0.1"
+ __type__ = "account"
+ __description__ = """depositfiles.com account plugin"""
+ __author_name__ = ("mkaay")
+ __author_mail__ = ("mkaay@mkaay.de")
+
+ def getAccountInfo(self, user):
+ req = self.core.requestFactory.getRequest(self.__name__, user)
+
+ src = req.load("http://depositfiles.com/de/gold/")
+ validuntil = re.search("noch den Gold-Zugriff: <b>(.*?)</b></div>", src).group(1)
+
+ validuntil = int(mktime(strptime(validuntil, "%Y-%m-%d %H:%M:%S")))
+
+ out = Account.getAccountInfo(self, user)
+
+ tmp = {"validuntil":validuntil, "trafficleft":-1}
+ out.update(tmp)
+ return out
+
+ def login(self, user, data):
+ req = self.core.requestFactory.getRequest(self.__name__, user)
+ req.load("http://depositfiles.com/de/gold/payment.php")
+ req.load("http://depositfiles.com/de/login.php", get={"return": "/de/gold/payment.php"}, post={"login": user, "password": data["password"]})
diff --git a/module/plugins/accounts/FileserveCom.py b/module/plugins/accounts/FileserveCom.py
new file mode 100644
index 000000000..a9b222a6a
--- /dev/null
+++ b/module/plugins/accounts/FileserveCom.py
@@ -0,0 +1,59 @@
+# -*- 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: mkaay
+"""
+
+from module.plugins.Account import Account
+import re
+from time import strptime, mktime
+import hashlib
+
+class FileserveCom(Account):
+ __name__ = "FileserveCom"
+ __version__ = "0.1"
+ __type__ = "account"
+ __description__ = """fileserve.com account plugin"""
+ __author_name__ = ("mkaay")
+ __author_mail__ = ("mkaay@mkaay.de")
+
+ def getAccountInfo(self, user):
+ try:
+ req = self.core.requestFactory.getRequest(self.__name__, user)
+
+ src = req.load("http://fileserve.com/dashboard.php", cookies=True)
+
+ out = Account.getAccountInfo(self, user)
+
+ m = re.search(r"<td><h4>Premium Until</h4></th> <td><h5>(.*?) E(.)T</h5></td>", src)
+ if m:
+ zone = -5 if m.group(2) == "S" else -4
+ validuntil = int(mktime(strptime(m.group(1), "%d %B %Y"))) + 24*3600 + (zone*3600)
+ tmp = {"validuntil":validuntil, "trafficleft":-1}
+ else:
+ tmp = {"trafficleft":-1}
+ out.update(tmp)
+ return out
+ except:
+ return Account.getAccountInfo(user)
+
+ def login(self, user, data):
+ req = self.core.requestFactory.getRequest(self.__name__, user)
+ req.load("http://fileserve.com/login.php",
+ post={"loginUserName": user, "loginUserPassword": data["password"],
+ "autoLogin": "on", "loginFormSubmit": "Login"}, cookies=True)
+ req.load("http://fileserve.com/dashboard.php", cookies=True)
+
diff --git a/module/plugins/accounts/HotfileCom.py b/module/plugins/accounts/HotfileCom.py
new file mode 100644
index 000000000..e6e8ba517
--- /dev/null
+++ b/module/plugins/accounts/HotfileCom.py
@@ -0,0 +1,88 @@
+# -*- 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: mkaay
+"""
+
+from module.plugins.Account import Account
+import re
+from time import strptime, mktime
+import hashlib
+
+class HotfileCom(Account):
+ __name__ = "HotfileCom"
+ __version__ = "0.1"
+ __type__ = "account"
+ __description__ = """hotfile.com account plugin"""
+ __author_name__ = ("mkaay")
+ __author_mail__ = ("mkaay@mkaay.de")
+
+ def getAccountInfo(self, user):
+ try:
+ req = self.core.requestFactory.getRequest(self.__name__, user)
+
+ resp = self.apiCall("getuserinfo", user=user)
+ if resp.startswith("."):
+ self.core.debug("HotfileCom API Error: %s" % resp)
+ raise Exception
+ info = {}
+ for p in resp.split("&"):
+ key, value = p.split("=")
+ info[key] = value
+
+ info["premium_until"] = info["premium_until"].replace("T"," ")
+ zone = info["premium_until"][19:]
+ info["premium_until"] = info["premium_until"][:19]
+ zone = int(zone[:3])
+
+ validuntil = int(mktime(strptime(info["premium_until"], "%Y-%m-%d %H:%M:%S"))) + (zone*3600)
+ out = Account.getAccountInfo(self, user)
+ tmp = {"validuntil":validuntil, "trafficleft":-1}
+ out.update(tmp)
+ return out
+ except:
+ return Account.getAccountInfo(user)
+
+ def apiCall(self, method, post={}, user=None):
+ if user:
+ data = None
+ for account in self.accounts.items():
+ if account[0] == user:
+ data = account[1]
+ else:
+ user, data = self.accounts.items()[0]
+
+ req = self.core.requestFactory.getRequest(self.__name__, user)
+
+ digest = req.load("http://api.hotfile.com/", post={"action":"getdigest"})
+ h = hashlib.md5()
+ h.update(data["password"])
+ hp = h.hexdigest()
+ h = hashlib.md5()
+ h.update(hp)
+ h.update(digest)
+ pwhash = h.hexdigest()
+
+ post.update({"action": method})
+ post.update({"username":user, "passwordmd5dig":pwhash, "digest":digest})
+ return req.load("http://api.hotfile.com/", post=post)
+
+ def login(self, user, data):
+ req = self.core.requestFactory.getRequest(self.__name__, user)
+ cj = self.core.requestFactory.getCookieJar(self.__name__, user)
+ cj.setCookie("hotfile.com", "lang", "en")
+ req.load("http://hotfile.com/", cookies=True)
+ req.load("http://hotfile.com/login.php", post={"returnto": "/", "user": user, "pass": data["password"]}, cookies=True)
diff --git a/module/plugins/accounts/NetloadIn.py b/module/plugins/accounts/NetloadIn.py
new file mode 100644
index 000000000..5743c7835
--- /dev/null
+++ b/module/plugins/accounts/NetloadIn.py
@@ -0,0 +1,33 @@
+# -*- 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: mkaay
+"""
+
+from module.plugins.Account import Account
+
+class NetloadIn(Account):
+ __name__ = "NetloadIn"
+ __version__ = "0.1"
+ __type__ = "account"
+ __description__ = """netload.in account plugin"""
+ __author_name__ = ("RaNaN")
+ __author_mail__ = ("RaNaN@pyload.org")
+
+ def login(self, user, data):
+ req = self.core.requestFactory.getRequest(self.__name__, user)
+ req.load("http://netload.in/index.php", None, { "txtuser" : user, "txtpass" : data['password'], "txtcheck" : "login", "txtlogin" : ""}, cookies=True)
+
diff --git a/module/plugins/accounts/RapidshareCom.py b/module/plugins/accounts/RapidshareCom.py
new file mode 100644
index 000000000..c9766cd57
--- /dev/null
+++ b/module/plugins/accounts/RapidshareCom.py
@@ -0,0 +1,78 @@
+# -*- 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: mkaay
+"""
+
+from module.plugins.Account import Account
+
+class RapidshareCom(Account):
+ __name__ = "RapidshareCom"
+ __version__ = "0.1"
+ __type__ = "account"
+ __description__ = """Rapidshare.com account plugin"""
+ __author_name__ = ("mkaay")
+ __author_mail__ = ("mkaay@mkaay.de")
+
+ def getAccountInfo(self, user):
+ try:
+ data = None
+ for account in self.accounts.items():
+ if account[0] == user:
+ data = account[1]
+ if not data:
+ raise Exception
+ req = self.core.requestFactory.getRequest(self.__name__, user)
+ api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi"
+ api_param_prem = {"sub": "getaccountdetails_v1", "type": "prem", "login": user, "password": data["password"], "withcookie": 1}
+ src = req.load(api_url_base, cookies=False, get=api_param_prem)
+ if src.startswith("ERROR"):
+ raise Exception
+ fields = src.split("\n")
+ info = {}
+ for t in fields:
+ if not t.strip():
+ continue
+ k, v = t.split("=")
+ info[k] = v
+
+ out = Account.getAccountInfo(self, user)
+ restkb = int(info["tskb"])
+ maxtraffic = int(info["rapids"])/14 * (5*1024*1024) + restkb
+ tmp = {"validuntil":int(info["billeduntil"]), "trafficleft":maxtraffic if int(info["autorefill"]) else restkb, "maxtraffic":maxtraffic}
+ out.update(tmp)
+ return out
+ except:
+ return Account.getAccountInfo(self, user)
+
+ def login(self, user, data):
+ req = self.core.requestFactory.getRequest(self.__name__, user)
+ api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi"
+ api_param_prem = {"sub": "getaccountdetails_v1", "type": "prem", "login": user, "password": data["password"], "withcookie": 1}
+ src = req.load(api_url_base, cookies=False, get=api_param_prem)
+ if src.startswith("ERROR"):
+ return
+ fields = src.split("\n")
+ info = {}
+ for t in fields:
+ if not t.strip():
+ continue
+ k, v = t.split("=")
+ info[k] = v
+ cj = self.core.requestFactory.getCookieJar(self.__name__, user)
+ cj.setCookie("rapidshare.com", "enc", info["cookie"])
+
+
diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py
new file mode 100644
index 000000000..611fa759d
--- /dev/null
+++ b/module/plugins/accounts/ShareonlineBiz.py
@@ -0,0 +1,50 @@
+# -*- 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: mkaay
+"""
+
+from module.plugins.Account import Account
+from time import strptime, mktime
+import re
+
+class ShareonlineBiz(Account):
+ __name__ = "ShareonlineBiz"
+ __version__ = "0.2"
+ __type__ = "account"
+ __description__ = """share-online.biz account plugin"""
+ __author_name__ = ("mkaay")
+ __author_mail__ = ("mkaay@mkaay.de")
+
+ def getAccountInfo(self, user):
+ req = self.core.requestFactory.getRequest(self.__name__, user)
+ src = req.load("https://www.share-online.biz/alpha/user/profile")
+
+ validuntil = re.search(r"Account gültig bis:.*?<span class='.*?'>(.*?)</span>", src).group(1)
+ validuntil = int(mktime(strptime(validuntil, "%m/%d/%Y, %I:%M:%S %p")))
+
+ out = Account.getAccountInfo(self, user)
+ tmp = {"validuntil":validuntil, "trafficleft":-1}
+ out.update(tmp)
+ return out
+
+ def login(self, user, data):
+ req = self.core.requestFactory.getRequest(self.__name__, user)
+ post_vars = {"user": user,
+ "pass": data["password"],
+ "l_rememberme":"1"}
+ req.lastURL = "http://www.share-online.biz/alpha/"
+ req.load("https://www.share-online.biz/alpha/user/login", cookies=True, post=post_vars)
diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py
new file mode 100644
index 000000000..1311ee809
--- /dev/null
+++ b/module/plugins/accounts/UploadedTo.py
@@ -0,0 +1,55 @@
+# -*- 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: mkaay
+"""
+
+from module.plugins.Account import Account
+import re
+from time import strptime, mktime
+
+class UploadedTo(Account):
+ __name__ = "UploadedTo"
+ __version__ = "0.1"
+ __type__ = "account"
+ __description__ = """ul.to account plugin"""
+ __author_name__ = ("mkaay")
+ __author_mail__ = ("mkaay@mkaay.de")
+
+ def getAccountInfo(self, user):
+ try:
+ data = None
+ for account in self.accounts.items():
+ if account[0] == user:
+ data = account[1]
+ if not data:
+ raise Exception
+ req = self.core.requestFactory.getRequest(self.__name__, user)
+ html = req.load("http://uploaded.to/", cookies=True)
+ raw_traffic = re.search(r"Traffic left: </span><span class=.*?>(.*?)</span>", html).group(1)
+ raw_valid = re.search(r"Valid until: </span> <span class=.*?>(.*?)</span>", html).group(1)
+ traffic = int(self.parseTraffic(raw_traffic))
+ validuntil = int(mktime(strptime(raw_valid.strip(), "%d-%m-%Y %H:%M")))
+ out = Account.getAccountInfo(self, user)
+ tmp = {"validuntil":validuntil, "trafficleft":traffic, "maxtraffic":100*1024*1024}
+ out.update(tmp)
+ return out
+ except:
+ return Account.getAccountInfo(self, user)
+
+ def login(self, user, data):
+ req = self.core.requestFactory.getRequest(self.__name__, user)
+ req.load("http://uploaded.to/login", None, { "email" : user, "password" : data["password"]}, cookies=True)
diff --git a/module/plugins/accounts/__init__.py b/module/plugins/accounts/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/module/plugins/accounts/__init__.py