summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r--module/plugins/accounts/DdlstorageCom.py12
-rw-r--r--module/plugins/accounts/FilefactoryCom.py28
-rwxr-xr-xmodule/plugins/accounts/NetloadIn.py2
-rw-r--r--module/plugins/accounts/ShareRapidCom.py27
-rw-r--r--module/plugins/accounts/StahnuTo.py49
-rw-r--r--module/plugins/accounts/UlozTo.py9
-rw-r--r--module/plugins/accounts/UploadheroCom.py35
7 files changed, 129 insertions, 33 deletions
diff --git a/module/plugins/accounts/DdlstorageCom.py b/module/plugins/accounts/DdlstorageCom.py
new file mode 100644
index 000000000..01d165f23
--- /dev/null
+++ b/module/plugins/accounts/DdlstorageCom.py
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+from module.plugins.internal.XFSPAccount import XFSPAccount
+
+class DdlstorageCom(XFSPAccount):
+ __name__ = "DdlstorageCom"
+ __version__ = "0.01"
+ __type__ = "account"
+ __description__ = """DDLStorage.com account plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ MAIN_PAGE = "http://ddlstorage.com/" \ No newline at end of file
diff --git a/module/plugins/accounts/FilefactoryCom.py b/module/plugins/accounts/FilefactoryCom.py
index 8c04cf49b..73431b546 100644
--- a/module/plugins/accounts/FilefactoryCom.py
+++ b/module/plugins/accounts/FilefactoryCom.py
@@ -23,32 +23,32 @@ from time import mktime, strptime
class FilefactoryCom(Account):
__name__ = "FilefactoryCom"
- __version__ = "0.1"
+ __version__ = "0.11"
__type__ = "account"
__description__ = """filefactory.com account plugin"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
- ACCOUNT_INFO_PATTERN = r'Your account is valid until the <strong>(.*?)</strong>'
-
- def loadAccountInfo(self, user, req):
- premium = False
- validuntil = -1
-
- html = req.load("http://filefactory.com/member/")
- if "You are a FileFactory Premium Member" in html:
+ ACCOUNT_INFO_PATTERN = r'"greenText">Premium member until<.*?datetime="(.*?)"'
+
+ def loadAccountInfo(self, user, req):
+ html = req.load("http://www.filefactory.com/member/")
+
+ found = re.search(self.ACCOUNT_INFO_PATTERN, html)
+ if found:
premium = True
- found = re.search(self.ACCOUNT_INFO_PATTERN, html)
- if found:
- validuntil = mktime(strptime(re.sub(r"(\d)[a-z]{2} ", r"\1 ", found.group(1)),"%d %B, %Y"))
+ validuntil = mktime(strptime(re.sub(r"(\d)[a-z]{2} ", r"\1 ", found.group(1)),"%d %B, %Y"))
+ else:
+ premium = False
+ validuntil = -1
return {"premium": premium, "trafficleft": -1, "validuntil": validuntil}
def login(self, user, data, req):
- html = req.load("http://filefactory.com/member/login.php", post={
+ html = req.load("http://www.filefactory.com/member/login.php", post={
"email": user,
"password": data["password"],
"redirect": "/"})
- if not re.search(r'location:.*?\?login=1', req.http.header, re.I):
+ if '/member/login.php?err=1' in req.http.header:
self.wrongPassword() \ No newline at end of file
diff --git a/module/plugins/accounts/NetloadIn.py b/module/plugins/accounts/NetloadIn.py
index 4d05732ce..cef3e298b 100755
--- a/module/plugins/accounts/NetloadIn.py
+++ b/module/plugins/accounts/NetloadIn.py
@@ -23,7 +23,7 @@ from time import time
class NetloadIn(Account):
__name__ = "NetloadIn"
- __version__ = "0.21"
+ __version__ = "0.22"
__type__ = "account"
__description__ = """netload.in account plugin"""
__author_name__ = ("RaNaN", "CryNickSystems")
diff --git a/module/plugins/accounts/ShareRapidCom.py b/module/plugins/accounts/ShareRapidCom.py
index 9828b1f7e..178fe236e 100644
--- a/module/plugins/accounts/ShareRapidCom.py
+++ b/module/plugins/accounts/ShareRapidCom.py
@@ -5,32 +5,29 @@ from module.plugins.Account import Account
class ShareRapidCom(Account):
__name__ = "ShareRapidCom"
- __version__ = "0.1"
+ __version__ = "0.3"
__type__ = "account"
__description__ = """ShareRapid account plugin"""
__author_name__ = ("MikyWoW")
def loadAccountInfo(self, user, req):
src = req.load("http://share-rapid.com/mujucet/", cookies=True)
- if "Kredit:" in src:
- start = src.index('Kredit:</td><td>')
- src = src[start+16:]
- start = src.index('GB')
- kredit = src[0:start-1]
- ret = float(kredit)*1024*1024
- tmp = {"premium": True, "trafficleft": ret, "validuntil": -1}
+ found = re.search(r'<tr><td>GB:</td><td>(.*?) GB', src)
+ if found:
+ ret = float(found.group(1)) * (1 << 20)
+ tmp = {"premium": True, "trafficleft": ret, "validuntil": -1}
else:
- tmp = {"premium": False, "trafficleft": None, "validuntil": None}
+ tmp = {"premium": False, "trafficleft": None, "validuntil": None}
return tmp
def login(self, user, data, req):
htm = req.load("http://share-rapid.com/prihlaseni/", cookies=True)
if "Heslo:" in htm:
- start = htm.index('id="inp_hash" name="hash" value="')
- htm = htm[start+33:]
- hashes = htm[0:32]
- html = req.load("http://share-rapid.com/prihlaseni/",
+ start = htm.index('id="inp_hash" name="hash" value="')
+ htm = htm[start+33:]
+ hashes = htm[0:32]
+ htm = req.load("http://share-rapid.com/prihlaseni/",
post={"hash": hashes,"login": user, "pass1": data["password"],"remember": 0,
"sbmt": "P%C5%99ihl%C3%A1sit"}, cookies=True)
- if "Heslo:" in html:
- self.wrongPassword() \ No newline at end of file
+ if "Heslo:" in htm:
+ self.wrongPassword() \ No newline at end of file
diff --git a/module/plugins/accounts/StahnuTo.py b/module/plugins/accounts/StahnuTo.py
new file mode 100644
index 000000000..8a4523bc5
--- /dev/null
+++ b/module/plugins/accounts/StahnuTo.py
@@ -0,0 +1,49 @@
+# -*- 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: zoidberg
+"""
+
+from module.plugins.Account import Account
+from module.utils import parseFileSize
+import re
+
+class StahnuTo(Account):
+ __name__ = "StahnuTo"
+ __version__ = "0.02"
+ __type__ = "account"
+ __description__ = """StahnuTo account plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ #login_timeout = 60
+
+ def loadAccountInfo(self, user, req):
+ html = req.load("http://www.stahnu.to/")
+
+ found = re.search(r'>VIP: (\d+.*)<', html)
+ trafficleft = parseFileSize(found.group(1)) * 1024 if found else 0
+
+ return {"premium": trafficleft > (512 * 1024), "trafficleft": trafficleft, "validuntil": -1}
+
+ def login(self, user, data, req):
+ html = req.load("http://www.stahnu.to/login.php", post={
+ "username": user,
+ "password": data["password"],
+ "submit": "Login"})
+
+ if not '<a href="logout.php">' in html:
+ self.wrongPassword() \ No newline at end of file
diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py
index 0375337b0..0c4ecda6a 100644
--- a/module/plugins/accounts/UlozTo.py
+++ b/module/plugins/accounts/UlozTo.py
@@ -5,7 +5,7 @@ import re
class UlozTo(Account):
__name__ = "UlozTo"
- __version__ = "0.02"
+ __version__ = "0.03"
__type__ = "account"
__description__ = """uloz.to account plugin"""
__author_name__ = ("zoidberg")
@@ -14,11 +14,14 @@ class UlozTo(Account):
TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a href="/kredit/" title="[^"]*?GB = ([0-9.]+) MB">'
def loadAccountInfo(self, user, req):
- html = req.load("http://www.ulozto.net/statistiky", decode = True)
+ #this cookie gets lost somehow after each request
+ self.phpsessid = req.cj.getCookie("PHPSESSID")
+ html = req.load("http://www.ulozto.net/", decode = True)
+ req.cj.setCookie("www.ulozto.net", "PHPSESSID", self.phpsessid)
found = re.search(self.TRAFFIC_LEFT_PATTERN, html)
trafficleft = int(float(found.group(1).replace(' ','').replace(',','.')) * 1000 / 1.024) if found else 0
- self.premium = True if trafficleft else False
+ self.premium = True if trafficleft else False
return {"validuntil": -1, "trafficleft": trafficleft}
diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py
new file mode 100644
index 000000000..f1e0649e6
--- /dev/null
+++ b/module/plugins/accounts/UploadheroCom.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from module.plugins.Account import Account
+import re,datetime,time
+
+class UploadheroCom(Account):
+ __name__ = "UploadheroCom"
+ __version__ = "0.1"
+ __type__ = "account"
+ __description__ = """Uploadhero.com account plugin"""
+ __author_name__ = ("mcmyst")
+ __author_mail__ = ("mcmyst@hotmail.fr")
+
+
+ def loadAccountInfo(self, user, req):
+ premium_pattern = re.compile('Il vous reste <span class="bleu">([0-9]+)</span> jours premium.')
+
+ data = self.getAccountData(user)
+ page = req.load("http://uploadhero.com/my-account")
+
+ if premium_pattern.search(page):
+ end_date = datetime.date.today() + datetime.timedelta(days=int(premium_pattern.search(page).group(1)))
+ end_date = time.mktime(future.timetuple())
+ account_info = {"validuntil": end_date, "trafficleft": -1, "premium": True}
+ else:
+ account_info = {"validuntil": -1, "trafficleft": -1, "premium": False}
+
+ return account_info
+
+ def login(self, user, data, req):
+ page = req.load("http://uploadhero.com/lib/connexion.php", post={"pseudo_login": user, "password_login": data["password"]})
+
+ if "mot de passe invalide" in page:
+ self.wrongPassword() \ No newline at end of file