summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r--module/plugins/accounts/AlldebridCom.py38
-rw-r--r--module/plugins/accounts/BackinNet.py (renamed from module/plugins/accounts/BillionuploadsCom.py)10
-rw-r--r--module/plugins/accounts/BitshareCom.py5
-rw-r--r--module/plugins/accounts/CatShareNet.py41
-rw-r--r--module/plugins/accounts/CloudzillaTo.py5
-rw-r--r--module/plugins/accounts/CzshareCom.py37
-rw-r--r--module/plugins/accounts/DebridItaliaCom.py10
-rw-r--r--module/plugins/accounts/DepositfilesCom.py11
-rw-r--r--module/plugins/accounts/EuroshareEu.py16
-rw-r--r--module/plugins/accounts/ExashareCom.py16
-rw-r--r--module/plugins/accounts/FastixRu.py5
-rw-r--r--module/plugins/accounts/FastshareCz.py18
-rw-r--r--module/plugins/accounts/File4SafeCom.py (renamed from module/plugins/accounts/File4safeCom.py)8
-rw-r--r--module/plugins/accounts/FilecloudIo.py8
-rw-r--r--module/plugins/accounts/FilefactoryCom.py19
-rw-r--r--module/plugins/accounts/FilejungleCom.py21
-rw-r--r--module/plugins/accounts/FilerNet.py15
-rw-r--r--module/plugins/accounts/FilesMailRu.py13
-rw-r--r--module/plugins/accounts/FileserveCom.py4
-rw-r--r--module/plugins/accounts/FourSharedCom.py15
-rw-r--r--module/plugins/accounts/FreakshareCom.py12
-rw-r--r--module/plugins/accounts/FreeWayMe.py15
-rw-r--r--module/plugins/accounts/FshareVn.py25
-rw-r--r--module/plugins/accounts/HellshareCz.py21
-rw-r--r--module/plugins/accounts/HundredEightyUploadCom.py2
-rw-r--r--module/plugins/accounts/JunkyvideoCom.py16
-rw-r--r--module/plugins/accounts/Keep2ShareCc.py73
-rw-r--r--module/plugins/accounts/Keep2shareCc.py69
-rw-r--r--module/plugins/accounts/LetitbitNet.py4
-rw-r--r--module/plugins/accounts/LinksnappyCom.py21
-rw-r--r--module/plugins/accounts/LomafileCom.py16
-rw-r--r--module/plugins/accounts/MegaRapidCz.py27
-rw-r--r--module/plugins/accounts/MegaRapidoNet.py57
-rw-r--r--module/plugins/accounts/MegasharesCom.py18
-rw-r--r--module/plugins/accounts/MultihostersCom.py16
-rw-r--r--module/plugins/accounts/MultishareCz.py14
-rw-r--r--module/plugins/accounts/MyfastfileCom.py10
-rwxr-xr-xmodule/plugins/accounts/NetloadIn.py40
-rw-r--r--module/plugins/accounts/NoPremiumPl.py81
-rw-r--r--module/plugins/accounts/NowVideoSx.py (renamed from module/plugins/accounts/NowVideoAt.py)22
-rw-r--r--module/plugins/accounts/OboomCom.py23
-rw-r--r--module/plugins/accounts/OneFichierCom.py19
-rw-r--r--module/plugins/accounts/OverLoadMe.py25
-rw-r--r--module/plugins/accounts/PremiumTo.py17
-rw-r--r--module/plugins/accounts/PremiumizeMe.py4
-rw-r--r--module/plugins/accounts/PutdriveCom.py16
-rw-r--r--module/plugins/accounts/QuickshareCz.py12
-rw-r--r--module/plugins/accounts/RPNetBiz.py4
-rw-r--r--module/plugins/accounts/RapideoPl.py80
-rw-r--r--module/plugins/accounts/RapidgatorNet.py42
-rw-r--r--module/plugins/accounts/RapiduNet.py58
-rw-r--r--module/plugins/accounts/RealdebridCom.py8
-rw-r--r--module/plugins/accounts/RehostTo.py45
-rw-r--r--module/plugins/accounts/RyushareCom.py13
-rw-r--r--module/plugins/accounts/ShareonlineBiz.py63
-rw-r--r--module/plugins/accounts/SimplyPremiumCom.py26
-rw-r--r--module/plugins/accounts/SimplydebridCom.py11
-rw-r--r--module/plugins/accounts/SmoozedCom.py78
-rw-r--r--module/plugins/accounts/StahnuTo.py11
-rw-r--r--module/plugins/accounts/TurbobitNet.py15
-rw-r--r--module/plugins/accounts/TusfilesNet.py3
-rw-r--r--module/plugins/accounts/UlozTo.py16
-rw-r--r--module/plugins/accounts/UnrestrictLi.py44
-rw-r--r--module/plugins/accounts/UploadableCh.py34
-rw-r--r--module/plugins/accounts/UploadedTo.py17
-rw-r--r--module/plugins/accounts/UploadheroCom.py5
-rw-r--r--module/plugins/accounts/UploadingCom.py28
-rw-r--r--module/plugins/accounts/UptoboxCom.py3
-rw-r--r--module/plugins/accounts/WebshareCz.py12
-rw-r--r--module/plugins/accounts/YibaishiwuCom.py16
-rw-r--r--module/plugins/accounts/ZeveraCom.py68
71 files changed, 1073 insertions, 617 deletions
diff --git a/module/plugins/accounts/AlldebridCom.py b/module/plugins/accounts/AlldebridCom.py
index 8fb841a39..f9c1f2ca6 100644
--- a/module/plugins/accounts/AlldebridCom.py
+++ b/module/plugins/accounts/AlldebridCom.py
@@ -1,11 +1,9 @@
# -*- coding: utf-8 -*-
import re
+import time
import xml.dom.minidom as dom
-from time import time
-from urllib import urlencode
-
from BeautifulSoup import BeautifulSoup
from module.plugins.Account import Account
@@ -14,7 +12,7 @@ from module.plugins.Account import Account
class AlldebridCom(Account):
__name__ = "AlldebridCom"
__type__ = "account"
- __version__ = "0.22"
+ __version__ = "0.23"
__description__ = """AllDebrid.com account plugin"""
__license__ = "GPLv3"
@@ -25,35 +23,41 @@ class AlldebridCom(Account):
data = self.getAccountData(user)
html = req.load("http://www.alldebrid.com/account/")
soup = BeautifulSoup(html)
+
#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)
+
p = re.compile('\d+')
exp_data = p.findall(time_text)
- exp_time = time() + int(exp_data[0]) * 24 * 60 * 60 + int(
+ exp_time = time.time() + int(exp_data[0]) * 24 * 60 * 60 + int(
exp_data[1]) * 60 * 60 + (int(exp_data[2]) - 1) * 60
+
#Get expiration date from API
- except:
+ except Exception:
data = self.getAccountData(user)
html = req.load("http://www.alldebrid.com/api.php",
get={'action': "info_user", 'login': user, 'pw': data['password']})
+
self.logDebug(html)
+
xml = dom.parseString(html)
- exp_time = time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60
+ exp_time = time.time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60
+
account_info = {"validuntil": exp_time, "trafficleft": -1}
return account_info
def login(self, user, data, req):
- urlparams = urlencode({'action': 'login', 'login_login': user, 'login_password': data['password']})
- html = req.load("http://www.alldebrid.com/register/?%s" % urlparams)
-
- if "This login doesn't exist" in html:
- self.wrongPassword()
-
- if "The password is not valid" in html:
- self.wrongPassword()
-
- if "Invalid captcha" in html:
+ html = req.load("http://www.alldebrid.com/register/",
+ get={'action' : "login",
+ 'login_login' : user,
+ 'login_password': data['password']},
+ decode=True)
+
+ if "This login doesn't exist" in html \
+ or "The password is not valid" in html \
+ or "Invalid captcha" in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/BillionuploadsCom.py b/module/plugins/accounts/BackinNet.py
index 11af36591..46c8d7ac5 100644
--- a/module/plugins/accounts/BillionuploadsCom.py
+++ b/module/plugins/accounts/BackinNet.py
@@ -3,14 +3,14 @@
from module.plugins.internal.XFSAccount import XFSAccount
-class BillionuploadsCom(XFSAccount):
- __name__ = "BillionuploadsCom"
+class BackinNet(XFSAccount):
+ __name__ = "BackinNet"
__type__ = "account"
- __version__ = "0.02"
+ __version__ = "0.01"
- __description__ = """Billionuploads.com account plugin"""
+ __description__ = """Backin.net account plugin"""
__license__ = "GPLv3"
__authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
- HOSTER_DOMAIN = "billionuploads.com"
+ HOSTER_DOMAIN = "backin.net"
diff --git a/module/plugins/accounts/BitshareCom.py b/module/plugins/accounts/BitshareCom.py
index 960ff6c3c..00e546f6d 100644
--- a/module/plugins/accounts/BitshareCom.py
+++ b/module/plugins/accounts/BitshareCom.py
@@ -6,7 +6,7 @@ from module.plugins.Account import Account
class BitshareCom(Account):
__name__ = "BitshareCom"
__type__ = "account"
- __version__ = "0.12"
+ __version__ = "0.13"
__description__ = """Bitshare account plugin"""
__license__ = "GPLv3"
@@ -27,7 +27,8 @@ class BitshareCom(Account):
def login(self, user, data, req):
html = req.load("http://bitshare.com/login.html",
- post={"user": user, "password": data['password'], "submit": "Login"}, cookies=True)
+ post={"user": user, "password": data['password'], "submit": "Login"},
+ decode=True)
if "login" in req.lastEffectiveURL:
self.wrongPassword()
diff --git a/module/plugins/accounts/CatShareNet.py b/module/plugins/accounts/CatShareNet.py
index c33219685..bb42f443f 100644
--- a/module/plugins/accounts/CatShareNet.py
+++ b/module/plugins/accounts/CatShareNet.py
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import re
-
-from time import mktime, strptime
+import time
from module.plugins.Account import Account
@@ -10,39 +9,44 @@ from module.plugins.Account import Account
class CatShareNet(Account):
__name__ = "CatShareNet"
__type__ = "account"
- __version__ = "0.01"
+ __version__ = "0.05"
__description__ = """CatShareNet account plugin"""
__license__ = "GPLv3"
__authors__ = [("prOq", None)]
- PREMIUM_PATTERN = r'class="nav-collapse collapse pull-right">[\s\w<>=-."/:]*\sz.</a></li>\s*<li><a href="/premium">.*\s*<span style="color: red">(.*?)</span>[\s\w<>/]*href="/logout"'
- VALID_UNTIL_PATTERN = r'<div class="span6 pull-right">[\s\w<>=-":;]*<span style="font-size:13px;">.*?<strong>(.*?)</strong></span>'
+ PREMIUM_PATTERN = r'<a href="/premium">Konto:[\s\n]*Premium'
+ VALID_UNTIL_PATTERN = r'>Konto premium.*?<strong>(.*?)</strong></span>'
+ TRAFFIC_LEFT_PATTERN = r'<a href="/premium">([0-9.]+ [kMG]B)'
def loadAccountInfo(self, user, req):
- premium = False
- validuntil = -1
+ premium = False
+ validuntil = -1
+ trafficleft = -1
html = req.load("http://catshare.net/", decode=True)
+ if re.search(self.PREMIUM_PATTERN, html):
+ premium = True
+
try:
- m = re.search(self.PREMIUM_PATTERN, html)
- if "Premium" in m.group(1):
- premium = True
- except:
+ expiredate = re.search(self.VALID_UNTIL_PATTERN, html).group(1)
+ self.logDebug("Expire date: " + expiredate)
+
+ validuntil = time.mktime(time.strptime(expiredate, "%Y-%m-%d %H:%M:%S"))
+
+ except Exception:
pass
try:
- m = re.search(self.VALID_UNTIL_PATTERN, html)
- expiredate = m.group(1)
- if "-" not in expiredate:
- validuntil = mktime(strptime(expiredate, "%d.%m.%Y"))
- except:
+ trafficleft = self.parseTraffic(re.search(self.TRAFFIC_LEFT_PATTERN, html).group(1))
+
+ except Exception:
pass
- return {'premium': premium, 'trafficleft': -1, 'validuntil': validuntil}
+ return {'premium': premium, 'trafficleft': trafficleft, 'validuntil': validuntil}
def login(self, user, data, req):
@@ -50,7 +54,8 @@ class CatShareNet(Account):
post={'user_email': user,
'user_password': data['password'],
'remindPassword': 0,
- 'user[submit]': "Login"})
+ 'user[submit]': "Login"},
+ decode=True)
if not '<a href="/logout">Wyloguj</a>' in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/CloudzillaTo.py b/module/plugins/accounts/CloudzillaTo.py
index f0676f42f..d22d5e4b3 100644
--- a/module/plugins/accounts/CloudzillaTo.py
+++ b/module/plugins/accounts/CloudzillaTo.py
@@ -8,7 +8,7 @@ from module.plugins.Account import Account
class CloudzillaTo(Account):
__name__ = "CloudzillaTo"
__type__ = "account"
- __version__ = "0.01"
+ __version__ = "0.02"
__description__ = """Cloudzilla.to account plugin"""
__license__ = "GPLv3"
@@ -30,7 +30,8 @@ class CloudzillaTo(Account):
html = req.load("http://www.cloudzilla.to/",
post={'lusername': user,
'lpassword': data['password'],
- 'w' : "dologin"})
+ 'w' : "dologin"},
+ decode=True)
if "ERROR" in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/CzshareCom.py b/module/plugins/accounts/CzshareCom.py
index 414883228..300943828 100644
--- a/module/plugins/accounts/CzshareCom.py
+++ b/module/plugins/accounts/CzshareCom.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
-from time import mktime, strptime
import re
+import time
from module.plugins.Account import Account
@@ -9,7 +9,7 @@ from module.plugins.Account import Account
class CzshareCom(Account):
__name__ = "CzshareCom"
__type__ = "account"
- __version__ = "0.15"
+ __version__ = "0.18"
__description__ = """Czshare.com account plugin, now Sdilej.cz"""
__license__ = "GPLv3"
@@ -21,23 +21,34 @@ class CzshareCom(Account):
def loadAccountInfo(self, user, req):
+ premium = False
+ validuntil = None
+ trafficleft = None
+
html = req.load("http://sdilej.cz/prehled_kreditu/")
- m = re.search(self.CREDIT_LEFT_PATTERN, html)
- if m is None:
- return {"validuntil": 0, "trafficleft": 0}
+ try:
+ m = re.search(self.CREDIT_LEFT_PATTERN, html)
+ trafficleft = self.parseTraffic(m.group(1).replace(' ', '').replace(',', '.')) + m.group(2)
+ validuntil = time.mktime(time.strptime(m.group(3), '%d.%m.%y %H:%M'))
+
+ except Exception, e:
+ self.logError(e)
+
else:
- trafficleft = self.parseTraffic(m.group(1).replace(' ', '').replace(',', '.')) + m.group(2)]
- validuntil = mktime(strptime(m.group(3), '%d.%m.%y %H:%M'))
- return {"validuntil": validuntil, "trafficleft": trafficleft}
+ premium = True
+
+ return {'premium' : premium,
+ 'validuntil' : validuntil,
+ 'trafficleft': trafficleft}
def login(self, user, data, req):
- html = req.load('https://sdilej.cz/index.php', post={
- "Prihlasit": "Prihlasit",
- "login-password": data['password'],
- "login-name": user
- })
+ html = req.load('https://sdilej.cz/index.php',
+ post={"Prihlasit": "Prihlasit",
+ "login-password": data['password'],
+ "login-name": user},
+ decode=True)
if '<div class="login' in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/DebridItaliaCom.py b/module/plugins/accounts/DebridItaliaCom.py
index 878153fbf..3df99101a 100644
--- a/module/plugins/accounts/DebridItaliaCom.py
+++ b/module/plugins/accounts/DebridItaliaCom.py
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import re
-
-from time import mktime, strptime
+import time
from module.plugins.Account import Account
@@ -10,7 +9,7 @@ from module.plugins.Account import Account
class DebridItaliaCom(Account):
__name__ = "DebridItaliaCom"
__type__ = "account"
- __version__ = "0.12"
+ __version__ = "0.13"
__description__ = """Debriditalia.com account plugin"""
__license__ = "GPLv3"
@@ -28,7 +27,7 @@ class DebridItaliaCom(Account):
if 'Account premium not activated' not in html:
m = re.search(self.WALID_UNTIL_PATTERN, html)
if m:
- validuntil = mktime(strptime(m.group(1), "%d/%m/%Y %H:%M"))
+ validuntil = time.mktime(time.strptime(m.group(1), "%d/%m/%Y %H:%M"))
info = {"premium": True, "validuntil": validuntil, "trafficleft": -1}
else:
self.logError(_("Unable to retrieve account information"))
@@ -38,7 +37,8 @@ class DebridItaliaCom(Account):
def login(self, user, data, req):
html = req.load("http://debriditalia.com/login.php",
- get={'u': user, 'p': data['password']})
+ get={'u': user, 'p': data['password']},
+ decode=True)
if 'NO' in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/DepositfilesCom.py b/module/plugins/accounts/DepositfilesCom.py
index ec23f7a51..a0bd6a37c 100644
--- a/module/plugins/accounts/DepositfilesCom.py
+++ b/module/plugins/accounts/DepositfilesCom.py
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import re
-
-from time import strptime, mktime
+import time
from module.plugins.Account import Account
@@ -10,7 +9,7 @@ from module.plugins.Account import Account
class DepositfilesCom(Account):
__name__ = "DepositfilesCom"
__type__ = "account"
- __version__ = "0.31"
+ __version__ = "0.32"
__description__ = """Depositfiles.com account plugin"""
__license__ = "GPLv3"
@@ -23,13 +22,15 @@ class DepositfilesCom(Account):
html = req.load("https://dfiles.eu/de/gold/")
validuntil = re.search(r"Sie haben Gold Zugang bis: <b>(.*?)</b></div>", html).group(1)
- validuntil = mktime(strptime(validuntil, "%Y-%m-%d %H:%M:%S"))
+ validuntil = time.mktime(time.strptime(validuntil, "%Y-%m-%d %H:%M:%S"))
return {"validuntil": validuntil, "trafficleft": -1}
def login(self, user, data, req):
html = req.load("https://dfiles.eu/de/login.php", get={"return": "/de/gold/payment.php"},
- post={"login": user, "password": data['password']})
+ post={"login": user, "password": data['password']},
+ decode=True)
+
if r'<div class="error_message">Sie haben eine falsche Benutzername-Passwort-Kombination verwendet.</div>' in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/EuroshareEu.py b/module/plugins/accounts/EuroshareEu.py
index c75f8ee33..db4539e2e 100644
--- a/module/plugins/accounts/EuroshareEu.py
+++ b/module/plugins/accounts/EuroshareEu.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
-from time import mktime, strptime
import re
+import time
from module.plugins.Account import Account
@@ -9,7 +9,7 @@ from module.plugins.Account import Account
class EuroshareEu(Account):
__name__ = "EuroshareEu"
__type__ = "account"
- __version__ = "0.01"
+ __version__ = "0.02"
__description__ = """Euroshare.eu account plugin"""
__license__ = "GPLv3"
@@ -25,17 +25,17 @@ class EuroshareEu(Account):
premium, validuntil = False, -1
else:
premium = True
- validuntil = mktime(strptime(m.group(1), "%d.%m.%Y %H:%M"))
+ validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y %H:%M"))
return {"validuntil": validuntil, "trafficleft": -1, "premium": premium}
def login(self, user, data, req):
- html = req.load('http://euroshare.eu/customer-zone/login/', post={
- "trvale": "1",
- "login": user,
- "password": data['password']
- }, decode=True)
+ html = req.load('http://euroshare.eu/customer-zone/login/',
+ post={"trvale": "1",
+ "login": user,
+ "password": data['password']},
+ decode=True)
if u">Nesprávne prihlasovacie meno alebo heslo" in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/ExashareCom.py b/module/plugins/accounts/ExashareCom.py
new file mode 100644
index 000000000..431798522
--- /dev/null
+++ b/module/plugins/accounts/ExashareCom.py
@@ -0,0 +1,16 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.internal.XFSAccount import XFSAccount
+
+
+class ExashareCom(XFSAccount):
+ __name__ = "ExashareCom"
+ __type__ = "account"
+ __version__ = "0.01"
+
+ __description__ = """Exashare.com account plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
+
+
+ HOSTER_DOMAIN = "exashare.com"
diff --git a/module/plugins/accounts/FastixRu.py b/module/plugins/accounts/FastixRu.py
index d33d611c9..51be3880f 100644
--- a/module/plugins/accounts/FastixRu.py
+++ b/module/plugins/accounts/FastixRu.py
@@ -7,7 +7,7 @@ from module.common.json_layer import json_loads
class FastixRu(Account):
__name__ = "FastixRu"
__type__ = "account"
- __version__ = "0.02"
+ __version__ = "0.03"
__description__ = """Fastix account plugin"""
__license__ = "GPLv3"
@@ -31,8 +31,11 @@ class FastixRu(Account):
def login(self, user, data, req):
html = req.load("http://fastix.ru/api_v2/",
get={'sub': "get_apikey", 'email': user, 'password': data['password']})
+
api = json_loads(html)
api = api['apikey']
+
data['api'] = api
+
if "error_code" in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py
index d6e94f2e3..b946e29ba 100644
--- a/module/plugins/accounts/FastshareCz.py
+++ b/module/plugins/accounts/FastshareCz.py
@@ -8,7 +8,7 @@ from module.plugins.Account import Account
class FastshareCz(Account):
__name__ = "FastshareCz"
__type__ = "account"
- __version__ = "0.05"
+ __version__ = "0.06"
__description__ = """Fastshare.cz account plugin"""
__license__ = "GPLv3"
@@ -16,13 +16,13 @@ class FastshareCz(Account):
("stickell", "l.stickell@yahoo.it")]
- CREDIT_PATTERN = r'My account\s*\((.+?)\)'
+ CREDIT_PATTERN = r'Credit\s*:\s*</td>\s*<td>(.+?)\s*<'
def loadAccountInfo(self, user, req):
- validuntil = None
+ validuntil = -1
trafficleft = None
- premium = None
+ premium = False
html = req.load("http://www.fastshare.cz/user", decode=True)
@@ -30,13 +30,11 @@ class FastshareCz(Account):
if m:
trafficleft = self.parseTraffic(m.group(1))
- if trafficleft:
- premium = True
- validuntil = -1
- else:
- premium = False
+ premium = bool(trafficleft)
- return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium}
+ return {'validuntil' : validuntil,
+ 'trafficleft': trafficleft,
+ 'premium' : premium}
def login(self, user, data, req):
diff --git a/module/plugins/accounts/File4safeCom.py b/module/plugins/accounts/File4SafeCom.py
index 20053d895..50fe1aac8 100644
--- a/module/plugins/accounts/File4safeCom.py
+++ b/module/plugins/accounts/File4SafeCom.py
@@ -3,12 +3,12 @@
from module.plugins.internal.XFSAccount import XFSAccount
-class File4safeCom(XFSAccount):
- __name__ = "File4safeCom"
+class File4SafeCom(XFSAccount):
+ __name__ = "File4SafeCom"
__type__ = "account"
- __version__ = "0.04"
+ __version__ = "0.05"
- __description__ = """File4safe.com account plugin"""
+ __description__ = """File4Safe.com account plugin"""
__license__ = "GPLv3"
__authors__ = [("stickell", "l.stickell@yahoo.it")]
diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py
index d20f756f3..8ca55b1bc 100644
--- a/module/plugins/accounts/FilecloudIo.py
+++ b/module/plugins/accounts/FilecloudIo.py
@@ -7,7 +7,7 @@ from module.common.json_layer import json_loads
class FilecloudIo(Account):
__name__ = "FilecloudIo"
__type__ = "account"
- __version__ = "0.03"
+ __version__ = "0.04"
__description__ = """FilecloudIo account plugin"""
__license__ = "GPLv3"
@@ -19,7 +19,7 @@ class FilecloudIo(Account):
# It looks like the first API request always fails, so we retry 5 times, it should work on the second try
for _i in xrange(5):
rep = req.load("https://secure.filecloud.io/api-fetch_apikey.api",
- post={"username": user, "password": self.accounts[user]['password']})
+ post={"username": user, "password": self.getAccountData(user)['password']})
rep = json_loads(rep)
if rep['status'] == 'ok':
break
@@ -55,5 +55,5 @@ class FilecloudIo(Account):
post=self.form_data,
multipart=True)
- self.logged_in = True if "you have successfully logged in - filecloud.io" in html else False
- self.form_data = {}
+ if "you have successfully logged in" not in html:
+ self.wrongPassword()
diff --git a/module/plugins/accounts/FilefactoryCom.py b/module/plugins/accounts/FilefactoryCom.py
index 8394c549e..37b6f97a8 100644
--- a/module/plugins/accounts/FilefactoryCom.py
+++ b/module/plugins/accounts/FilefactoryCom.py
@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
+import pycurl
import re
-from time import mktime, strptime
-
-from pycurl import REFERER
+import time
from module.plugins.Account import Account
@@ -11,7 +10,7 @@ from module.plugins.Account import Account
class FilefactoryCom(Account):
__name__ = "FilefactoryCom"
__type__ = "account"
- __version__ = "0.14"
+ __version__ = "0.15"
__description__ = """Filefactory.com account plugin"""
__license__ = "GPLv3"
@@ -29,7 +28,7 @@ class FilefactoryCom(Account):
if m:
premium = True
validuntil = re.sub(self.VALID_UNTIL_PATTERN, '\g<D> \g<M> \g<Y>', m.group(0))
- validuntil = mktime(strptime(validuntil, "%d %b %Y"))
+ validuntil = time.mktime(time.strptime(validuntil, "%d %b %Y"))
else:
premium = False
validuntil = -1
@@ -38,12 +37,12 @@ class FilefactoryCom(Account):
def login(self, user, data, req):
- req.http.c.setopt(REFERER, "http://www.filefactory.com/member/login.php")
+ req.http.c.setopt(pycurl.REFERER, "http://www.filefactory.com/member/login.php")
- html = req.load("http://www.filefactory.com/member/signin.php", post={
- "loginEmail": user,
- "loginPassword": data['password'],
- "Submit": "Sign In"})
+ html = req.load("http://www.filefactory.com/member/signin.php",
+ post={"loginEmail" : user,
+ "loginPassword": data['password'],
+ "Submit" : "Sign In"})
if req.lastEffectiveURL != "http://www.filefactory.com/account/":
self.wrongPassword()
diff --git a/module/plugins/accounts/FilejungleCom.py b/module/plugins/accounts/FilejungleCom.py
index a3ec7af64..b92a371a5 100644
--- a/module/plugins/accounts/FilejungleCom.py
+++ b/module/plugins/accounts/FilejungleCom.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import re
-from time import mktime, strptime
+import time
from module.plugins.Account import Account
@@ -9,7 +9,7 @@ from module.plugins.Account import Account
class FilejungleCom(Account):
__name__ = "FilejungleCom"
__type__ = "account"
- __version__ = "0.11"
+ __version__ = "0.12"
__description__ = """Filejungle.com account plugin"""
__license__ = "GPLv3"
@@ -28,7 +28,7 @@ class FilejungleCom(Account):
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
if m:
premium = True
- validuntil = mktime(strptime(m.group(1), "%d %b %Y"))
+ validuntil = time.mktime(time.strptime(m.group(1), "%d %b %Y"))
else:
premium = False
validuntil = -1
@@ -37,13 +37,14 @@ class FilejungleCom(Account):
def login(self, user, data, req):
- html = req.load(self.URL + "login.php", post={
- "loginUserName": user,
- "loginUserPassword": data['password'],
- "loginFormSubmit": "Login",
- "recaptcha_challenge_field": "",
- "recaptcha_response_field": "",
- "recaptcha_shortencode_field": ""})
+ html = req.load(self.URL + "login.php",
+ post={"loginUserName": user,
+ "loginUserPassword": data['password'],
+ "loginFormSubmit": "Login",
+ "recaptcha_challenge_field": "",
+ "recaptcha_response_field": "",
+ "recaptcha_shortencode_field": ""},
+ decode=True)
if re.search(self.LOGIN_FAILED_PATTERN, html):
self.wrongPassword()
diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py
index a845e7ba4..ac5fd11da 100644
--- a/module/plugins/accounts/FilerNet.py
+++ b/module/plugins/accounts/FilerNet.py
@@ -9,14 +9,14 @@ from module.plugins.Account import Account
class FilerNet(Account):
__name__ = "FilerNet"
__type__ = "account"
- __version__ = "0.03"
+ __version__ = "0.04"
__description__ = """Filer.net account plugin"""
__license__ = "GPLv3"
__authors__ = [("stickell", "l.stickell@yahoo.it")]
- TOKEN_PATTERN = r'_csrf_token" value="([^"]+)" />'
+ TOKEN_PATTERN = r'_csrf_token" value="(.+?)" />'
WALID_UNTIL_PATTERN = r'Der Premium-Zugang ist gültig bis (.+)\.\s*</td>'
TRAFFIC_PATTERN = r'Traffic</th>\s*<td>([^<]+)</td>'
FREE_PATTERN = r'Account Status</th>\s*<td>\s*Free'
@@ -44,9 +44,16 @@ class FilerNet(Account):
def login(self, user, data, req):
html = req.load("https://filer.net/login")
+
token = re.search(self.TOKEN_PATTERN, html).group(1)
+
html = req.load("https://filer.net/login_check",
- post={"_username": user, "_password": data['password'],
- "_remember_me": "on", "_csrf_token": token, "_target_path": "https://filer.net/"})
+ post={"_username": user,
+ "_password": data['password'],
+ "_remember_me": "on",
+ "_csrf_token": token,
+ "_target_path": "https://filer.net/"},
+ decode=True)
+
if 'Logout' not in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/FilesMailRu.py b/module/plugins/accounts/FilesMailRu.py
index f91f4d5ba..ee309c425 100644
--- a/module/plugins/accounts/FilesMailRu.py
+++ b/module/plugins/accounts/FilesMailRu.py
@@ -6,7 +6,7 @@ from module.plugins.Account import Account
class FilesMailRu(Account):
__name__ = "FilesMailRu"
__type__ = "account"
- __version__ = "0.10"
+ __version__ = "0.11"
__description__ = """Filesmail.ru account plugin"""
__license__ = "GPLv3"
@@ -20,9 +20,12 @@ class FilesMailRu(Account):
def login(self, user, data, req):
user, domain = user.split("@")
- html = req.load("http://swa.mail.ru/cgi-bin/auth", None,
- {"Domain": domain, "Login": user, "Password": data['password'],
- "Page": "http://files.mail.ru/"}, cookies=True)
+ html = req.load("http://swa.mail.ru/cgi-bin/auth",
+ post={"Domain": domain,
+ "Login": user,
+ "Password": data['password'],
+ "Page": "http://files.mail.ru/"},
+ decode=True)
- if "Неверное имя пользователя или пароль" in html: # @TODO seems not to work
+ if "Неверное имя пользователя или пароль" in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/FileserveCom.py b/module/plugins/accounts/FileserveCom.py
index 1cf2a3a3c..5eb6b844c 100644
--- a/module/plugins/accounts/FileserveCom.py
+++ b/module/plugins/accounts/FileserveCom.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from time import mktime, strptime
+import time
from module.plugins.Account import Account
from module.common.json_layer import json_loads
@@ -24,7 +24,7 @@ class FileserveCom(Account):
res = json_loads(html)
if res['type'] == "premium":
- validuntil = mktime(strptime(res['expireTime'], "%Y-%m-%d %H:%M:%S"))
+ validuntil = time.mktime(time.strptime(res['expireTime'], "%Y-%m-%d %H:%M:%S"))
return {"trafficleft": res['traffic'], "validuntil": validuntil}
else:
return {"premium": False, "trafficleft": None, "validuntil": None}
diff --git a/module/plugins/accounts/FourSharedCom.py b/module/plugins/accounts/FourSharedCom.py
index ec19f83f5..2777a142a 100644
--- a/module/plugins/accounts/FourSharedCom.py
+++ b/module/plugins/accounts/FourSharedCom.py
@@ -1,13 +1,12 @@
# -*- coding: utf-8 -*-
-from module.common.json_layer import json_loads
from module.plugins.Account import Account
class FourSharedCom(Account):
__name__ = "FourSharedCom"
__type__ = "account"
- __version__ = "0.03"
+ __version__ = "0.04"
__description__ = """FourShared.com account plugin"""
__license__ = "GPLv3"
@@ -22,12 +21,14 @@ class FourSharedCom(Account):
def login(self, user, data, req):
req.cj.setCookie("4shared.com", "4langcookie", "en")
- res = req.load('http://www.4shared.com/web/login',
- post={'login': user,
- 'password': data['password'],
- 'remember': "on",
+
+ res = req.load("http://www.4shared.com/web/login",
+ post={'login' : user,
+ 'password' : data['password'],
+ 'remember' : "on",
'_remember': "on",
- 'returnTo': "http://www.4shared.com/account/home.jsp"})
+ 'returnTo' : "http://www.4shared.com/account/home.jsp"},
+ decode=True)
if 'Please log in to access your 4shared account' in res:
self.wrongPassword()
diff --git a/module/plugins/accounts/FreakshareCom.py b/module/plugins/accounts/FreakshareCom.py
index 576d835e2..ca3602a2c 100644
--- a/module/plugins/accounts/FreakshareCom.py
+++ b/module/plugins/accounts/FreakshareCom.py
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import re
-
-from time import strptime, mktime
+import time
from module.plugins.Account import Account
@@ -10,7 +9,7 @@ from module.plugins.Account import Account
class FreakshareCom(Account):
__name__ = "FreakshareCom"
__type__ = "account"
- __version__ = "0.12"
+ __version__ = "0.13"
__description__ = """Freakshare.com account plugin"""
__license__ = "GPLv3"
@@ -26,7 +25,7 @@ class FreakshareCom(Account):
try:
m = re.search(r'ltig bis:</td>\s*<td><b>([\d.:-]+)</b></td>', html, re.M)
- validuntil = mktime(strptime(m.group(1).strip(), "%d.%m.%Y - %H:%M"))
+ validuntil = time.mktime(time.strptime(m.group(1).strip(), "%d.%m.%Y - %H:%M"))
except Exception:
pass
@@ -44,8 +43,9 @@ class FreakshareCom(Account):
def login(self, user, data, req):
req.load("http://freakshare.com/index.php?language=EN")
- html = req.load("http://freakshare.com/login.html", None,
- {"submit": "Login", "user": user, "pass": data['password']}, cookies=True)
+ html = req.load("http://freakshare.com/login.html",
+ post={"submit": "Login", "user": user, "pass": data['password']},
+ decode=True)
if ">Wrong Username or Password" in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py
index 3b9841630..14b9f1e9a 100644
--- a/module/plugins/accounts/FreeWayMe.py
+++ b/module/plugins/accounts/FreeWayMe.py
@@ -7,7 +7,7 @@ from module.common.json_layer import json_loads
class FreeWayMe(Account):
__name__ = "FreeWayMe"
__type__ = "account"
- __version__ = "0.12"
+ __version__ = "0.13"
__description__ = """FreeWayMe account plugin"""
__license__ = "GPLv3"
@@ -16,8 +16,7 @@ class FreeWayMe(Account):
def loadAccountInfo(self, user, req):
status = self.getAccountStatus(user, req)
- if not status:
- return False
+
self.logDebug(status)
account_info = {"validuntil": -1, "premium": False}
@@ -33,10 +32,6 @@ class FreeWayMe(Account):
return account_info
- def getpw(self, user):
- return self.accounts[user]['password']
-
-
def login(self, user, data, req):
status = self.getAccountStatus(user, req)
@@ -47,9 +42,11 @@ class FreeWayMe(Account):
def getAccountStatus(self, user, req):
answer = req.load("https://www.free-way.me/ajax/jd.php",
- get={"id": 4, "user": user, "pass": self.accounts[user]['password']})
+ get={"id": 4, "user": user, "pass": self.getAccountData(user)['password']})
+
self.logDebug("Login: %s" % answer)
+
if answer == "Invalid login":
self.wrongPassword()
- return False
+
return json_loads(answer)
diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py
index 2da45aac6..7fcf88f20 100644
--- a/module/plugins/accounts/FshareVn.py
+++ b/module/plugins/accounts/FshareVn.py
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
-from time import mktime, strptime
-from pycurl import REFERER
import re
+import time
from module.plugins.Account import Account
@@ -10,7 +9,7 @@ from module.plugins.Account import Account
class FshareVn(Account):
__name__ = "FshareVn"
__type__ = "account"
- __version__ = "0.08"
+ __version__ = "0.09"
__description__ = """Fshare.vn account plugin"""
__license__ = "GPLv3"
@@ -19,8 +18,8 @@ class FshareVn(Account):
VALID_UNTIL_PATTERN = ur'<dt>Thời hạn dùng:</dt>\s*<dd>([^<]+)</dd>'
- LIFETIME_PATTERN = ur'<dt>Lần đăng nhập trước:</dt>\s*<dd>[^<]+</dd>'
- TRAFFIC_LEFT_PATTERN = ur'<dt>Tổng Dung Lượng Tài Khoản</dt>\s*<dd[^>]*>([\d.]+) ([kKMG])B</dd>'
+ LIFETIME_PATTERN = ur'<dt>Lần đăng nhập trước:</dt>\s*<dd>.+?</dd>'
+ TRAFFIC_LEFT_PATTERN = ur'<dt>Tổng Dung Lượng Tài Khoản</dt>\s*<dd.*?>([\d.]+) ([kKMG])B</dd>'
DIRECT_DOWNLOAD_PATTERN = ur'<input type="checkbox"\s*([^=>]*)[^>]*/>Kích hoạt download trực tiếp</dt>'
@@ -35,7 +34,7 @@ class FshareVn(Account):
m = re.search(self.VALID_UNTIL_PATTERN, html)
if m:
premium = True
- validuntil = mktime(strptime(m.group(1), '%I:%M:%S %p %d-%m-%Y'))
+ validuntil = time.mktime(time.strptime(m.group(1), '%I:%M:%S %p %d-%m-%Y'))
trafficleft = self.getTrafficLeft()
else:
premium = False
@@ -46,13 +45,13 @@ class FshareVn(Account):
def login(self, user, data, req):
- req.http.c.setopt(REFERER, "https://www.fshare.vn/login.php")
-
- html = req.load('https://www.fshare.vn/login.php', post={
- "login_password": data['password'],
- "login_useremail": user,
- "url_refe": "http://www.fshare.vn/index.php"
- }, referer=True, decode=True)
+ html = req.load("https://www.fshare.vn/login.php",
+ post={'LoginForm[email]' : user,
+ 'LoginForm[password]' : data['password'],
+ 'LoginForm[rememberMe]': 1,
+ 'yt0' : "Login"},
+ referer=True,
+ decode=True)
if not re.search(r'<img\s+alt="VIP"', html):
self.wrongPassword()
diff --git a/module/plugins/accounts/HellshareCz.py b/module/plugins/accounts/HellshareCz.py
index dff2fe394..e559b28e1 100644
--- a/module/plugins/accounts/HellshareCz.py
+++ b/module/plugins/accounts/HellshareCz.py
@@ -9,7 +9,7 @@ from module.plugins.Account import Account
class HellshareCz(Account):
__name__ = "HellshareCz"
__type__ = "account"
- __version__ = "0.15"
+ __version__ = "0.16"
__description__ = """Hellshare.cz account plugin"""
__license__ = "GPLv3"
@@ -52,25 +52,28 @@ class HellshareCz(Account):
def login(self, user, data, req):
- html = req.load('http://www.hellshare.com/')
+ html = req.load('http://www.hellshare.com/', decode=True)
if req.lastEffectiveURL != 'http://www.hellshare.com/':
#Switch to English
self.logDebug("Switch lang - URL: %s" % req.lastEffectiveURL)
+
json = req.load("%s?do=locRouter-show" % req.lastEffectiveURL)
hash = re.search(r"(\-\-[0-9a-f]+\-)", json).group(1)
+
self.logDebug("Switch lang - HASH: %s" % hash)
- html = req.load('http://www.hellshare.com/%s/' % hash)
+
+ html = req.load('http://www.hellshare.com/%s/' % hash, decode=True)
if re.search(self.CREDIT_LEFT_PATTERN, html):
self.logDebug("Already logged in")
return
- html = req.load('http://www.hellshare.com/login?do=loginForm-submit', post={
- "login": "Log in",
- "password": data['password'],
- "username": user,
- "perm_login": "on"
- })
+ html = req.load('http://www.hellshare.com/login?do=loginForm-submit',
+ post={"login": "Log in",
+ "password": data['password'],
+ "username": user,
+ "perm_login": "on"},
+ decode=True)
if "<p>You input a wrong user name or wrong password</p>" in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/HundredEightyUploadCom.py b/module/plugins/accounts/HundredEightyUploadCom.py
index 39f91a8af..319a3feee 100644
--- a/module/plugins/accounts/HundredEightyUploadCom.py
+++ b/module/plugins/accounts/HundredEightyUploadCom.py
@@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount
class HundredEightyUploadCom(XFSAccount):
__name__ = "HundredEightyUploadCom"
__type__ = "account"
- __version__ = "0.02"
+ __version__ = "0.03"
__description__ = """180upload.com account plugin"""
__license__ = "GPLv3"
diff --git a/module/plugins/accounts/JunkyvideoCom.py b/module/plugins/accounts/JunkyvideoCom.py
new file mode 100644
index 000000000..8275ff176
--- /dev/null
+++ b/module/plugins/accounts/JunkyvideoCom.py
@@ -0,0 +1,16 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.internal.XFSAccount import XFSAccount
+
+
+class JunkyvideoCom(XFSAccount):
+ __name__ = "JunkyvideoCom"
+ __type__ = "account"
+ __version__ = "0.01"
+
+ __description__ = """Junkyvideo.com account plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
+
+
+ HOSTER_DOMAIN = "junkyvideo.com"
diff --git a/module/plugins/accounts/Keep2ShareCc.py b/module/plugins/accounts/Keep2ShareCc.py
new file mode 100644
index 000000000..d2ba1d237
--- /dev/null
+++ b/module/plugins/accounts/Keep2ShareCc.py
@@ -0,0 +1,73 @@
+# -*- coding: utf-8 -*-
+
+import re
+import time
+
+from module.plugins.Account import Account
+
+
+class Keep2ShareCc(Account):
+ __name__ = "Keep2ShareCc"
+ __type__ = "account"
+ __version__ = "0.05"
+
+ __description__ = """Keep2Share.cc account plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("aeronaut", "aeronaut@pianoguy.de"),
+ ("Walter Purcaro", "vuolter@gmail.com")]
+
+
+ VALID_UNTIL_PATTERN = r'Premium expires:\s*<b>(.+?)<'
+ TRAFFIC_LEFT_PATTERN = r'Available traffic \(today\):\s*<b><a href="/user/statistic.html">(.+?)<'
+
+ LOGIN_FAIL_PATTERN = r'Please fix the following input errors'
+
+
+ def loadAccountInfo(self, user, req):
+ validuntil = None
+ trafficleft = -1
+ premium = False
+
+ html = req.load("http://keep2share.cc/site/profile.html", decode=True)
+
+ m = re.search(self.VALID_UNTIL_PATTERN, html)
+ if m:
+ expiredate = m.group(1).strip()
+ self.logDebug("Expire date: " + expiredate)
+
+ if expiredate == "LifeTime":
+ premium = True
+ validuntil = -1
+ else:
+ try:
+ validuntil = time.mktime(time.strptime(expiredate, "%Y.%m.%d"))
+
+ except Exception, e:
+ self.logError(e)
+
+ else:
+ premium = True if validuntil > time.mktime(time.gmtime()) else False
+
+ m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
+ if m:
+ try:
+ trafficleft = self.parseTraffic(m.group(1))
+
+ except Exception, e:
+ self.logError(e)
+
+ return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium}
+
+
+ def login(self, user, data, req):
+ req.cj.setCookie("keep2share.cc", "lang", "en")
+
+ html = req.load("http://keep2share.cc/login.html",
+ post={'LoginForm[username]' : user,
+ 'LoginForm[password]' : data['password'],
+ 'LoginForm[rememberMe]': 1,
+ 'yt0' : ""},
+ decode=True)
+
+ if re.search(self.LOGIN_FAIL_PATTERN, html):
+ self.wrongPassword()
diff --git a/module/plugins/accounts/Keep2shareCc.py b/module/plugins/accounts/Keep2shareCc.py
deleted file mode 100644
index ffae02ae4..000000000
--- a/module/plugins/accounts/Keep2shareCc.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# -*- coding: utf-8 -*-
-
-import re
-
-from time import gmtime, mktime, strptime
-
-from module.plugins.Account import Account
-
-
-class Keep2shareCc(Account):
- __name__ = "Keep2shareCc"
- __type__ = "account"
- __version__ = "0.02"
-
- __description__ = """Keep2share.cc account plugin"""
- __license__ = "GPLv3"
- __authors__ = [("aeronaut", "aeronaut@pianoguy.de")]
-
-
- VALID_UNTIL_PATTERN = r'Premium expires: <b>(.+?)</b>'
- TRAFFIC_LEFT_PATTERN = r'Available traffic \(today\):<b><a href="/user/statistic.html">(.+?)</a>'
-
- LOGIN_FAIL_PATTERN = r'Please fix the following input errors'
-
-
- def loadAccountInfo(self, user, req):
- validuntil = None
- trafficleft = None
- premium = None
-
- html = req.load("http://keep2share.cc/site/profile.html", decode=True)
-
- m = re.search(self.VALID_UNTIL_PATTERN, html)
- if m:
- expiredate = m.group(1).strip()
- self.logDebug("Expire date: " + expiredate)
-
- try:
- validuntil = mktime(strptime(expiredate, "%Y.%m.%d"))
-
- except Exception, e:
- self.logError(e)
-
- else:
- if validuntil > mktime(gmtime()):
- premium = True
- else:
- premium = False
- validuntil = None
-
- m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- if m:
- try:
- trafficleft = self.parseTraffic(m.group(1))
-
- except Exception, e:
- self.logError(e)
-
- return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium}
-
-
- def login(self, user, data, req):
- req.cj.setCookie("keep2share.cc", "lang", "en")
-
- html = req.load("http://keep2share.cc/login.html",
- post={'LoginForm[username]': user, 'LoginForm[password]': data['password']})
-
- if re.search(self.LOGIN_FAIL_PATTERN, html):
- self.wrongPassword()
diff --git a/module/plugins/accounts/LetitbitNet.py b/module/plugins/accounts/LetitbitNet.py
index b8244a06d..7f973d2d3 100644
--- a/module/plugins/accounts/LetitbitNet.py
+++ b/module/plugins/accounts/LetitbitNet.py
@@ -7,7 +7,7 @@ from module.plugins.Account import Account
class LetitbitNet(Account):
__name__ = "LetitbitNet"
__type__ = "account"
- __version__ = "0.01"
+ __version__ = "0.02"
__description__ = """Letitbit.net account plugin"""
__license__ = "GPLv3"
@@ -16,7 +16,7 @@ class LetitbitNet(Account):
def loadAccountInfo(self, user, req):
## DISABLED BECAUSE IT GET 'key exausted' EVEN IF VALID ##
- # api_key = self.accounts[user]['password']
+ # api_key = self.getAccountData(user)['password']
# json_data = [api_key, ['key/info']]
# api_rep = req.load('http://api.letitbit.net/json', post={'r': json_dumps(json_data)})
# self.logDebug("API Key Info: " + api_rep)
diff --git a/module/plugins/accounts/LinksnappyCom.py b/module/plugins/accounts/LinksnappyCom.py
index 19986157b..34571d374 100644
--- a/module/plugins/accounts/LinksnappyCom.py
+++ b/module/plugins/accounts/LinksnappyCom.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from hashlib import md5
+import hashlib
from module.plugins.Account import Account
from module.common.json_layer import json_loads
@@ -9,8 +9,7 @@ from module.common.json_layer import json_loads
class LinksnappyCom(Account):
__name__ = "LinksnappyCom"
__type__ = "account"
- __version__ = "0.03"
-
+ __version__ = "0.05"
__description__ = """Linksnappy.com account plugin"""
__license__ = "GPLv3"
__authors__ = [("stickell", "l.stickell@yahoo.it")]
@@ -19,32 +18,40 @@ class LinksnappyCom(Account):
def loadAccountInfo(self, user, req):
data = self.getAccountData(user)
r = req.load('http://gen.linksnappy.com/lseAPI.php',
- get={'act': 'USERDETAILS', 'username': user, 'password': md5(data['password']).hexdigest()})
+ get={'act': 'USERDETAILS', 'username': user, 'password': hashlib.md5(data['password']).hexdigest()})
+
self.logDebug("JSON data: " + r)
+
j = json_loads(r)
if j['error']:
return {"premium": False}
validuntil = j['return']['expire']
+
if validuntil == 'lifetime':
validuntil = -1
+
elif validuntil == 'expired':
return {"premium": False}
+
else:
validuntil = float(validuntil)
if 'trafficleft' not in j['return'] or isinstance(j['return']['trafficleft'], str):
trafficleft = -1
else:
- trafficleft = self.parseTraffic(float(j['return']['trafficleft'] + "MB")
+ trafficleft = self.parseTraffic("%d MB" % j['return']['trafficleft'])
return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft}
def login(self, user, data, req):
- r = req.load('http://gen.linksnappy.com/lseAPI.php',
- get={'act': 'USERDETAILS', 'username': user, 'password': md5(data['password']).hexdigest()})
+ r = req.load("http://gen.linksnappy.com/lseAPI.php",
+ get={'act' : 'USERDETAILS',
+ 'username': user,
+ 'password': hashlib.md5(data['password']).hexdigest()},
+ decode=True)
if 'Invalid Account Details' in r:
self.wrongPassword()
diff --git a/module/plugins/accounts/LomafileCom.py b/module/plugins/accounts/LomafileCom.py
deleted file mode 100644
index cfd21679c..000000000
--- a/module/plugins/accounts/LomafileCom.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from module.plugins.internal.XFSAccount import XFSAccount
-
-
-class LomafileCom(XFSAccount):
- __name__ = "LomafileCom"
- __type__ = "account"
- __version__ = "0.02"
-
- __description__ = """Lomafile.com account plugin"""
- __license__ = "GPLv3"
- __authors__ = [("guidobelix", "guidobelix@hotmail.it")]
-
-
- HOSTER_DOMAIN = "lomafile.com"
diff --git a/module/plugins/accounts/MegaRapidCz.py b/module/plugins/accounts/MegaRapidCz.py
index 41da7ac73..262d5a818 100644
--- a/module/plugins/accounts/MegaRapidCz.py
+++ b/module/plugins/accounts/MegaRapidCz.py
@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-
import re
+import time
-from time import mktime, strptime
from module.plugins.Account import Account
class MegaRapidCz(Account):
__name__ = "MegaRapidCz"
__type__ = "account"
- __version__ = "0.34"
+ __version__ = "0.35"
__description__ = """MegaRapid.cz account plugin"""
__license__ = "GPLv3"
@@ -25,19 +25,19 @@ class MegaRapidCz(Account):
def loadAccountInfo(self, user, req):
- html = req.load("http://megarapid.cz/mujucet/", decode=True)
+ htmll = req.load("http://megarapid.cz/mujucet/", decode=True)
- m = re.search(self.LIMITDL_PATTERN, html)
+ m = re.search(self.LIMITDL_PATTERN, htmll)
if m:
data = self.getAccountData(user)
data['options']['limitDL'] = [int(m.group(1))]
- m = re.search(self.VALID_UNTIL_PATTERN, html)
+ m = re.search(self.VALID_UNTIL_PATTERN, htmll)
if m:
- validuntil = mktime(strptime(m.group(1), "%d.%m.%Y - %H:%M"))
+ validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y - %H:%M"))
return {"premium": True, "trafficleft": -1, "validuntil": validuntil}
- m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
+ m = re.search(self.TRAFFIC_LEFT_PATTERN, htmll)
if m:
trafficleft = float(m.group(1)) * (1 << 20)
return {"premium": True, "trafficleft": trafficleft, "validuntil": -1}
@@ -46,12 +46,13 @@ class MegaRapidCz(Account):
def login(self, user, data, req):
- htm = req.load("http://megarapid.cz/prihlaseni/")
- if "Heslo:" in htm:
- start = htm.index('id="inp_hash" name="hash" value="')
- htm = htm[start + 33:]
- hashes = htm[0:32]
- htm = req.load("http://megarapid.cz/prihlaseni/",
+ html = req.load("http://megarapid.cz/prihlaseni/", decode=True)
+
+ if "Heslo:" in html:
+ start = html.index('id="inp_hash" name="hash" value="')
+ html = html[start + 33:]
+ hashes = html[0:32]
+ html = req.load("http://megarapid.cz/prihlaseni/",
post={"hash": hashes,
"login": user,
"pass1": data['password'],
diff --git a/module/plugins/accounts/MegaRapidoNet.py b/module/plugins/accounts/MegaRapidoNet.py
new file mode 100644
index 000000000..d061d02bc
--- /dev/null
+++ b/module/plugins/accounts/MegaRapidoNet.py
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+
+import re
+import time
+
+from module.plugins.Account import Account
+
+
+class MegaRapidoNet(Account):
+ __name__ = "MegaRapidoNet"
+ __type__ = "account"
+ __version__ = "0.02"
+
+ __description__ = """MegaRapido.net account plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")]
+
+
+ VALID_UNTIL_PATTERN = r'<\s*?div[^>]*?class\s*?=\s*?[\'"]premium_index[\'"].*?>[^<]*?<[^>]*?b.*?>\s*?TEMPO\s*?PREMIUM.*?<[^>]*?/b.*?>\s*?(\d*)[^\d]*?DIAS[^\d]*?(\d*)[^\d]*?HORAS[^\d]*?(\d*)[^\d]*?MINUTOS[^\d]*?(\d*)[^\d]*?SEGUNDOS'
+ USER_ID_PATTERN = r'<\s*?div[^>]*?class\s*?=\s*?["\']checkbox_compartilhar["\'].*?>.*?<\s*?input[^>]*?name\s*?=\s*?["\']usar["\'].*?>.*?<\s*?input[^>]*?name\s*?=\s*?["\']user["\'][^>]*?value\s*?=\s*?["\'](.*?)\s*?["\']'
+
+
+ def loadAccountInfo(self, user, req):
+ validuntil = None
+ trafficleft = None
+ premium = False
+
+ html = req.load("http://megarapido.net/gerador", decode=True)
+
+ validuntil = re.search(self.VALID_UNTIL_PATTERN, html)
+ if validuntil:
+ #hier weitermachen!!! (müssen umbedingt die zeit richtig machen damit! (sollte aber möglich))
+ validuntil = time.time() + int(validuntil.group(1)) * 24 * 3600 + int(validuntil.group(2)) * 3600 + int(validuntil.group(3)) * 60 + int(validuntil.group(4))
+ trafficleft = -1
+ premium = True
+
+ return {'validuntil' : validuntil,
+ 'trafficleft': trafficleft,
+ 'premium' : premium}
+
+
+ def login(self, user, data, req):
+ req.load("http://megarapido.net/login")
+ req.load("http://megarapido.net/painel_user/ajax/logar.php",
+ post={'login': user, 'senha': data['password']},
+ decode=True)
+
+ html = req.load("http://megarapido.net/gerador")
+
+ if "sair" not in html.lower():
+ self.wrongPassword()
+ else:
+ m = re.search(self.USER_ID_PATTERN, html)
+ if m:
+ data['uid'] = m.group(1)
+ else:
+ self.fail("Couldn't find the user ID")
diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py
index 6e0a4358e..3d7ddbe46 100644
--- a/module/plugins/accounts/MegasharesCom.py
+++ b/module/plugins/accounts/MegasharesCom.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import re
-from time import mktime, strptime
+import time
from module.plugins.Account import Account
@@ -9,7 +9,7 @@ from module.plugins.Account import Account
class MegasharesCom(Account):
__name__ = "MegasharesCom"
__type__ = "account"
- __version__ = "0.02"
+ __version__ = "0.03"
__description__ = """Megashares.com account plugin"""
__license__ = "GPLv3"
@@ -29,7 +29,7 @@ class MegasharesCom(Account):
try:
timestr = re.search(self.VALID_UNTIL_PATTERN, html).group(1)
self.logDebug(timestr)
- validuntil = mktime(strptime(timestr, "%b %d, %Y"))
+ validuntil = time.mktime(time.strptime(timestr, "%b %d, %Y"))
except Exception, e:
self.logError(e)
@@ -37,12 +37,12 @@ class MegasharesCom(Account):
def login(self, user, data, req):
- html = req.load('http://d01.megashares.com/myms_login.php', post={
- "httpref": "",
- "myms_login": "Login",
- "mymslogin_name": user,
- "mymspassword": data['password']
- }, decode=True)
+ html = req.load('http://d01.megashares.com/myms_login.php',
+ post={"httpref" : "",
+ "myms_login" : "Login",
+ "mymslogin_name": user,
+ "mymspassword" : data['password']},
+ decode=True)
if not '<span class="b ml">%s</span>' % user in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/MultihostersCom.py b/module/plugins/accounts/MultihostersCom.py
new file mode 100644
index 000000000..e98f17b2d
--- /dev/null
+++ b/module/plugins/accounts/MultihostersCom.py
@@ -0,0 +1,16 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.accounts.ZeveraCom import ZeveraCom
+
+
+class MultihostersCom(ZeveraCom):
+ __name__ = "MultihostersCom"
+ __type__ = "account"
+ __version__ = "0.03"
+
+ __description__ = """Multihosters.com account plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("tjeh", "tjeh@gmx.net")]
+
+
+ HOSTER_DOMAIN = "multihosters.com"
diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py
index 878413007..3488e3288 100644
--- a/module/plugins/accounts/MultishareCz.py
+++ b/module/plugins/accounts/MultishareCz.py
@@ -8,7 +8,7 @@ from module.plugins.Account import Account
class MultishareCz(Account):
__name__ = "MultishareCz"
__type__ = "account"
- __version__ = "0.04"
+ __version__ = "0.05"
__description__ = """Multishare.cz account plugin"""
__license__ = "GPLv3"
@@ -16,7 +16,7 @@ class MultishareCz(Account):
TRAFFIC_LEFT_PATTERN = r'<span class="profil-zvyrazneni">Kredit:</span>\s*<strong>(?P<S>[\d.,]+)&nbsp;(?P<U>[\w^_]+)</strong>'
- ACCOUNT_INFO_PATTERN = r'<input type="hidden" id="(u_ID|u_hash)" name="[^"]*" value="([^"]+)">'
+ ACCOUNT_INFO_PATTERN = r'<input type="hidden" id="(u_ID|u_hash)" name=".+?" value="(.+?)">'
def loadAccountInfo(self, user, req):
@@ -34,11 +34,11 @@ class MultishareCz(Account):
def login(self, user, data, req):
- html = req.load('http://www.multishare.cz/html/prihlaseni_process.php', post={
- "akce": "Přihlásit",
- "heslo": data['password'],
- "jmeno": user
- }, decode=True)
+ html = req.load('http://www.multishare.cz/html/prihlaseni_process.php',
+ post={"akce" : "Přihlásit",
+ "heslo": data['password'],
+ "jmeno": user},
+ decode=True)
if '<div class="akce-chyba akce">' in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/MyfastfileCom.py b/module/plugins/accounts/MyfastfileCom.py
index 36923470e..9a13e2e42 100644
--- a/module/plugins/accounts/MyfastfileCom.py
+++ b/module/plugins/accounts/MyfastfileCom.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from time import time
+import time
from module.common.json_layer import json_loads
from module.plugins.Account import Account
@@ -9,7 +9,7 @@ from module.plugins.Account import Account
class MyfastfileCom(Account):
__name__ = "MyfastfileCom"
__type__ = "account"
- __version__ = "0.03"
+ __version__ = "0.04"
__description__ = """Myfastfile.com account plugin"""
__license__ = "GPLv3"
@@ -18,7 +18,7 @@ class MyfastfileCom(Account):
def loadAccountInfo(self, user, req):
if 'days_left' in self.json_data:
- validuntil = time() + self.json_data['days_left'] * 24 * 60 * 60
+ validuntil = time.time() + self.json_data['days_left'] * 24 * 60 * 60
return {"premium": True, "validuntil": validuntil, "trafficleft": -1}
else:
self.logError(_("Unable to get account information"))
@@ -27,8 +27,10 @@ class MyfastfileCom(Account):
def login(self, user, data, req):
# Password to use is the API-Password written in http://myfastfile.com/myaccount
html = req.load("http://myfastfile.com/api.php",
- get={"user": user, "pass": data['password']})
+ get={"user": user, "pass": data['password']})
+
self.logDebug("JSON data: " + html)
+
self.json_data = json_loads(html)
if self.json_data['status'] != 'ok':
self.logError(_('Invalid login. The password to use is the API-Password you find in your "My Account" page'))
diff --git a/module/plugins/accounts/NetloadIn.py b/module/plugins/accounts/NetloadIn.py
deleted file mode 100755
index 15bad6966..000000000
--- a/module/plugins/accounts/NetloadIn.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- coding: utf-8 -*-
-
-import re
-from time import time
-
-from module.plugins.Account import Account
-
-
-class NetloadIn(Account):
- __name__ = "NetloadIn"
- __type__ = "account"
- __version__ = "0.22"
-
- __description__ = """Netload.in account plugin"""
- __license__ = "GPLv3"
- __authors__ = [("RaNaN", "RaNaN@pyload.org"),
- ("CryNickSystems", "webmaster@pcProfil.de")]
-
-
- def loadAccountInfo(self, user, req):
- html = req.load("http://netload.in/index.php", get={'id': 2, 'lang': "de"})
- left = r'>(\d+) (Tag|Tage), (\d+) Stunden<'
- left = re.search(left, html)
- if left:
- validuntil = time() + int(left.group(1)) * 24 * 60 * 60 + int(left.group(3)) * 60 * 60
- trafficleft = -1
- premium = True
- else:
- validuntil = None
- premium = False
- trafficleft = None
- return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium}
-
-
- def login(self, user, data, req):
- html = req.load("http://netload.in/index.php", None,
- {"txtuser": user, "txtpass": data['password'], "txtcheck": "login", "txtlogin": "Login"},
- cookies=True)
- if "password or it might be invalid!" in html:
- self.wrongPassword()
diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py
new file mode 100644
index 000000000..7e3f757d3
--- /dev/null
+++ b/module/plugins/accounts/NoPremiumPl.py
@@ -0,0 +1,81 @@
+# -*- coding: utf-8 -*-
+
+import datetime
+import hashlib
+import time
+
+from module.plugins.Account import Account
+from module.common.json_layer import json_loads as loads
+
+
+class NoPremiumPl(Account):
+ __name__ = "NoPremiumPl"
+ __version__ = "0.01"
+ __type__ = "account"
+ __description__ = "NoPremium.pl account plugin"
+ __license__ = "GPLv3"
+ __authors__ = [("goddie", "dev@nopremium.pl")]
+
+ _api_url = "http://crypt.nopremium.pl"
+
+ _api_query = {
+ "site": "nopremium",
+ "username": "",
+ "password": "",
+ "output": "json",
+ "loc": "1",
+ "info": "1"
+ }
+
+ _req = None
+ _usr = None
+ _pwd = None
+
+ def loadAccountInfo(self, name, req):
+ self._req = req
+ try:
+ result = loads(self.runAuthQuery())
+ except Exception:
+ # todo: return or let it be thrown?
+ return
+
+ premium = False
+ valid_untill = -1
+
+ if "expire" in result.keys() and result["expire"]:
+ premium = True
+ valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result["expire"])).timetuple())
+ traffic_left = result["balance"] * 1024
+
+ return ({
+ "validuntil": valid_untill,
+ "trafficleft": traffic_left,
+ "premium": premium
+ })
+
+ def login(self, user, data, req):
+ self._usr = user
+ self._pwd = hashlib.sha1(hashlib.md5(data["password"]).hexdigest()).hexdigest()
+ self._req = req
+
+ try:
+ response = loads(self.runAuthQuery())
+ except Exception:
+ self.wrongPassword()
+
+ if "errno" in response.keys():
+ self.wrongPassword()
+ data['usr'] = self._usr
+ data['pwd'] = self._pwd
+
+ def createAuthQuery(self):
+ query = self._api_query
+ query["username"] = self._usr
+ query["password"] = self._pwd
+
+ return query
+
+ def runAuthQuery(self):
+ data = self._req.load(self._api_url, post=self.createAuthQuery())
+
+ return data \ No newline at end of file
diff --git a/module/plugins/accounts/NowVideoAt.py b/module/plugins/accounts/NowVideoSx.py
index 234984b6b..2f7b033bd 100644
--- a/module/plugins/accounts/NowVideoAt.py
+++ b/module/plugins/accounts/NowVideoSx.py
@@ -1,16 +1,15 @@
# -*- coding: utf-8 -*-
import re
-
-from time import gmtime, mktime, strptime
+import time
from module.plugins.Account import Account
-class NowVideoAt(Account):
- __name__ = "NowVideoAt"
+class NowVideoSx(Account):
+ __name__ = "NowVideoSx"
__type__ = "account"
- __version__ = "0.01"
+ __version__ = "0.03"
__description__ = """NowVideo.at account plugin"""
__license__ = "GPLv3"
@@ -25,7 +24,7 @@ class NowVideoAt(Account):
trafficleft = -1
premium = None
- html = req.load("http://www.nowvideo.at/premium.php")
+ html = req.load("http://www.nowvideo.sx/premium.php")
m = re.search(self.VALID_UNTIL_PATTERN, html)
if m:
@@ -33,13 +32,13 @@ class NowVideoAt(Account):
self.logDebug("Expire date: " + expiredate)
try:
- validuntil = mktime(strptime(expiredate, "%Y-%b-%d"))
+ validuntil = time.mktime(time.strptime(expiredate, "%Y-%b-%d"))
except Exception, e:
self.logError(e)
else:
- if validuntil > mktime(gmtime()):
+ if validuntil > time.mktime(time.gmtime()):
premium = True
else:
premium = False
@@ -49,8 +48,9 @@ class NowVideoAt(Account):
def login(self, user, data, req):
- html = req.load("http://www.nowvideo.at/login.php",
- post={'user': user, 'pass': data['password']})
+ html = req.load("http://www.nowvideo.sx/login.php",
+ post={'user': user, 'pass': data['password']},
+ decode=True)
- if ">Invalid login details" is html:
+ if re.search(r'>Log In<', html):
self.wrongPassword()
diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py
index 4d90e1b25..020a45ba7 100644
--- a/module/plugins/accounts/OboomCom.py
+++ b/module/plugins/accounts/OboomCom.py
@@ -1,8 +1,20 @@
# -*- coding: utf-8 -*-
-import time
+try:
+ from beaker.crypto.pbkdf2 import PBKDF2
-from beaker.crypto.pbkdf2 import PBKDF2
+except ImportError:
+ from beaker.crypto.pbkdf2 import pbkdf2
+ from binascii import b2a_hex
+
+ class PBKDF2(object):
+ def __init__(self, passphrase, salt, iterations=1000):
+ self.passphrase = passphrase
+ self.salt = salt
+ self.iterations = iterations
+
+ def hexread(self, octets):
+ return b2a_hex(pbkdf2(self.passphrase, self.salt, self.iterations, octets))
from module.common.json_layer import json_loads
from module.plugins.Account import Account
@@ -11,7 +23,7 @@ from module.plugins.Account import Account
class OboomCom(Account):
__name__ = "OboomCom"
__type__ = "account"
- __version__ = "0.22"
+ __version__ = "0.24"
__description__ = """Oboom.com account plugin"""
__license__ = "GPLv3"
@@ -20,12 +32,15 @@ class OboomCom(Account):
def loadAccountData(self, user, req):
passwd = self.getAccountData(user)['password']
- salt = passwd[::-1]
+ salt = passwd[::-1]
pbkdf2 = PBKDF2(passwd, salt, 1000).hexread(16)
+
result = json_loads(req.load("https://www.oboom.com/1/login", get={"auth": user, "pass": pbkdf2}))
+
if not result[0] == 200:
self.logWarning(_("Failed to log in: %s") % result[1])
self.wrongPassword()
+
return result[1]
diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py
index 2f1c914c1..b19e2bc69 100644
--- a/module/plugins/accounts/OneFichierCom.py
+++ b/module/plugins/accounts/OneFichierCom.py
@@ -1,10 +1,8 @@
# -*- coding: utf-8 -*-
+import pycurl
import re
-
-from time import strptime, mktime
-
-from pycurl import REFERER
+import time
from module.plugins.Account import Account
@@ -12,7 +10,7 @@ from module.plugins.Account import Account
class OneFichierCom(Account):
__name__ = "OneFichierCom"
__type__ = "account"
- __version__ = "0.11"
+ __version__ = "0.12"
__description__ = """1fichier.com account plugin"""
__license__ = "GPLv3"
@@ -36,7 +34,7 @@ class OneFichierCom(Account):
self.logDebug("Expire date: " + expiredate)
try:
- validuntil = mktime(strptime(expiredate, "%d/%m/%Y"))
+ validuntil = time.mktime(time.strptime(expiredate, "%d/%m/%Y"))
except Exception, e:
self.logError(e)
else:
@@ -46,10 +44,15 @@ class OneFichierCom(Account):
def login(self, user, data, req):
- req.http.c.setopt(REFERER, "https://1fichier.com/login.pl?lg=en")
+ req.http.c.setopt(pycurl.REFERER, "https://1fichier.com/login.pl?lg=en")
html = req.load("https://1fichier.com/login.pl?lg=en",
- post={'mail': user, 'pass': data['password'], 'It': "on", 'purge': "off", 'valider': "Send"})
+ post={'mail' : user,
+ 'pass' : data['password'],
+ 'It' : "on",
+ 'purge' : "off",
+ 'valider': "Send"},
+ decode=True)
if '>Invalid email address' in html or '>Invalid password' in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/OverLoadMe.py b/module/plugins/accounts/OverLoadMe.py
index fb9732986..64d04aded 100644
--- a/module/plugins/accounts/OverLoadMe.py
+++ b/module/plugins/accounts/OverLoadMe.py
@@ -7,7 +7,7 @@ from module.common.json_layer import json_loads
class OverLoadMe(Account):
__name__ = "OverLoadMe"
__type__ = "account"
- __version__ = "0.01"
+ __version__ = "0.04"
__description__ = """Over-Load.me account plugin"""
__license__ = "GPLv3"
@@ -15,21 +15,28 @@ class OverLoadMe(Account):
def loadAccountInfo(self, user, req):
- data = self.getAccountData(user)
- html = req.load("https://api.over-load.me/account.php", get={"user": user, "auth": data['password']}).strip()
+ https = "https" if self.getConfig('ssl') else "http"
+ data = self.getAccountData(user)
+ html = req.load(https + "://api.over-load.me/account.php",
+ get={'user': user,
+ 'auth': data['password']}).strip()
+
data = json_loads(html)
+ self.logDebug(data)
# Check for premium
if data['membership'] == "Free":
- return {"premium": False}
-
- account_info = {"validuntil": data['expirationunix'], "trafficleft": -1}
- return account_info
+ return {'premium': False, 'validuntil': None, 'trafficleft': None}
+ else:
+ return {'premium': True, 'validuntil': data['expirationunix'], 'trafficleft': -1}
def login(self, user, data, req):
- jsondata = req.load("https://api.over-load.me/account.php",
- get={"user": user, "auth": data['password']}).strip()
+ https = "https" if self.getConfig('ssl') else "http"
+ jsondata = req.load(https + "://api.over-load.me/account.php",
+ get={'user': user,
+ 'auth': data['password']}).strip()
+
data = json_loads(jsondata)
if data['err'] == 1:
diff --git a/module/plugins/accounts/PremiumTo.py b/module/plugins/accounts/PremiumTo.py
index efc64706b..c8ea2fa26 100644
--- a/module/plugins/accounts/PremiumTo.py
+++ b/module/plugins/accounts/PremiumTo.py
@@ -6,7 +6,7 @@ from module.plugins.Account import Account
class PremiumTo(Account):
__name__ = "PremiumTo"
__type__ = "account"
- __version__ = "0.05"
+ __version__ = "0.08"
__description__ = """Premium.to account plugin"""
__license__ = "GPLv3"
@@ -16,19 +16,22 @@ class PremiumTo(Account):
def loadAccountInfo(self, user, req):
- api_r = req.load("http://premium.to/api/straffic.php",
- get={'username': self.username, 'password': self.password})
+ traffic = req.load("http://premium.to/api/straffic.php",
+ get={'username': self.username, 'password': self.password})
- trafficleft = float(sum(map(int, api_r.split(';')))) / 1024 #@TODO: Remove `/ 1024` in 0.4.10
-
- return {'premium': True, 'trafficleft': trafficleft, 'validuntil': -1}
+ if "wrong username" not in traffic:
+ trafficleft = sum(map(float, traffic.split(';'))) / 1024 #@TODO: Remove `/ 1024` in 0.4.10
+ return {'premium': True, 'trafficleft': trafficleft, 'validuntil': -1}
+ else:
+ return {'premium': False, 'trafficleft': None, 'validuntil': None}
def login(self, user, data, req):
self.username = user
self.password = data['password']
authcode = req.load("http://premium.to/api/getauthcode.php",
- get={'username': user, 'password': self.password}).strip()
+ get={'username': user, 'password': self.password},
+ decode=True)
if "wrong username" in authcode:
self.wrongPassword()
diff --git a/module/plugins/accounts/PremiumizeMe.py b/module/plugins/accounts/PremiumizeMe.py
index c1abde309..7d061ec2d 100644
--- a/module/plugins/accounts/PremiumizeMe.py
+++ b/module/plugins/accounts/PremiumizeMe.py
@@ -8,7 +8,7 @@ from module.common.json_layer import json_loads
class PremiumizeMe(Account):
__name__ = "PremiumizeMe"
__type__ = "account"
- __version__ = "0.12"
+ __version__ = "0.13"
__description__ = """Premiumize.me account plugin"""
__license__ = "GPLv3"
@@ -45,5 +45,5 @@ class PremiumizeMe(Account):
answer = req.load("https://api.premiumize.me/pm-api/v1.php",
get={'method' : "accountstatus",
'params[login]': user,
- 'params[pass]' : self.accounts[user]['password']})
+ 'params[pass]' : self.getAccountData(user)['password']})
return json_loads(answer)
diff --git a/module/plugins/accounts/PutdriveCom.py b/module/plugins/accounts/PutdriveCom.py
new file mode 100644
index 000000000..4f2fadbcc
--- /dev/null
+++ b/module/plugins/accounts/PutdriveCom.py
@@ -0,0 +1,16 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.accounts.ZeveraCom import ZeveraCom
+
+
+class PutdriveCom(ZeveraCom):
+ __name__ = "PutdriveCom"
+ __type__ = "account"
+ __version__ = "0.02"
+
+ __description__ = """Putdrive.com account plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
+
+
+ HOSTER_DOMAIN = "putdrive.com"
diff --git a/module/plugins/accounts/QuickshareCz.py b/module/plugins/accounts/QuickshareCz.py
index 18af5f736..16141d63e 100644
--- a/module/plugins/accounts/QuickshareCz.py
+++ b/module/plugins/accounts/QuickshareCz.py
@@ -8,7 +8,7 @@ from module.plugins.Account import Account
class QuickshareCz(Account):
__name__ = "QuickshareCz"
__type__ = "account"
- __version__ = "0.02"
+ __version__ = "0.03"
__description__ = """Quickshare.cz account plugin"""
__license__ = "GPLv3"
@@ -33,11 +33,11 @@ class QuickshareCz(Account):
def login(self, user, data, req):
- html = req.load('http://www.quickshare.cz/html/prihlaseni_process.php', post={
- "akce": u'Přihlásit',
- "heslo": data['password'],
- "jmeno": user
- }, decode=True)
+ html = req.load('http://www.quickshare.cz/html/prihlaseni_process.php',
+ post={"akce": u'Přihlásit',
+ "heslo": data['password'],
+ "jmeno": user},
+ decode=True)
if u'>Takový uživatel neexistuje.<' in html or u'>Špatné heslo.<' in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py
index 813453c03..829e54a46 100644
--- a/module/plugins/accounts/RPNetBiz.py
+++ b/module/plugins/accounts/RPNetBiz.py
@@ -7,7 +7,7 @@ from module.common.json_layer import json_loads
class RPNetBiz(Account):
__name__ = "RPNetBiz"
__type__ = "account"
- __version__ = "0.11"
+ __version__ = "0.12"
__description__ = """RPNet.biz account plugin"""
__license__ = "GPLv3"
@@ -44,7 +44,7 @@ class RPNetBiz(Account):
def getAccountStatus(self, user, req):
# Using the rpnet API, check if valid premium account
res = req.load("https://premium.rpnet.biz/client_api.php",
- get={"username": user, "password": self.accounts[user]['password'],
+ get={"username": user, "password": self.getAccountData(user)['password'],
"action": "showAccountInformation"})
self.logDebug("JSON data: %s" % res)
diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py
new file mode 100644
index 000000000..3e9d52fe8
--- /dev/null
+++ b/module/plugins/accounts/RapideoPl.py
@@ -0,0 +1,80 @@
+# -*- coding: utf-8 -*-
+
+import datetime
+import hashlib
+import time
+
+from module.plugins.Account import Account
+from module.common.json_layer import json_loads as loads
+
+
+class RapideoPl(Account):
+ __name__ = "RapideoPl"
+ __version__ = "0.01"
+ __type__ = "account"
+ __description__ = "Rapideo.pl account plugin"
+ __license__ = "GPLv3"
+ __authors__ = [("goddie", "dev@rapideo.pl")]
+
+ _api_url = "http://enc.rapideo.pl"
+
+ _api_query = {
+ "site": "newrd",
+ "username": "",
+ "password": "",
+ "output": "json",
+ "loc": "1",
+ "info": "1"
+ }
+
+ _req = None
+ _usr = None
+ _pwd = None
+
+ def loadAccountInfo(self, name, req):
+ self._req = req
+ try:
+ result = loads(self.runAuthQuery())
+ except Exception:
+ # todo: return or let it be thrown?
+ return
+
+ premium = False
+ valid_untill = -1
+ if "expire" in result.keys() and result["expire"]:
+ premium = True
+ valid_untill = time.mktime(datetime.datetime.fromtimestamp(int(result["expire"])).timetuple())
+
+ traffic_left = result["balance"]
+
+ return ({
+ "validuntil": valid_untill,
+ "trafficleft": traffic_left,
+ "premium": premium
+ })
+
+ def login(self, user, data, req):
+ self._usr = user
+ self._pwd = hashlib.md5(data["password"]).hexdigest()
+ self._req = req
+ try:
+ response = loads(self.runAuthQuery())
+ except Exception:
+ self.wrongPassword()
+
+ if "errno" in response.keys():
+ self.wrongPassword()
+ data['usr'] = self._usr
+ data['pwd'] = self._pwd
+
+ def createAuthQuery(self):
+ query = self._api_query
+ query["username"] = self._usr
+ query["password"] = self._pwd
+
+ return query
+
+ def runAuthQuery(self):
+ data = self._req.load(self._api_url, post=self.createAuthQuery())
+
+ return data \ No newline at end of file
diff --git a/module/plugins/accounts/RapidgatorNet.py b/module/plugins/accounts/RapidgatorNet.py
index 2899d5a68..23d7aff53 100644
--- a/module/plugins/accounts/RapidgatorNet.py
+++ b/module/plugins/accounts/RapidgatorNet.py
@@ -7,51 +7,65 @@ from module.common.json_layer import json_loads
class RapidgatorNet(Account):
__name__ = "RapidgatorNet"
__type__ = "account"
- __version__ = "0.05"
+ __version__ = "0.09"
__description__ = """Rapidgator.net account plugin"""
__license__ = "GPLv3"
__authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
- API_URL = 'http://rapidgator.net/api/user'
+ API_URL = "http://rapidgator.net/api/user"
def loadAccountInfo(self, user, req):
+ validuntil = None
+ trafficleft = None
+ premium = False
+ sid = None
+
try:
- sid = self.getAccountData(user).get('SID')
+ sid = self.getAccountData(user).get('sid')
assert sid
- json = req.load("%s/info?sid=%s" % (self.API_URL, sid))
- self.logDebug("API:USERINFO", json)
- json = json_loads(json)
+ html = req.load("%s/info" % self.API_URL, get={'sid': sid})
+
+ self.logDebug("API:USERINFO", html)
+
+ json = json_loads(html)
if json['response_status'] == 200:
if "reset_in" in json['response']:
self.scheduleRefresh(user, json['response']['reset_in'])
- return {"validuntil": json['response']['expire_date'],
- "trafficleft": float(json['response']['traffic_left']) / 1024, #@TODO: Remove `/ 1024` in 0.4.10
- "premium": True}
+ validuntil = json['response']['expire_date']
+ trafficleft = float(json['response']['traffic_left']) / 1024 #@TODO: Remove `/ 1024` in 0.4.10
+ premium = True
else:
self.logError(json['response_details'])
+
except Exception, e:
self.logError(e)
- return {"validuntil": None, "trafficleft": None, "premium": False}
+ return {'validuntil' : validuntil,
+ 'trafficleft': trafficleft,
+ 'premium' : premium,
+ 'sid' : sid}
def login(self, user, data, req):
try:
- json = req.load('%s/login' % self.API_URL, post={"username": user, "password": data['password']})
- self.logDebug("API:LOGIN", json)
- json = json_loads(json)
+ html = req.load('%s/login' % self.API_URL, post={"username": user, "password": data['password']})
+
+ self.logDebug("API:LOGIN", html)
+
+ json = json_loads(html)
if json['response_status'] == 200:
- data['SID'] = str(json['response']['session_id'])
+ data['sid'] = str(json['response']['session_id'])
return
else:
self.logError(json['response_details'])
+
except Exception, e:
self.logError(e)
diff --git a/module/plugins/accounts/RapiduNet.py b/module/plugins/accounts/RapiduNet.py
index fe465bc48..70f47b673 100644
--- a/module/plugins/accounts/RapiduNet.py
+++ b/module/plugins/accounts/RapiduNet.py
@@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
import re
+import time
+
from module.plugins.Account import Account
from module.common.json_layer import json_loads
@@ -8,40 +10,56 @@ from module.common.json_layer import json_loads
class RapiduNet(Account):
__name__ = "RapiduNet"
__type__ = "account"
- __version__ = "0.02"
+ __version__ = "0.05"
__description__ = """Rapidu.net account plugin"""
__license__ = "GPLv3"
- __authors__ = [("prOq", None)]
+ __authors__ = [("prOq", None),
+ ("Walter Purcaro", "vuolter@gmail.com")]
+
+
+ PREMIUM_PATTERN = r'>Account: <b>Premium'
+ VALID_UNTIL_PATTERN = r'>Account: <b>\w+ \((\d+)'
- PREMIUM_PATTERN = r'<a href="premium/" style="padding-left: 0px;">Account: <b>Premium</b></a>'
+ TRAFFIC_LEFT_PATTERN = r'class="tipsyS"><b>(.+?)<'
def loadAccountInfo(self, user, req):
- info = {'validuntil': None, 'trafficleft': None, 'premium': False}
+ validuntil = None
+ trafficleft = -1
+ premium = False
- req.load("https://rapidu.net/ajax.php", get={'a': "getChangeLang"}, post={"_go": "", "lang": "en"})
html = req.load("https://rapidu.net/", decode=True)
if re.search(self.PREMIUM_PATTERN, html):
- info['premium'] = True
+ premium = True
- return info
+ m = re.search(self.VALID_UNTIL_PATTERN, html)
+ if m:
+ validuntil = time.time() + (86400 * int(m.group(1)))
+ m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
+ if m:
+ trafficleft = self.parseTraffic(m.group(1))
- def login(self, user, data, req):
- try:
- json = json_loads(req.load("https://rapidu.net/ajax.php?a=getUserLogin",
- post={'_go': "",
- 'login': user,
- 'pass': data['password'],
- 'member': "1"}))
-
- self.logDebug(json)
+ return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium}
- if not json['message'] == "success":
- self.wrongPassword()
- except Exception, e:
- self.logError(e)
+ def login(self, user, data, req):
+ req.load("https://rapidu.net/ajax.php",
+ get={'a': "getChangeLang"},
+ post={'_go' : "",
+ 'lang': "en"})
+
+ json = json_loads(req.load("https://rapidu.net/ajax.php",
+ get={'a': "getUserLogin"},
+ post={'_go' : "",
+ 'login' : user,
+ 'pass' : data['password'],
+ 'remember': "1"}))
+
+ self.logDebug(json)
+
+ if not json['message'] == "success":
+ self.wrongPassword()
diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py
index 48b17df5f..41d8a0975 100644
--- a/module/plugins/accounts/RealdebridCom.py
+++ b/module/plugins/accounts/RealdebridCom.py
@@ -8,7 +8,7 @@ from module.plugins.Account import Account
class RealdebridCom(Account):
__name__ = "RealdebridCom"
__type__ = "account"
- __version__ = "0.44"
+ __version__ = "0.45"
__description__ = """Real-Debrid.com account plugin"""
__license__ = "GPLv3"
@@ -28,9 +28,13 @@ class RealdebridCom(Account):
def login(self, user, data, req):
self.pin_code = False
- html = req.load("https://real-debrid.com/ajax/login.php", get={"user": user, "pass": data['password']})
+ html = req.load("https://real-debrid.com/ajax/login.php",
+ get={"user": user, "pass": data['password']},
+ decode=True)
+
if "Your login informations are incorrect" in html:
self.wrongPassword()
+
elif "PIN Code required" in html:
self.logWarning(_("PIN code required. Please login to https://real-debrid.com using the PIN or disable the double authentication in your control panel on https://real-debrid.com"))
self.pin_code = True
diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py
index 00a45dedd..04e71c9ad 100644
--- a/module/plugins/accounts/RehostTo.py
+++ b/module/plugins/accounts/RehostTo.py
@@ -6,7 +6,7 @@ from module.plugins.Account import Account
class RehostTo(Account):
__name__ = "RehostTo"
__type__ = "account"
- __version__ = "0.11"
+ __version__ = "0.16"
__description__ = """Rehost.to account plugin"""
__license__ = "GPLv3"
@@ -14,32 +14,41 @@ class RehostTo(Account):
def loadAccountInfo(self, user, req):
- data = self.getAccountData(user)
- html = req.load("http://rehost.to/api.php",
- get={'cmd': "login", 'user': user, 'pass': data['password']})
- data = [x.split("=") for x in html.split(",")]
- ses = data[0][1]
- long_ses = data[1][1]
+ premium = False
+ trafficleft = None
+ validuntil = -1
+ session = ""
html = req.load("http://rehost.to/api.php",
- get={'cmd': "get_premium_credits", 'long_ses': long_ses})
+ get={'cmd' : "login", 'user': user,
+ 'pass': self.getAccountData(user)['password']})
+ try:
+ session = html.split(",")[1].split("=")[1]
- traffic, valid = html.split(",")
+ html = req.load("http://rehost.to/api.php",
+ get={'cmd': "get_premium_credits", 'long_ses': session})
- trafficleft = self.parseTraffic(traffic + "MB")
- validuntil = float(valid)
+ if html.strip() == "0,0" or "ERROR" in html:
+ self.logDebug(html)
+ else:
+ traffic, valid = html.split(",")
- account_info = {"trafficleft": trafficleft,
- "validuntil" : validuntil,
- "long_ses" : long_ses,
- "ses" : ses}
+ premium = True
+ trafficleft = self.parseTraffic(traffic + "MB")
+ validuntil = float(valid)
- return account_info
+ finally:
+ return {'premium' : premium,
+ 'trafficleft': trafficleft,
+ 'validuntil' : validuntil,
+ 'session' : session}
def login(self, user, data, req):
html = req.load("http://rehost.to/api.php",
- get={'cmd': "login", 'user': user, 'pass': data['password']})
+ get={'cmd': "login", 'user': user, 'pass': data['password']},
+ decode=True)
- if "Login failed." in html:
+ if "ERROR" in html:
+ self.logDebug(html)
self.wrongPassword()
diff --git a/module/plugins/accounts/RyushareCom.py b/module/plugins/accounts/RyushareCom.py
index ca476366b..8c56ff20f 100644
--- a/module/plugins/accounts/RyushareCom.py
+++ b/module/plugins/accounts/RyushareCom.py
@@ -6,20 +6,11 @@ from module.plugins.internal.XFSAccount import XFSAccount
class RyushareCom(XFSAccount):
__name__ = "RyushareCom"
__type__ = "account"
- __version__ = "0.05"
+ __version__ = "0.06"
__description__ = """Ryushare.com account plugin"""
__license__ = "GPLv3"
- __authors__ = [("zoidberg", "zoidberg@mujmail.cz"),
- ("trance4us", None)]
+ __authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
HOSTER_DOMAIN = "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()
diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py
index 596be9b7c..4214b4401 100644
--- a/module/plugins/accounts/ShareonlineBiz.py
+++ b/module/plugins/accounts/ShareonlineBiz.py
@@ -1,45 +1,68 @@
# -*- coding: utf-8 -*-
+import re
+
from module.plugins.Account import Account
class ShareonlineBiz(Account):
__name__ = "ShareonlineBiz"
__type__ = "account"
- __version__ = "0.25"
+ __version__ = "0.33"
__description__ = """Share-online.biz account plugin"""
__license__ = "GPLv3"
- __authors__ = [("mkaay", "mkaay@mkaay.de"),
- ("zoidberg", "zoidberg@mujmail.cz")]
+ __authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
- def getUserAPI(self, user, req):
- return req.load("http://api.share-online.biz/account.php",
- {"username": user, "password": self.accounts[user]['password'], "act": "userDetails"})
+ def api_response(self, user, req):
+ return req.load("http://api.share-online.biz/cgi-bin",
+ get={'q' : "userdetails",
+ 'aux' : "traffic",
+ 'username': user,
+ 'password': self.getAccountData(user)['password']})
def loadAccountInfo(self, user, req):
- html = self.getUserAPI(user, req)
+ premium = False
+ validuntil = None
+ trafficleft = -1
+ maxtraffic = 100 * 1024 * 1024 * 1024 #: 100 GB
- info = {}
- for line in html.splitlines():
+ api = {}
+ for line in self.api_response(user, req).splitlines():
if "=" in line:
key, value = line.split("=")
- info[key] = value
- self.logDebug(info)
+ api[key] = value
+
+ self.logDebug(api)
+
+ if api['a'].lower() != "not_available":
+ req.cj.setCookie("share-online.biz", 'a', api['a'])
+
+ premium = api['group'] in ("PrePaid", "Premium", "Penalty-Premium")
+
+ validuntil = float(api['expire_date'])
+
+ traffic = float(api['traffic_1d'].split(";")[0])
+
+ if maxtraffic > traffic:
+ trafficleft = maxtraffic - traffic
+ else:
+ trafficleft = -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'])
+ maxtraffic /= 1024 #@TODO: Remove `/ 1024` in 0.4.10
+ trafficleft /= 1024 #@TODO: Remove `/ 1024` in 0.4.10
- return {"validuntil": float(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}
+ return {'premium' : premium,
+ 'validuntil' : validuntil,
+ 'trafficleft': trafficleft,
+ 'maxtraffic' : maxtraffic}
def login(self, user, data, req):
- html = self.getUserAPI(user, req)
- if "EXCEPTION" in html:
+ html = self.api_response(user, req)
+ err = re.search(r'\*\*(.+?)\*\*', html)
+ if err:
+ self.logError(err.group(1))
self.wrongPassword()
diff --git a/module/plugins/accounts/SimplyPremiumCom.py b/module/plugins/accounts/SimplyPremiumCom.py
index 465757457..8caf600f9 100644
--- a/module/plugins/accounts/SimplyPremiumCom.py
+++ b/module/plugins/accounts/SimplyPremiumCom.py
@@ -7,7 +7,7 @@ from module.plugins.Account import Account
class SimplyPremiumCom(Account):
__name__ = "SimplyPremiumCom"
__type__ = "account"
- __version__ = "0.02"
+ __version__ = "0.05"
__description__ = """Simply-Premium.com account plugin"""
__license__ = "GPLv3"
@@ -15,34 +15,34 @@ class SimplyPremiumCom(Account):
def loadAccountInfo(self, user, req):
+ premium = False
validuntil = -1
trafficleft = None
json_data = req.load('http://www.simply-premium.com/api/user.php?format=json')
- self.logDebug("JSON data: " + json_data)
+
+ self.logDebug("JSON data: %s" % json_data)
+
json_data = json_loads(json_data)
- if 'vip' in json_data['result'] and json_data['result']['vip'] == 0:
- return {"premium": False}
+ if 'vip' in json_data['result'] and json_data['result']['vip']:
+ premium = True
if 'timeend' in json_data['result'] and json_data['result']['timeend']:
validuntil = float(json_data['result']['timeend'])
- if 'traffic' in json_data['result'] and json_data['result']['traffic']:
- trafficleft = float(json_data['result']['traffic']) / 1024 #@TODO: Remove `/ 1024` in 0.4.10
+ if 'remain_traffic' in json_data['result'] and json_data['result']['remain_traffic']:
+ trafficleft = float(json_data['result']['remain_traffic']) / 1024 #@TODO: Remove `/ 1024` in 0.4.10
- return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft}
+ return {"premium": premium, "validuntil": validuntil, "trafficleft": trafficleft}
def login(self, user, data, req):
req.cj.setCookie("simply-premium.com", "lang", "EN")
- if data['password'] == '' or data['password'] == '0':
- post_data = {"key": user}
- else:
- post_data = {"login_name": user, "login_pass": data['password']}
-
- html = req.load("http://www.simply-premium.com/login.php", post=post_data)
+ html = req.load("http://www.simply-premium.com/login.php",
+ post={'key': user} if not data['password'] else {'login_name': user, 'login_pass': data['password']},
+ decode=True)
if 'logout' not in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/SimplydebridCom.py b/module/plugins/accounts/SimplydebridCom.py
index 406534364..24108eb0b 100644
--- a/module/plugins/accounts/SimplydebridCom.py
+++ b/module/plugins/accounts/SimplydebridCom.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from time import mktime, strptime
+import time
from module.plugins.Account import Account
@@ -8,7 +8,7 @@ from module.plugins.Account import Account
class SimplydebridCom(Account):
__name__ = "SimplydebridCom"
__type__ = "account"
- __version__ = "0.10"
+ __version__ = "0.11"
__description__ = """Simply-Debrid.com account plugin"""
__license__ = "GPLv3"
@@ -22,13 +22,14 @@ class SimplydebridCom(Account):
if str(data[0]) != "1":
return {"premium": False}
else:
- return {"trafficleft": -1, "validuntil": mktime(strptime(str(data[2]), "%d/%m/%Y"))}
+ return {"trafficleft": -1, "validuntil": time.mktime(time.strptime(str(data[2]), "%d/%m/%Y"))}
def login(self, user, data, req):
self.loginname = user
- self.password = data['password']
- get_data = {'login': 1, 'u': self.loginname, 'p': self.password}
+ self.password = data['password']
+ get_data = {'login': 1, 'u': self.loginname, 'p': self.password}
+
res = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True)
if res != "02: loggin success":
self.wrongPassword()
diff --git a/module/plugins/accounts/SmoozedCom.py b/module/plugins/accounts/SmoozedCom.py
new file mode 100644
index 000000000..1c303331b
--- /dev/null
+++ b/module/plugins/accounts/SmoozedCom.py
@@ -0,0 +1,78 @@
+# -*- coding: utf-8 -*-
+
+import hashlib
+import time
+
+try:
+ from beaker.crypto.pbkdf2 import PBKDF2
+
+except ImportError:
+ from beaker.crypto.pbkdf2 import pbkdf2
+ from binascii import b2a_hex
+
+ class PBKDF2(object):
+ def __init__(self, passphrase, salt, iterations=1000):
+ self.passphrase = passphrase
+ self.salt = salt
+ self.iterations = iterations
+
+ def hexread(self, octets):
+ return b2a_hex(pbkdf2(self.passphrase, self.salt, self.iterations, octets))
+
+from module.common.json_layer import json_loads
+from module.plugins.Account import Account
+
+
+class SmoozedCom(Account):
+ __name__ = "SmoozedCom"
+ __type__ = "account"
+ __version__ = "0.05"
+
+ __description__ = """Smoozed.com account plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("", "")]
+
+
+ def loadAccountInfo(self, user, req):
+ status = self.getAccountStatus(user, req)
+
+ self.logDebug(status)
+
+ if status['state'] != 'ok':
+ info = {'validuntil' : None,
+ 'trafficleft': None,
+ 'premium' : False}
+ else:
+ # Parse account info
+ info = {'validuntil' : float(status["data"]["user"]["user_premium"]),
+ 'trafficleft': max(0, status["data"]["traffic"][1] - status["data"]["traffic"][0]),
+ 'session' : status["data"]["session_key"],
+ 'hosters' : [hoster["name"] for hoster in status["data"]["hoster"]]}
+
+ if info['validuntil'] < time.time():
+ if float(status["data"]["user"].get("user_trial", 0)) > time.time():
+ info['premium'] = True
+ else:
+ info['premium'] = False
+ else:
+ info['premium'] = True
+
+ return info
+
+
+ def login(self, user, data, req):
+ # Get user data from premiumize.me
+ status = self.getAccountStatus(user, req)
+
+ # Check if user and password are valid
+ if status['state'] != 'ok':
+ self.wrongPassword()
+
+
+ def getAccountStatus(self, user, req):
+ password = self.getAccountData(user)['password']
+ salt = hashlib.sha256(password).hexdigest()
+ encrypted = PBKDF2(password, salt, iterations=1000).hexread(32)
+
+ return json_loads(req.load("http://www2.smoozed.com/api/login",
+ get={'auth': user, 'password': encrypted}))
diff --git a/module/plugins/accounts/StahnuTo.py b/module/plugins/accounts/StahnuTo.py
index 2b08c67cd..882dbd2c3 100644
--- a/module/plugins/accounts/StahnuTo.py
+++ b/module/plugins/accounts/StahnuTo.py
@@ -8,7 +8,7 @@ from module.plugins.Account import Account
class StahnuTo(Account):
__name__ = "StahnuTo"
__type__ = "account"
- __version__ = "0.04"
+ __version__ = "0.05"
__description__ = """StahnuTo account plugin"""
__license__ = "GPLv3"
@@ -25,10 +25,11 @@ class StahnuTo(Account):
def login(self, user, data, req):
- html = req.load("http://www.stahnu.to/login.php", post={
- "username": user,
- "password": data['password'],
- "submit": "Login"})
+ html = req.load("http://www.stahnu.to/login.php",
+ post={"username": user,
+ "password": data['password'],
+ "submit": "Login"},
+ decode=True)
if not '<a href="logout.php">' in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/TurbobitNet.py b/module/plugins/accounts/TurbobitNet.py
index f87d234a7..010fbc270 100644
--- a/module/plugins/accounts/TurbobitNet.py
+++ b/module/plugins/accounts/TurbobitNet.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import re
-from time import mktime, strptime
+import time
from module.plugins.Account import Account
@@ -9,7 +9,7 @@ from module.plugins.Account import Account
class TurbobitNet(Account):
__name__ = "TurbobitNet"
__type__ = "account"
- __version__ = "0.01"
+ __version__ = "0.02"
__description__ = """TurbobitNet account plugin"""
__license__ = "GPLv3"
@@ -22,7 +22,7 @@ class TurbobitNet(Account):
m = re.search(r'<u>Turbo Access</u> to ([\d.]+)', html)
if m:
premium = True
- validuntil = mktime(strptime(m.group(1), "%d.%m.%Y"))
+ validuntil = time.mktime(time.strptime(m.group(1), "%d.%m.%Y"))
else:
premium = False
validuntil = -1
@@ -33,10 +33,11 @@ class TurbobitNet(Account):
def login(self, user, data, req):
req.cj.setCookie("turbobit.net", "user_lang", "en")
- html = req.load("http://turbobit.net/user/login", post={
- "user[login]": user,
- "user[pass]": data['password'],
- "user[submit]": "Login"})
+ html = req.load("http://turbobit.net/user/login",
+ post={"user[login]": user,
+ "user[pass]": data['password'],
+ "user[submit]": "Login"},
+ decode=True)
if not '<div class="menu-item user-name">' in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/TusfilesNet.py b/module/plugins/accounts/TusfilesNet.py
index 279dfd00a..d06ba0583 100644
--- a/module/plugins/accounts/TusfilesNet.py
+++ b/module/plugins/accounts/TusfilesNet.py
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import re
-
-from time import mktime, strptime, gmtime
+import time
from module.plugins.internal.XFSAccount import XFSAccount
diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py
index 3c9b24f3a..f95c8834b 100644
--- a/module/plugins/accounts/UlozTo.py
+++ b/module/plugins/accounts/UlozTo.py
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import re
-
-from urlparse import urljoin
+import urlparse
from module.plugins.Account import Account
@@ -10,7 +9,7 @@ from module.plugins.Account import Account
class UlozTo(Account):
__name__ = "UlozTo"
__type__ = "account"
- __version__ = "0.09"
+ __version__ = "0.10"
__description__ = """Uloz.to account plugin"""
__license__ = "GPLv3"
@@ -18,16 +17,12 @@ class UlozTo(Account):
("pulpe", None)]
- TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a .*?title="[^"]*?GB = ([\d.]+) MB"'
+ TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a .*?title=".+?GB = ([\d.]+) MB"'
def loadAccountInfo(self, user, req):
- self.phpsessid = req.cj.getCookie("ULOSESSID") #@NOTE: this cookie gets lost somehow after each request
-
html = req.load("http://www.ulozto.net/", decode=True)
- req.cj.setCookie("ulozto.net", "ULOSESSID", self.phpsessid)
-
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
trafficleft = float(m.group(1).replace(' ', '').replace(',', '.')) * 1000 * 1.048 if m else 0
@@ -41,12 +36,13 @@ class UlozTo(Account):
action = re.findall('<form action="(.+?)"', login_page)[1].replace('&amp;', '&')
token = re.search('_token_" value="(.+?)"', login_page).group(1)
- html = req.load(urljoin("http://www.ulozto.net/", action),
+ html = req.load(urlparse.urljoin("http://www.ulozto.net/", action),
post={'_token_' : token,
'do' : "loginForm-submit",
'login' : u"Přihlásit",
'password': data['password'],
- 'username': user},
+ 'username': user,
+ 'remember': "on"},
decode=True)
if '<div class="flash error">' in html:
diff --git a/module/plugins/accounts/UnrestrictLi.py b/module/plugins/accounts/UnrestrictLi.py
deleted file mode 100644
index f5db3f888..000000000
--- a/module/plugins/accounts/UnrestrictLi.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from module.plugins.Account import Account
-from module.common.json_layer import json_loads
-
-
-class UnrestrictLi(Account):
- __name__ = "UnrestrictLi"
- __type__ = "account"
- __version__ = "0.04"
-
- __description__ = """Unrestrict.li account plugin"""
- __license__ = "GPLv3"
- __authors__ = [("stickell", "l.stickell@yahoo.it")]
-
-
- def loadAccountInfo(self, user, req):
- json_data = req.load('http://unrestrict.li/api/jdownloader/user.php?format=json')
- self.logDebug("JSON data: " + json_data)
- json_data = json_loads(json_data)
-
- if 'vip' in json_data['result'] and json_data['result']['vip'] == 0:
- return {"premium": False}
-
- validuntil = json_data['result']['expires']
- trafficleft = float(json_data['result']['traffic'] / 1024) #@TODO: Remove `/ 1024` in 0.4.10
-
- return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft}
-
-
- def login(self, user, data, req):
- req.cj.setCookie("unrestrict.li", "lang", "EN")
- html = req.load("https://unrestrict.li/sign_in")
-
- if 'solvemedia' in html:
- self.logError(_("A Captcha is required. Go to http://unrestrict.li/sign_in and login, then retry"))
- return
-
- post_data = {"username": user, "password": data['password'],
- "remember_me": "remember", "signin": "Sign in"}
- html = req.load("https://unrestrict.li/sign_in", post=post_data)
-
- if 'sign_out' not in html:
- self.wrongPassword()
diff --git a/module/plugins/accounts/UploadableCh.py b/module/plugins/accounts/UploadableCh.py
new file mode 100644
index 000000000..86ae5dd17
--- /dev/null
+++ b/module/plugins/accounts/UploadableCh.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.Account import Account
+
+
+class UploadableCh(Account):
+ __name__ = "UploadableCh"
+ __type__ = "account"
+ __version__ = "0.03"
+
+ __description__ = """Uploadable.ch account plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("Sasch", "gsasch@gmail.com")]
+
+
+ def loadAccountInfo(self, user, req):
+ html = req.load("http://www.uploadable.ch/login.php")
+
+ premium = '<a href="/logout.php"' in html
+ trafficleft = -1 if premium else None
+
+ return {'validuntil': None, 'trafficleft': trafficleft, 'premium': premium} #@TODO: validuntil
+
+
+ def login(self, user, data, req):
+ html = req.load("http://www.uploadable.ch/login.php",
+ post={'userName' : user,
+ 'userPassword' : data["password"],
+ 'autoLogin' : "1",
+ 'action__login': "normalLogin"},
+ decode=True)
+
+ if "Login failed" in html:
+ self.wrongPassword()
diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py
index c09726799..d1556b6db 100644
--- a/module/plugins/accounts/UploadedTo.py
+++ b/module/plugins/accounts/UploadedTo.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import re
-from time import time
+import time
from module.plugins.Account import Account
@@ -9,7 +9,7 @@ from module.plugins.Account import Account
class UploadedTo(Account):
__name__ = "UploadedTo"
__type__ = "account"
- __version__ = "0.29"
+ __version__ = "0.30"
__description__ = """Uploaded.to account plugin"""
__license__ = "GPLv3"
@@ -39,7 +39,7 @@ class UploadedTo(Account):
else:
m = re.findall(r'(\d+) (week|day|hour)', expiredate)
if m:
- validuntil = time()
+ validuntil = time.time()
for n, u in m:
validuntil += float(n) * 60 * 60 * {'week': 168, 'day': 24, 'hour': 1}[u]
@@ -55,14 +55,17 @@ class UploadedTo(Account):
else:
trafficleft = self.parseTraffic(size + unit)
- return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium}
+ return {'validuntil' : validuntil,
+ 'trafficleft': trafficleft,
+ 'premium' : premium}
def login(self, user, data, req):
- req.cj.setCookie("uploaded.net", "lang", "en")
+ # req.cj.setCookie("uploaded.net", "lang", "en")
html = req.load("http://uploaded.net/io/login",
- post={'id': user, 'pw': data['password'], '_': ""})
+ post={'id': user, 'pw': data['password'], '_': ""},
+ decode=True)
- if "User and password do not match" in html:
+ if '"err"' in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py
index 1e30b3771..714f5b0a6 100644
--- a/module/plugins/accounts/UploadheroCom.py
+++ b/module/plugins/accounts/UploadheroCom.py
@@ -10,7 +10,7 @@ from module.plugins.Account import Account
class UploadheroCom(Account):
__name__ = "UploadheroCom"
__type__ = "account"
- __version__ = "0.20"
+ __version__ = "0.21"
__description__ = """Uploadhero.co account plugin"""
__license__ = "GPLv3"
@@ -35,7 +35,8 @@ class UploadheroCom(Account):
def login(self, user, data, req):
html = req.load("http://uploadhero.co/lib/connexion.php",
- post={"pseudo_login": user, "password_login": data['password']})
+ post={"pseudo_login": user, "password_login": data['password']},
+ decode=True)
if "mot de passe invalide" in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/UploadingCom.py b/module/plugins/accounts/UploadingCom.py
index c70d2ec11..a20c44535 100644
--- a/module/plugins/accounts/UploadingCom.py
+++ b/module/plugins/accounts/UploadingCom.py
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import re
-
-from time import time, strptime, mktime
+import time
from module.plugins.Account import Account
from module.plugins.internal.SimpleHoster import set_cookies
@@ -11,7 +10,7 @@ from module.plugins.internal.SimpleHoster import set_cookies
class UploadingCom(Account):
__name__ = "UploadingCom"
__type__ = "account"
- __version__ = "0.11"
+ __version__ = "0.12"
__description__ = """Uploading.com account plugin"""
__license__ = "GPLv3"
@@ -37,27 +36,30 @@ class UploadingCom(Account):
self.logDebug("Expire date: " + expiredate)
try:
- validuntil = mktime(strptime(expiredate, "%b %d, %Y"))
+ validuntil = time.mktime(time.strptime(expiredate, "%b %d, %Y"))
except Exception, e:
self.logError(e)
else:
- if validuntil > mktime(gmtime()):
- premium = True
+ if validuntil > time.mktime(time.gmtime()):
+ premium = True
else:
- premium = False
+ premium = False
validuntil = None
- return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium}
+ return {'validuntil' : validuntil,
+ 'trafficleft': trafficleft,
+ 'premium' : premium}
def login(self, user, data, req):
- set_cookies([("uploading.com", "lang", "1"),
- ("uploading.com", "language", "1"),
- ("uploading.com", "setlang", "en"),
- ("uploading.com", "_lang", "en")]
+ set_cookies(req.cj,
+ [("uploading.com", "lang" , "1" ),
+ ("uploading.com", "language", "1" ),
+ ("uploading.com", "setlang" , "en"),
+ ("uploading.com", "_lang" , "en")])
req.load("http://uploading.com/")
- req.load("http://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time() * 1000),
+ req.load("http://uploading.com/general/login_form/?JsHttpRequest=%s-xml" % long(time.time() * 1000),
post={'email': user, 'password': data['password'], 'remember': "on"})
diff --git a/module/plugins/accounts/UptoboxCom.py b/module/plugins/accounts/UptoboxCom.py
index 299a0acc2..c40dbd6e6 100644
--- a/module/plugins/accounts/UptoboxCom.py
+++ b/module/plugins/accounts/UptoboxCom.py
@@ -6,7 +6,7 @@ from module.plugins.internal.XFSAccount import XFSAccount
class UptoboxCom(XFSAccount):
__name__ = "UptoboxCom"
__type__ = "account"
- __version__ = "0.07"
+ __version__ = "0.08"
__description__ = """DDLStorage.com account plugin"""
__license__ = "GPLv3"
@@ -15,3 +15,4 @@ class UptoboxCom(XFSAccount):
HOSTER_DOMAIN = "uptobox.com"
HOSTER_URL = "https://uptobox.com/"
+ LOGIN_URL = "https://login.uptobox.com/"
diff --git a/module/plugins/accounts/WebshareCz.py b/module/plugins/accounts/WebshareCz.py
index f8e3eeb73..f032e2317 100644
--- a/module/plugins/accounts/WebshareCz.py
+++ b/module/plugins/accounts/WebshareCz.py
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
+import hashlib
import re
+import time
-from hashlib import md5, sha1
from passlib.hash import md5_crypt
-from time import mktime, strptime, time
from module.plugins.Account import Account
@@ -34,9 +34,9 @@ class WebshareCz(Account):
expiredate = re.search(self.VALID_UNTIL_PATTERN, html).group(1)
self.logDebug("Expire date: " + expiredate)
- validuntil = mktime(strptime(expiredate, "%Y-%m-%d %H:%M:%S"))
+ validuntil = time.mktime(time.strptime(expiredate, "%Y-%m-%d %H:%M:%S"))
trafficleft = self.parseTraffic(re.search(self.TRAFFIC_LEFT_PATTERN, html).group(1))
- premium = validuntil > time()
+ premium = validuntil > time.time()
return {'validuntil': validuntil, 'trafficleft': -1, 'premium': premium}
@@ -51,8 +51,8 @@ class WebshareCz(Account):
self.wrongPassword()
salt = re.search('<salt>(.+)</salt>', salt).group(1)
- password = sha1(md5_crypt.encrypt(data["password"], salt=salt)).hexdigest()
- digest = md5(user + ":Webshare:" + password).hexdigest()
+ password = hashlib.sha1(md5_crypt.encrypt(data["password"], salt=salt)).hexdigest()
+ digest = hashlib.md5(user + ":Webshare:" + password).hexdigest()
login = req.load("https://webshare.cz/api/login/",
post={'digest' : digest,
diff --git a/module/plugins/accounts/YibaishiwuCom.py b/module/plugins/accounts/YibaishiwuCom.py
index 92a6bfedf..33602a2fe 100644
--- a/module/plugins/accounts/YibaishiwuCom.py
+++ b/module/plugins/accounts/YibaishiwuCom.py
@@ -8,7 +8,7 @@ from module.plugins.Account import Account
class YibaishiwuCom(Account):
__name__ = "YibaishiwuCom"
__type__ = "account"
- __version__ = "0.01"
+ __version__ = "0.02"
__description__ = """115.com account plugin"""
__license__ = "GPLv3"
@@ -23,18 +23,18 @@ class YibaishiwuCom(Account):
html = req.load("http://115.com/", decode=True)
m = re.search(self.ACCOUNT_INFO_PATTERN, html, re.S)
- premium = True if (m and 'is_vip: 1' in m.group(1)) else False
+ premium = True if m and 'is_vip: 1' in m.group(1) else False
validuntil = trafficleft = (-1 if m else 0)
return dict({"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium})
def login(self, user, data, req):
- html = req.load('http://passport.115.com/?ac=login', post={
- "back": "http://www.115.com/",
- "goto": "http://115.com/",
- "login[account]": user,
- "login[passwd]": data['password']
- }, decode=True)
+ html = req.load("http://passport.115.com/?ac=login",
+ post={"back": "http://www.115.com/",
+ "goto": "http://115.com/",
+ "login[account]": user,
+ "login[passwd]": data['password']},
+ decode=True)
if not 'var USER_PERMISSION = {' in html:
self.wrongPassword()
diff --git a/module/plugins/accounts/ZeveraCom.py b/module/plugins/accounts/ZeveraCom.py
index e8e3431e3..9bc6d0487 100644
--- a/module/plugins/accounts/ZeveraCom.py
+++ b/module/plugins/accounts/ZeveraCom.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from time import mktime, strptime
+import time
from module.plugins.Account import Account
@@ -8,43 +8,65 @@ from module.plugins.Account import Account
class ZeveraCom(Account):
__name__ = "ZeveraCom"
__type__ = "account"
- __version__ = "0.22"
+ __version__ = "0.26"
__description__ = """Zevera.com account plugin"""
__license__ = "GPLv3"
- __authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
+ __authors__ = [("zoidberg", "zoidberg@mujmail.cz"),
+ ("Walter Purcaro", "vuolter@gmail.com")]
+
+
+ HOSTER_DOMAIN = "zevera.com"
+
+
+ def __init__(self, manager, accounts): #@TODO: remove in 0.4.10
+ self.init()
+ return super(ZeveraCom, self).__init__(manager, accounts)
+
+
+ def init(self):
+ if not self.HOSTER_DOMAIN:
+ self.logError(_("Missing HOSTER_DOMAIN"))
+
+ if not hasattr(self, "API_URL"):
+ self.API_URL = "http://api.%s/jDownloader.ashx" % (self.HOSTER_DOMAIN or "")
def loadAccountInfo(self, user, req):
- data = self.getAPIData(req)
- if data == "No traffic":
- account_info = {"trafficleft": 0, "validuntil": 0, "premium": False}
- else:
- account_info = {
- "trafficleft": float(data['availabletodaytraffic']) * 1024,
- "validuntil": mktime(strptime(data['endsubscriptiondate'], "%Y/%m/%d %H:%M:%S")),
- "premium": True
- }
- return account_info
+ validuntil = None
+ trafficleft = None
+ premium = False
+
+ api = self.api_response(req)
+
+ if "No trafic" not in api and api['endsubscriptiondate'] != "Expired!":
+ validuntil = time.mktime(time.strptime(api['endsubscriptiondate'], "%Y/%m/%d %H:%M:%S"))
+ trafficleft = float(api['availabletodaytraffic']) * 1024 if api['orondaytrafficlimit'] != '0' else -1
+ premium = True
+
+ return {'validuntil': validuntil, 'trafficleft': trafficleft, 'premium': premium}
def login(self, user, data, req):
- self.loginname = user
+ self.user = user
self.password = data['password']
- if self.getAPIData(req) == "No traffic":
+
+ if self.api_response(req) == "No trafic":
self.wrongPassword()
- def getAPIData(self, req, just_header=False, **kwargs):
- get_data = {
- 'cmd': 'accountinfo',
- 'login': self.loginname,
- 'pass': self.password
- }
+ def api_response(self, req, just_header=False, **kwargs):
+ get_data = {'cmd' : "accountinfo",
+ 'login': self.user,
+ 'pass' : self.password}
+
get_data.update(kwargs)
- res = req.load("http://www.zevera.com/jDownloader.ashx", get=get_data,
- decode=True, just_header=just_header)
+ res = req.load(self.API_URL,
+ get=get_data,
+ just_header=just_header,
+ decode=True)
+
self.logDebug(res)
if ':' in res: