summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-06 19:00:03 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-06 19:00:03 +0200
commitaba96db5e5864703e834a035f524df7405dbe389 (patch)
tree91f07e5aa2c7e5d5482acaadb83d5c0460b1baee /module/plugins/accounts
parentCompute wait time using secondsToMidnight (diff)
downloadpyload-aba96db5e5864703e834a035f524df7405dbe389.tar.xz
Remove two dead plugins
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r--module/plugins/accounts/ReloadCc.py75
-rw-r--r--module/plugins/accounts/Vipleech4uCom.py41
2 files changed, 0 insertions, 116 deletions
diff --git a/module/plugins/accounts/ReloadCc.py b/module/plugins/accounts/ReloadCc.py
deleted file mode 100644
index af23d9936..000000000
--- a/module/plugins/accounts/ReloadCc.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from module.plugins.Account import Account
-
-from module.common.json_layer import json_loads
-
-from module.network.HTTPRequest import BadHeader
-
-
-class ReloadCc(Account):
- __name__ = "ReloadCc"
- __version__ = "0.3"
- __type__ = "account"
- __description__ = """Reload.cc account plugin"""
-
- __author_name__ = "Reload Team"
- __author_mail__ = "hello@reload.cc"
-
- def loadAccountInfo(self, user, req):
-
- # Get user data from reload.cc
- status = self.getAccountStatus(user, req)
-
- # Parse account info
- account_info = {"validuntil": float(status['msg']['expires']),
- "pwdhash": status['msg']['hash'],
- "trafficleft": -1}
-
- return account_info
-
- def login(self, user, data, req):
-
- # Get user data from reload.cc
- status = self.getAccountStatus(user, req)
-
- if not status:
- raise Exception("There was an error upon logging in to Reload.cc!")
-
- # Check if user and password are valid
- if status['status'] != "ok":
- self.wrongPassword()
-
- def getAccountStatus(self, user, req):
- # Use reload.cc API v1 to retrieve account info and return the parsed json answer
- query_params = dict(
- via='pyload',
- v=1,
- get_traffic='true',
- user=user
- )
-
- try:
- query_params.update(dict(hash=self.infos[user]['pwdhash']))
- except Exception:
- query_params.update(dict(pwd=self.accounts[user]['password']))
-
- try:
- answer = req.load("http://api.reload.cc/login", get=query_params)
- except BadHeader, e:
- if e.code == 400:
- raise Exception("There was an unknown error within the Reload.cc plugin.")
- elif e.code == 401:
- self.wrongPassword()
- elif e.code == 402:
- self.expired(user)
- elif e.code == 403:
- raise Exception("Your account is disabled. Please contact the Reload.cc support!")
- elif e.code == 409:
- self.empty(user)
- elif e.code == 503:
- self.logInfo("Reload.cc is currently in maintenance mode! Please check again later.")
- self.wrongPassword()
- return None
-
- return json_loads(answer)
diff --git a/module/plugins/accounts/Vipleech4uCom.py b/module/plugins/accounts/Vipleech4uCom.py
deleted file mode 100644
index 1e8463456..000000000
--- a/module/plugins/accounts/Vipleech4uCom.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# -*- coding: utf-8 -*-
-import re
-from time import mktime, strptime
-
-from module.plugins.Account import Account
-
-
-class Vipleech4uCom(Account):
- __name__ = "Vipleech4uCom"
- __version__ = "0.1"
- __type__ = "account"
- __description__ = """Vipleech4u.com account plugin"""
- __author_name__ = ("Kagenoshin")
- __author_mail__ = ("kagenoshin@gmx.ch")
-
- STATUS_PATTERN = re.compile(r'status.*?<\s*?strong\s*?>[^<]*?vip[^<]*?<', re.I)
- VALIDUNTIL_PATTERN = re.compile(r'valid\s*?until.*?<\s*?strong\s*?>([^<]*?)<', re.I)
-
- def loadAccountInfo(self, user, req):
- response = req.load("http://vipleech4u.com", decode=True)
- status = self.STATUS_PATTERN.search(response)
-
- validuntil = self.VALIDUNTIL_PATTERN.search(response)
- if validuntil:
- validuntil = validuntil.group(1)
-
- if status and validuntil:
- print status
- print validuntil
- return {"trafficleft": -1, "validuntil": mktime(strptime("%s 23:59" % validuntil, "%d-%m-%Y %H:%M"))}
- else:
- return {"premium": False}
-
- def login(self, user, data, req):
- self.loginname = user
- self.password = data["password"]
- post_data = {'action': 'login', 'user': self.loginname, 'pass': self.password}
- req.load("http://vipleech4u.com/login.php")
- response = req.load("http://vipleech4u.com/login.php", post=post_data, decode=True)
- if 'Username or Password are incorrect' in response:
- self.wrongPassword()