summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/account
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugins/account')
-rw-r--r--pyload/plugins/account/AlldebridCom.py4
-rw-r--r--pyload/plugins/account/DebridItaliaCom.py30
-rw-r--r--pyload/plugins/account/EasybytezCom.py2
-rw-r--r--pyload/plugins/account/FastixRu.py11
-rw-r--r--pyload/plugins/account/KingfilesNet.py8
-rw-r--r--pyload/plugins/account/NetloadIn.py2
-rw-r--r--pyload/plugins/account/OboomCom.py12
-rw-r--r--pyload/plugins/account/PremiumTo.py6
-rw-r--r--pyload/plugins/account/PremiumizeMe.py7
-rw-r--r--pyload/plugins/account/RapidshareCom.py55
-rw-r--r--pyload/plugins/account/RehostTo.py9
11 files changed, 50 insertions, 96 deletions
diff --git a/pyload/plugins/account/AlldebridCom.py b/pyload/plugins/account/AlldebridCom.py
index 4f9164468..a3e8ad659 100644
--- a/pyload/plugins/account/AlldebridCom.py
+++ b/pyload/plugins/account/AlldebridCom.py
@@ -36,8 +36,8 @@ class AlldebridCom(Account):
#Get expiration date from API
except Exception:
data = self.getAccountData(user)
- page = req.load("http://www.alldebrid.com/api.php?action=info_user&login=%s&pw=%s" % (user,
- data['password']))
+ page = req.load("http://www.alldebrid.com/api.php",
+ get={'action': "info_user", 'login': user, 'pw': data['password']})
self.logDebug(page)
xml = dom.parseString(page)
exp_time = time() + int(xml.getElementsByTagName("date")[0].childNodes[0].nodeValue) * 24 * 60 * 60
diff --git a/pyload/plugins/account/DebridItaliaCom.py b/pyload/plugins/account/DebridItaliaCom.py
index 30ed9fb1c..41f796327 100644
--- a/pyload/plugins/account/DebridItaliaCom.py
+++ b/pyload/plugins/account/DebridItaliaCom.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
import re
-import time
+
+from time import mktime, strptime
from pyload.plugins.internal.Account import Account
@@ -9,32 +10,35 @@ from pyload.plugins.internal.Account import Account
class DebridItaliaCom(Account):
__name__ = "DebridItaliaCom"
__type__ = "account"
- __version__ = "0.1"
+ __version__ = "0.11"
__description__ = """Debriditalia.com account plugin"""
__license__ = "GPLv3"
- __authors__ = [("stickell", "l.stickell@yahoo.it")]
+ __authors__ = [("stickell", "l.stickell@yahoo.it"),
+ ("Walter Purcaro", "vuolter@gmail.com")]
- WALID_UNTIL_PATTERN = r'Premium valid till: (?P<D>[^|]+) \|'
+ WALID_UNTIL_PATTERN = r'Premium valid till: (.+?) \|'
def loadAccountInfo(self, user, req):
+ info = {"premium": False, "validuntil": None, "trafficleft": None}
html = req.load("http://debriditalia.com/")
- if 'Account premium not activated' in html:
- return {"premium": False, "validuntil": None, "trafficleft": None}
+ if 'Account premium not activated' not in html:
+ m = re.search(self.WALID_UNTIL_PATTERN, html)
+ if m:
+ validuntil = int(mktime(strptime(m.group(1), "%d/%m/%Y %H:%M")))
+ info = {"premium": True, "validuntil": validuntil, "trafficleft": -1}
+ else:
+ self.logError(_("Unable to retrieve account information"))
- m = re.search(self.WALID_UNTIL_PATTERN, html)
- if m:
- validuntil = int(time.mktime(time.strptime(m.group('D'), "%d/%m/%Y %H:%M")))
- return {"premium": True, "validuntil": validuntil, "trafficleft": -1}
- else:
- self.logError(_("Unable to retrieve account information"))
+ return info
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']})
+
if 'NO' in html:
self.wrongPassword()
diff --git a/pyload/plugins/account/EasybytezCom.py b/pyload/plugins/account/EasybytezCom.py
index 2ffcd5392..64b59413c 100644
--- a/pyload/plugins/account/EasybytezCom.py
+++ b/pyload/plugins/account/EasybytezCom.py
@@ -8,7 +8,7 @@ from pyload.plugins.internal.XFSAccount import XFSAccount
class EasybytezCom(XFSAccount):
__name__ = "EasybytezCom"
__type__ = "account"
- __version__ = "0.10"
+ __version__ = "0.12"
__description__ = """EasyBytez.com account plugin"""
__license__ = "GPLv3"
diff --git a/pyload/plugins/account/FastixRu.py b/pyload/plugins/account/FastixRu.py
index 96db443b7..829316ce3 100644
--- a/pyload/plugins/account/FastixRu.py
+++ b/pyload/plugins/account/FastixRu.py
@@ -16,11 +16,11 @@ class FastixRu(Account):
def loadAccountInfo(self, user, req):
data = self.getAccountData(user)
- page = req.load("http://fastix.ru/api_v2/?apikey=%s&sub=getaccountdetails" % (data['api']))
- page = json_loads(page)
+ page = json_loads(req.load("http://fastix.ru/api_v2/", get={'apikey': data['api'], 'sub': "getaccountdetails"}))
+
points = page['points']
- kb = float(points)
- kb = kb * 1024 ** 2 / 1000
+ kb = float(points) * 1024 ** 2 / 1000
+
if points > 0:
account_info = {"validuntil": -1, "trafficleft": kb}
else:
@@ -29,7 +29,8 @@ class FastixRu(Account):
def login(self, user, data, req):
- page = req.load("http://fastix.ru/api_v2/?sub=get_apikey&email=%s&password=%s" % (user, data['password']))
+ page = req.load("http://fastix.ru/api_v2/",
+ get={'sub': "get_apikey", 'email': user, 'password': data['password']})
api = json_loads(page)
api = api['apikey']
data['api'] = api
diff --git a/pyload/plugins/account/KingfilesNet.py b/pyload/plugins/account/KingfilesNet.py
index ebd5baec3..892027e52 100644
--- a/pyload/plugins/account/KingfilesNet.py
+++ b/pyload/plugins/account/KingfilesNet.py
@@ -9,7 +9,7 @@ from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class KingfilesNet(SimpleHoster):
__name__ = "KingfilesNet"
__type__ = "hoster"
- __version__ = "0.04"
+ __version__ = "0.05"
__pattern__ = r'http://(?:www\.)?kingfiles\.net/(?P<ID>\w{12})'
@@ -30,15 +30,15 @@ class KingfilesNet(SimpleHoster):
def setup(self):
- self.multiDL = True
self.resumeDownload = True
+ self.multiDL = True
def handleFree(self):
# Click the free user button
post_data = {'op': "download1",
'usr_login': "",
- 'id': self.info['ID'],
+ 'id': self.info['pattern']['ID'],
'fname': self.pyfile.name,
'referer': "",
'method_free': "+"}
@@ -57,7 +57,7 @@ class KingfilesNet(SimpleHoster):
self.logDebug("rand = ", rand)
post_data = {'op': "download2",
- 'id': self.info['ID'],
+ 'id': self.info['pattern']['ID'],
'rand': rand,
'referer': self.pyfile.url,
'method_free': "+",
diff --git a/pyload/plugins/account/NetloadIn.py b/pyload/plugins/account/NetloadIn.py
index 6e780225a..341803670 100644
--- a/pyload/plugins/account/NetloadIn.py
+++ b/pyload/plugins/account/NetloadIn.py
@@ -18,7 +18,7 @@ class NetloadIn(Account):
def loadAccountInfo(self, user, req):
- page = req.load("http://netload.in/index.php?id=2&lang=de")
+ page = req.load("http://netload.in/index.php", get={'id': 2, 'lang': "de"})
left = r'>(\d+) (Tag|Tage), (\d+) Stunden<'
left = re.search(left, page)
if left:
diff --git a/pyload/plugins/account/OboomCom.py b/pyload/plugins/account/OboomCom.py
index 4f7f476e2..5ee35f973 100644
--- a/pyload/plugins/account/OboomCom.py
+++ b/pyload/plugins/account/OboomCom.py
@@ -11,7 +11,7 @@ from pyload.plugins.internal.Account import Account
class OboomCom(Account):
__name__ = "OboomCom"
__type__ = "account"
- __version__ = "0.2"
+ __version__ = "0.21"
__description__ = """Oboom.com account plugin"""
__license__ = "GPLv3"
@@ -51,11 +51,11 @@ class OboomCom(Account):
session = accountData['session']
- return {'premium': premium,
- 'validuntil': validUntil,
- 'trafficleft': trafficLeft,
- 'maxtraffic': maxTraffic,
- 'session': session}
+ return {'premium' : premium,
+ 'validuntil' : validUntil,
+ 'trafficleft': trafficLeft / 1024, #@TODO: Remove / 1024 in 0.4.10
+ 'maxtraffic' : maxTraffic / 1024, #@TODO: Remove / 1024 in 0.4.10
+ 'session' : session}
def login(self, user, data, req):
diff --git a/pyload/plugins/account/PremiumTo.py b/pyload/plugins/account/PremiumTo.py
index f7a00e194..e94eed6fb 100644
--- a/pyload/plugins/account/PremiumTo.py
+++ b/pyload/plugins/account/PremiumTo.py
@@ -21,14 +21,14 @@ class PremiumTo(Account):
get={'username': self.username, 'password': self.password})
traffic = sum(map(int, api_r.split(';')))
- return {"trafficleft": int(traffic), "validuntil": -1}
+ return {"trafficleft": int(traffic) / 1024, "validuntil": -1} #@TODO: Remove / 1024 in 0.4.10
def login(self, user, data, req):
self.username = user
self.password = data['password']
- authcode = req.load("http://premium.to/api/getauthcode.php?username=%s&password=%s" % (
- user, self.password)).strip()
+ authcode = req.load("http://premium.to/api/getauthcode.php",
+ get={'username': user, 'password': self.password}).strip()
if "wrong username" in authcode:
self.wrongPassword()
diff --git a/pyload/plugins/account/PremiumizeMe.py b/pyload/plugins/account/PremiumizeMe.py
index 5f972ca8b..c06baf21d 100644
--- a/pyload/plugins/account/PremiumizeMe.py
+++ b/pyload/plugins/account/PremiumizeMe.py
@@ -42,7 +42,8 @@ class PremiumizeMe(Account):
def getAccountStatus(self, user, req):
# Use premiumize.me API v1 (see https://secure.premiumize.me/?show=api)
# to retrieve account info and return the parsed json answer
- answer = req.load(
- "https://api.premiumize.me/pm-api/v1.php?method=accountstatus&params[login]=%s&params[pass]=%s" % (
- user, self.accounts[user]['password']))
+ answer = req.load("https://api.premiumize.me/pm-api/v1.php",
+ get={'method' : "accountstatus",
+ 'params[login]': user,
+ 'params[pass]' : self.accounts[user]['password']})
return json_loads(answer)
diff --git a/pyload/plugins/account/RapidshareCom.py b/pyload/plugins/account/RapidshareCom.py
deleted file mode 100644
index 01adad15f..000000000
--- a/pyload/plugins/account/RapidshareCom.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from pyload.plugins.internal.Account import Account
-
-
-class RapidshareCom(Account):
- __name__ = "RapidshareCom"
- __type__ = "account"
- __version__ = "0.22"
-
- __description__ = """Rapidshare.com account plugin"""
- __license__ = "GPLv3"
- __authors__ = [("mkaay", "mkaay@mkaay.de")]
-
-
- def loadAccountInfo(self, user, req):
- data = self.getAccountData(user)
- api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi"
- api_param_prem = {"sub": "getaccountdetails", "type": "prem", "login": user,
- "password": data['password'], "withcookie": 1}
- html = req.load(api_url_base, cookies=False, get=api_param_prem)
- if html.startswith("ERROR"):
- raise Exception(html)
- fields = html.split("\n")
- info = {}
- for t in fields:
- if not t.strip():
- continue
- k, v = t.split("=")
- info[k] = v
-
- validuntil = int(info['billeduntil'])
- premium = True if validuntil else False
-
- tmp = {"premium": premium, "validuntil": validuntil, "trafficleft": -1, "maxtraffic": -1}
-
- return tmp
-
-
- def login(self, user, data, req):
- api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi"
- api_param_prem = {"sub": "getaccountdetails", "type": "prem", "login": user,
- "password": data['password'], "withcookie": 1}
- html = req.load(api_url_base, cookies=False, get=api_param_prem)
- if html.startswith("ERROR"):
- raise Exception(html + "### Note you have to use your account number for login, instead of name")
- fields = html.split("\n")
- info = {}
- for t in fields:
- if not t.strip():
- continue
- k, v = t.split("=")
- info[k] = v
- cj = self.getAccountCookies(user)
- cj.setCookie("rapidshare.com", "enc", info['cookie'])
diff --git a/pyload/plugins/account/RehostTo.py b/pyload/plugins/account/RehostTo.py
index e8ee3ba15..070cdda3a 100644
--- a/pyload/plugins/account/RehostTo.py
+++ b/pyload/plugins/account/RehostTo.py
@@ -15,12 +15,14 @@ class RehostTo(Account):
def loadAccountInfo(self, user, req):
data = self.getAccountData(user)
- page = req.load("http://rehost.to/api.php?cmd=login&user=%s&pass=%s" % (user, data['password']))
+ page = req.load("http://rehost.to/api.php",
+ get={'cmd': "login", 'user': user, 'pass': data['password']})
data = [x.split("=") for x in page.split(",")]
ses = data[0][1]
long_ses = data[1][1]
- page = req.load("http://rehost.to/api.php?cmd=get_premium_credits&long_ses=%s" % long_ses)
+ page = req.load("http://rehost.to/api.php",
+ get={'cmd': "get_premium_credits", 'long_ses': long_ses})
traffic, valid = page.split(",")
account_info = {"trafficleft": int(traffic) * 1024,
@@ -32,7 +34,8 @@ class RehostTo(Account):
def login(self, user, data, req):
- page = req.load("http://rehost.to/api.php?cmd=login&user=%s&pass=%s" % (user, data['password']))
+ page = req.load("http://rehost.to/api.php",
+ get={'cmd': "login", 'user': user, 'pass': data['password']})
if "Login failed." in page:
self.wrongPassword()