summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/NoPremiumPl.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts/NoPremiumPl.py')
-rw-r--r--module/plugins/accounts/NoPremiumPl.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py
index e8de0f4cf..6d6b372b7 100644
--- a/module/plugins/accounts/NoPremiumPl.py
+++ b/module/plugins/accounts/NoPremiumPl.py
@@ -6,12 +6,13 @@ import time
from module.common.json_layer import json_loads
from module.plugins.internal.Account import Account
+# from module.plugins.internal.MultiAccount import MultiAccount
class NoPremiumPl(Account):
__name__ = "NoPremiumPl"
__type__ = "account"
- __version__ = "0.05"
+ __version__ = "0.06"
__status__ = "testing"
__description__ = "NoPremium.pl account plugin"
@@ -27,13 +28,16 @@ class NoPremiumPl(Account):
'loc' : "1" ,
'info' : "1" }
- _req = None
- _usr = None
- _pwd = None
+ def grab_hosters(self, user, password, data):
+ hostings = json_loads(self.load("https://www.nopremium.pl/clipboard.php?json=3").strip())
+ hostings_domains = [domain for row in hostings for domain in row['domains'] if row['sdownload'] == "0"]
+ self.log_debug(hostings_domains)
- def grab_info(self, user, password, data, req):
- self._req = req
+ return hostings_domains
+
+
+ def grab_info(self, user, password, data):
try:
result = json_loads(self.run_auth_query())
@@ -55,10 +59,9 @@ class NoPremiumPl(Account):
'premium' : premium }
- def login(self, user, password, data, req):
- self._usr = user
- self._pwd = hashlib.sha1(hashlib.md5(password).hexdigest()).hexdigest()
- self._req = req
+ def signin(self, user, password, data):
+ data['usr'] = user
+ data['pwd'] = hashlib.sha1(hashlib.md5(password).hexdigest()).hexdigest()
try:
response = json_loads(self.run_auth_query())
@@ -69,14 +72,11 @@ class NoPremiumPl(Account):
if "errno" in response.keys():
self.fail_login()
- data['usr'] = self._usr
- data['pwd'] = self._pwd
-
def create_auth_query(self):
query = self.API_QUERY
- query['username'] = self._usr
- query['password'] = self._pwd
+ query['username'] = self.info['data']['usr']
+ query['password'] = self.info['data']['pwd']
return query