summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/accounts
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-11-17 16:16:18 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-11-17 16:16:18 +0100
commit0ffa48c8d47d5868e5b9948d2a594f0a5280c064 (patch)
treeb60557cc73f5f85e7d7cb52a1c8ffec23bfd3c55 /pyload/plugins/accounts
parentMerge remote-tracking branch 'origin/stable' (diff)
downloadpyload-0ffa48c8d47d5868e5b9948d2a594f0a5280c064.tar.xz
restored multihoster overwritten by merge
Diffstat (limited to 'pyload/plugins/accounts')
-rw-r--r--pyload/plugins/accounts/AlldebridCom.py9
-rw-r--r--pyload/plugins/accounts/Http.py7
-rw-r--r--pyload/plugins/accounts/MultishareCz.py13
-rw-r--r--pyload/plugins/accounts/Premium4Me.py9
-rw-r--r--pyload/plugins/accounts/PremiumizeMe.py22
-rw-r--r--pyload/plugins/accounts/RealdebridCom.py10
-rw-r--r--pyload/plugins/accounts/SimplydebridCom.py8
-rw-r--r--pyload/plugins/accounts/ZeveraCom.py8
8 files changed, 65 insertions, 21 deletions
diff --git a/pyload/plugins/accounts/AlldebridCom.py b/pyload/plugins/accounts/AlldebridCom.py
index 9fb050535..4be7cb897 100644
--- a/pyload/plugins/accounts/AlldebridCom.py
+++ b/pyload/plugins/accounts/AlldebridCom.py
@@ -3,11 +3,11 @@ from time import time
import re
import urllib
-from module.plugins.Account import Account
+from pyload.plugins.MultiHoster import MultiHoster
from BeautifulSoup import BeautifulSoup
-class AlldebridCom(Account):
+class AlldebridCom(MultiHoster):
__name__ = "AlldebridCom"
__version__ = "0.21"
__type__ = "account"
@@ -50,3 +50,8 @@ class AlldebridCom(Account):
if "Invalid captcha" in page:
self.wrongPassword()
+
+ def loadHosterList(self, req):
+ https = "https" if self.getConfig("https") else "http"
+ page = req.load(https + "://www.alldebrid.com/api.php?action=get_host").replace("\"","").strip()
+ return [x.strip() for x in page.split(",") if x.strip()]
diff --git a/pyload/plugins/accounts/Http.py b/pyload/plugins/accounts/Http.py
index 5701d1f03..de9490b2c 100644
--- a/pyload/plugins/accounts/Http.py
+++ b/pyload/plugins/accounts/Http.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from module.plugins.Account import Account
+from pyload.plugins.Account import Account
class Http(Account):
@@ -11,4 +11,9 @@ class Http(Account):
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
+ __config__ = [("domain", "str", "Domain", "")]
+
login_timeout = info_threshold = 1000000
+
+ def login(self, req):
+ pass \ No newline at end of file
diff --git a/pyload/plugins/accounts/MultishareCz.py b/pyload/plugins/accounts/MultishareCz.py
index 273936615..a50ced431 100644
--- a/pyload/plugins/accounts/MultishareCz.py
+++ b/pyload/plugins/accounts/MultishareCz.py
@@ -17,14 +17,14 @@
@author: zoidberg
"""
-from module.plugins.Account import Account
+from pyload.plugins.MultiHoster import MultiHoster
#from time import mktime, strptime
#from pycurl import REFERER
import re
-from module.utils import parseFileSize
+from pyload.utils import parseFileSize
-class MultishareCz(Account):
+class MultishareCz(MultiHoster):
__name__ = "MultishareCz"
__version__ = "0.02"
__type__ = "account"
@@ -34,6 +34,7 @@ class MultishareCz(Account):
TRAFFIC_LEFT_PATTERN = r'<span class="profil-zvyrazneni">Kredit:</span>\s*<strong>(?P<S>[0-9,]+)&nbsp;(?P<U>\w+)</strong>'
ACCOUNT_INFO_PATTERN = r'<input type="hidden" id="(u_ID|u_hash)" name="[^"]*" value="([^"]+)">'
+ HOSTER_PATTERN = r'<img class="logo-shareserveru"[^>]*?alt="([^"]+)"></td>\s*<td class="stav">[^>]*?alt="OK"'
def loadAccountInfo(self, user, req):
#self.relogin(user)
@@ -56,4 +57,8 @@ class MultishareCz(Account):
}, decode=True)
if '<div class="akce-chyba akce">' in html:
- self.wrongPassword() \ No newline at end of file
+ self.wrongPassword()
+
+ def loadHosterList(self, req):
+ page = req.load("http://www.multishare.cz/monitoring/")
+ return re.findall(self.HOSTER_PATTERN, page)
diff --git a/pyload/plugins/accounts/Premium4Me.py b/pyload/plugins/accounts/Premium4Me.py
index 467c5943e..7f49cca30 100644
--- a/pyload/plugins/accounts/Premium4Me.py
+++ b/pyload/plugins/accounts/Premium4Me.py
@@ -1,7 +1,6 @@
-from module.plugins.Account import Account
+from pyload.plugins.MultiHoster import MultiHoster
-
-class Premium4Me(Account):
+class Premium4Me(MultiHoster):
__name__ = "Premium4Me"
__version__ = "0.03"
__type__ = "account"
@@ -23,3 +22,7 @@ class Premium4Me(Account):
if "wrong username" in self.authcode:
self.wrongPassword()
+
+ def loadHosterList(self, req):
+ page = req.load("http://premium.to/api/hosters.php?authcode=%s" % self.authcode)
+ return [x.strip() for x in page.replace("\"", "").split(";")]
diff --git a/pyload/plugins/accounts/PremiumizeMe.py b/pyload/plugins/accounts/PremiumizeMe.py
index c5c712c52..8b4569f06 100644
--- a/pyload/plugins/accounts/PremiumizeMe.py
+++ b/pyload/plugins/accounts/PremiumizeMe.py
@@ -1,9 +1,8 @@
-from module.plugins.Account import Account
+from pyload.plugins.MultiHoster import MultiHoster
+from pyload.utils import json_loads
-from module.common.json_layer import json_loads
-
-class PremiumizeMe(Account):
+class PremiumizeMe(MultiHoster):
__name__ = "PremiumizeMe"
__version__ = "0.11"
__type__ = "account"
@@ -40,3 +39,18 @@ class PremiumizeMe(Account):
"https://api.premiumize.me/pm-api/v1.php?method=accountstatus&params[login]=%s&params[pass]=%s" % (
user, self.accounts[user]['password']))
return json_loads(answer)
+
+ def loadHosterList(self, req):
+ # Get supported hosters list from premiumize.me using the
+ # json API v1 (see https://secure.premiumize.me/?show=api)
+ answer = req.load(
+ "https://api.premiumize.me/pm-api/v1.php?method=hosterlist&params[login]=%s&params[pass]=%s" % (
+ self.loginname, self.password))
+ data = json_loads(answer)
+
+ # If account is not valid thera are no hosters available
+ if data['status'] != 200:
+ return []
+
+ # Extract hosters from json file
+ return data['result']['hosterlist']
diff --git a/pyload/plugins/accounts/RealdebridCom.py b/pyload/plugins/accounts/RealdebridCom.py
index a9980b088..84c61f2e8 100644
--- a/pyload/plugins/accounts/RealdebridCom.py
+++ b/pyload/plugins/accounts/RealdebridCom.py
@@ -1,9 +1,9 @@
import xml.dom.minidom as dom
-from module.plugins.Account import Account
+from pyload.plugins.MultiHoster import MultiHoster
-class RealdebridCom(Account):
+class RealdebridCom(MultiHoster):
__name__ = "RealdebridCom"
__version__ = "0.43"
__type__ = "account"
@@ -11,7 +11,7 @@ class RealdebridCom(Account):
__author_name__ = ("Devirex, Hazzard")
__author_mail__ = ("naibaf_11@yahoo.de")
- def loadAccountInfo(self, user, req):
+ def loadAccountInfo(self, req):
if self.pin_code:
return {"premium": False}
page = req.load("https://real-debrid.com/api/account.php")
@@ -29,3 +29,7 @@ class RealdebridCom(Account):
elif "PIN Code required" in page:
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
+
+ def loadHosterList(self, req):
+ page = req.load("http://real-debrid.com/api/hosters.php").replace("\"", "").strip()
+ return[x.strip() for x in page.split(",") if x.strip()]
diff --git a/pyload/plugins/accounts/SimplydebridCom.py b/pyload/plugins/accounts/SimplydebridCom.py
index 82b499bbd..0b4c82a3b 100644
--- a/pyload/plugins/accounts/SimplydebridCom.py
+++ b/pyload/plugins/accounts/SimplydebridCom.py
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
from time import mktime, strptime
-from module.plugins.Account import Account
+from pyload.plugins.MultiHoster import MultiHoster
-class SimplydebridCom(Account):
+class SimplydebridCom(MultiHoster):
__name__ = "SimplydebridCom"
__version__ = "0.1"
__type__ = "account"
@@ -28,3 +28,7 @@ class SimplydebridCom(Account):
response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True)
if response != "02: loggin success":
self.wrongPassword()
+
+ def loadHosterList(self, req):
+ page = req.load("http://simply-debrid.com/api.php?list=1")
+ return [x.strip() for x in page.rstrip(';').replace("\"", "").split(";")]
diff --git a/pyload/plugins/accounts/ZeveraCom.py b/pyload/plugins/accounts/ZeveraCom.py
index 13ed95133..8f05f1d76 100644
--- a/pyload/plugins/accounts/ZeveraCom.py
+++ b/pyload/plugins/accounts/ZeveraCom.py
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
from time import mktime, strptime
-from module.plugins.Account import Account
+from pyload.plugins.MultiHoster import MultiHoster
-class ZeveraCom(Account):
+class ZeveraCom(MultiHoster):
__name__ = "ZeveraCom"
__version__ = "0.21"
__type__ = "account"
@@ -49,3 +49,7 @@ class ZeveraCom(Account):
[x.split(':', 1) for x in response.splitlines() if ':' in x])
else:
return response
+
+ def loadHosterList(self, req):
+ page = req.load("http://www.zevera.com/jDownloader.ashx?cmd=gethosters")
+ return [x.strip() for x in page.replace("\"", "").split(",")]