summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-23 19:29:15 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-23 19:29:15 +0100
commita4786e340993bbfc5d2bf971c9bec18863d3dd80 (patch)
tree4e17e7d7a6bf7a30b472de42a2edc7cda2e6c186
parent[SimpleHoster] Code cosmetics (diff)
downloadpyload-a4786e340993bbfc5d2bf971c9bec18863d3dd80.tar.xz
[MultiHoster] Update
-rw-r--r--module/plugins/hoster/AlldebridCom.py4
-rw-r--r--module/plugins/hoster/DebridItaliaCom.py4
-rw-r--r--module/plugins/hoster/FastixRu.py4
-rw-r--r--module/plugins/hoster/FreeWayMe.py4
-rw-r--r--module/plugins/hoster/LinksnappyCom.py4
-rw-r--r--module/plugins/hoster/MegaDebridEu.py4
-rw-r--r--module/plugins/hoster/MyfastfileCom.py4
-rw-r--r--module/plugins/hoster/OverLoadMe.py4
-rw-r--r--module/plugins/hoster/PremiumTo.py4
-rw-r--r--module/plugins/hoster/PremiumizeMe.py4
-rw-r--r--module/plugins/hoster/RPNetBiz.py4
-rw-r--r--module/plugins/hoster/RealdebridCom.py4
-rw-r--r--module/plugins/hoster/RehostTo.py4
-rw-r--r--module/plugins/hoster/SimplyPremiumCom.py4
-rw-r--r--module/plugins/hoster/SimplydebridCom.py4
-rw-r--r--module/plugins/hoster/UnrestrictLi.py4
-rw-r--r--module/plugins/hoster/ZeveraCom.py4
-rw-r--r--module/plugins/internal/MultiHoster.py53
18 files changed, 58 insertions, 63 deletions
diff --git a/module/plugins/hoster/AlldebridCom.py b/module/plugins/hoster/AlldebridCom.py
index 3cc8e3c75..fdf060330 100644
--- a/module/plugins/hoster/AlldebridCom.py
+++ b/module/plugins/hoster/AlldebridCom.py
@@ -13,7 +13,7 @@ from module.utils import parseFileSize
class AlldebridCom(MultiHoster):
__name__ = "AlldebridCom"
__type__ = "hoster"
- __version__ = "0.38"
+ __version__ = "0.39"
__pattern__ = r'https?://(?:[^/]*\.)?alldebrid\..*'
@@ -37,7 +37,7 @@ class AlldebridCom(MultiHoster):
self.resumeDownload = True
- def handleMulti(self):
+ def handlePremium(self):
password = self.getPassword()
data = json_loads(self.load("http://www.alldebrid.com/service.php",
diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py
index 10801a879..d20afb620 100644
--- a/module/plugins/hoster/DebridItaliaCom.py
+++ b/module/plugins/hoster/DebridItaliaCom.py
@@ -8,7 +8,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class DebridItaliaCom(MultiHoster):
__name__ = "DebridItaliaCom"
__type__ = "hoster"
- __version__ = "0.13"
+ __version__ = "0.14"
__pattern__ = r'http://s\d+\.debriditalia\.com/dl/\d+'
@@ -26,7 +26,7 @@ class DebridItaliaCom(MultiHoster):
self.resumeDownload = True
- def handleMulti(self):
+ def handlePremium(self):
self.html = self.load("http://www.debriditalia.com/api.php",
get={'generate': "on", 'link': self.pyfile.url, 'p': self.getPassword()})
diff --git a/module/plugins/hoster/FastixRu.py b/module/plugins/hoster/FastixRu.py
index 196b8479c..a4c85b4ca 100644
--- a/module/plugins/hoster/FastixRu.py
+++ b/module/plugins/hoster/FastixRu.py
@@ -12,7 +12,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class FastixRu(MultiHoster):
__name__ = "FastixRu"
__type__ = "hoster"
- __version__ = "0.07"
+ __version__ = "0.08"
__pattern__ = r'http://(?:www\.)?fastix\.(ru|it)/file/(?P<ID>\w{24})'
@@ -36,7 +36,7 @@ class FastixRu(MultiHoster):
self.resumeDownload = True
- def handleMulti(self):
+ def handlePremium(self):
api_key = self.account.getAccountData(self.user)
api_key = api_key['api']
diff --git a/module/plugins/hoster/FreeWayMe.py b/module/plugins/hoster/FreeWayMe.py
index b08098915..6bda13792 100644
--- a/module/plugins/hoster/FreeWayMe.py
+++ b/module/plugins/hoster/FreeWayMe.py
@@ -6,7 +6,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class FreeWayMe(MultiHoster):
__name__ = "FreeWayMe"
__type__ = "hoster"
- __version__ = "0.13"
+ __version__ = "0.14"
__pattern__ = r'https://(?:www\.)?free-way\.me/.*'
@@ -21,7 +21,7 @@ class FreeWayMe(MultiHoster):
self.chunkLimit = 1
- def handleMulti(self):
+ def handlePremium(self):
user, data = self.account.selectAccount()
self.link = True
diff --git a/module/plugins/hoster/LinksnappyCom.py b/module/plugins/hoster/LinksnappyCom.py
index ff63f2c32..90a47d1ac 100644
--- a/module/plugins/hoster/LinksnappyCom.py
+++ b/module/plugins/hoster/LinksnappyCom.py
@@ -11,7 +11,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class LinksnappyCom(MultiHoster):
__name__ = "LinksnappyCom"
__type__ = "hoster"
- __version__ = "0.05"
+ __version__ = "0.06"
__pattern__ = r'https?://(?:[^/]*\.)?linksnappy\.com'
@@ -28,7 +28,7 @@ class LinksnappyCom(MultiHoster):
self.resumeDownload = True
- def handleMulti(self):
+ def handlePremium(self):
host = self._get_host(self.pyfile.url)
json_params = json_dumps({'link': self.pyfile.url,
'type': host,
diff --git a/module/plugins/hoster/MegaDebridEu.py b/module/plugins/hoster/MegaDebridEu.py
index fd0a41960..ebef7969c 100644
--- a/module/plugins/hoster/MegaDebridEu.py
+++ b/module/plugins/hoster/MegaDebridEu.py
@@ -11,7 +11,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class MegaDebridEu(MultiHoster):
__name__ = "MegaDebridEu"
__type__ = "hoster"
- __version__ = "0.42"
+ __version__ = "0.43"
__pattern__ = r'^https?://(?:w{3}\d+\.mega-debrid\.eu|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/download/file/[^/]+/.+$'
@@ -30,7 +30,7 @@ class MegaDebridEu(MultiHoster):
return ""
- def handleMulti(self):
+ def handlePremium(self):
if not self.connectToApi():
self.exitOnFail("Unable to connect to Mega-debrid.eu")
diff --git a/module/plugins/hoster/MyfastfileCom.py b/module/plugins/hoster/MyfastfileCom.py
index 2f3b5bd91..7471086fb 100644
--- a/module/plugins/hoster/MyfastfileCom.py
+++ b/module/plugins/hoster/MyfastfileCom.py
@@ -9,7 +9,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class MyfastfileCom(MultiHoster):
__name__ = "MyfastfileCom"
__type__ = "hoster"
- __version__ = "0.06"
+ __version__ = "0.07"
__pattern__ = r'http://(?:www\.)?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/dl/'
@@ -23,7 +23,7 @@ class MyfastfileCom(MultiHoster):
self.resumeDownload = True
- def handleMulti(self):
+ def handlePremium(self):
self.logDebug("Original URL: %s" % self.pyfile.url)
page = self.load('http://myfastfile.com/api.php',
diff --git a/module/plugins/hoster/OverLoadMe.py b/module/plugins/hoster/OverLoadMe.py
index 0675787ac..54e3e73fb 100644
--- a/module/plugins/hoster/OverLoadMe.py
+++ b/module/plugins/hoster/OverLoadMe.py
@@ -13,7 +13,7 @@ from module.utils import parseFileSize
class OverLoadMe(MultiHoster):
__name__ = "OverLoadMe"
__type__ = "hoster"
- __version__ = "0.05"
+ __version__ = "0.06"
__pattern__ = r'https?://.*overload\.me.*'
@@ -37,7 +37,7 @@ class OverLoadMe(MultiHoster):
self.resumeDownload = True
- def handleMulti(self):
+ def handlePremium(self):
data = self.account.getAccountData(self.user)
page = self.load("https://api.over-load.me/getdownload.php",
diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py
index d593cec3e..b6194ef73 100644
--- a/module/plugins/hoster/PremiumTo.py
+++ b/module/plugins/hoster/PremiumTo.py
@@ -13,7 +13,7 @@ from module.utils import fs_encode
class PremiumTo(MultiHoster):
__name__ = "PremiumTo"
__type__ = "hoster"
- __version__ = "0.14"
+ __version__ = "0.15"
__pattern__ = r'https?://(?:www\.)?premium\.to/.*'
@@ -29,7 +29,7 @@ class PremiumTo(MultiHoster):
self.chunkLimit = 1
- def handleMulti(self):
+ def handlePremium(self):
tra = self.getTraffic()
#raise timeout to 2min
diff --git a/module/plugins/hoster/PremiumizeMe.py b/module/plugins/hoster/PremiumizeMe.py
index 5716b3dd4..07536062f 100644
--- a/module/plugins/hoster/PremiumizeMe.py
+++ b/module/plugins/hoster/PremiumizeMe.py
@@ -7,7 +7,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class PremiumizeMe(MultiHoster):
__name__ = "PremiumizeMe"
__type__ = "hoster"
- __version__ = "0.14"
+ __version__ = "0.15"
__pattern__ = r'^unmatchable$' #: Since we want to allow the user to specify the list of hoster to use we let MultiHoster.coreReady
@@ -16,7 +16,7 @@ class PremiumizeMe(MultiHoster):
__authors__ = [("Florian Franzen", "FlorianFranzen@gmail.com")]
- def handleMulti(self):
+ def handlePremium(self):
# In some cases hostsers do not supply us with a filename at download, so we
# are going to set a fall back filename (e.g. for freakshare or xfileshare)
self.pyfile.name = self.pyfile.name.split('/').pop() # Remove everthing before last slash
diff --git a/module/plugins/hoster/RPNetBiz.py b/module/plugins/hoster/RPNetBiz.py
index b731973c6..d6a67beb3 100644
--- a/module/plugins/hoster/RPNetBiz.py
+++ b/module/plugins/hoster/RPNetBiz.py
@@ -9,7 +9,7 @@ from module.common.json_layer import json_loads
class RPNetBiz(MultiHoster):
__name__ = "RPNetBiz"
__type__ = "hoster"
- __version__ = "0.12"
+ __version__ = "0.13"
__description__ = """RPNet.biz hoster plugin"""
__license__ = "GPLv3"
@@ -23,7 +23,7 @@ class RPNetBiz(MultiHoster):
self.resumeDownload = True
- def handleMulti(self):
+ def handlePremium(self):
user, data = self.account.selectAccount()
self.logDebug("Original URL: %s" % self.pyfile.url)
diff --git a/module/plugins/hoster/RealdebridCom.py b/module/plugins/hoster/RealdebridCom.py
index 6c4fe58a9..0de78226d 100644
--- a/module/plugins/hoster/RealdebridCom.py
+++ b/module/plugins/hoster/RealdebridCom.py
@@ -14,7 +14,7 @@ from module.utils import parseFileSize
class RealdebridCom(MultiHoster):
__name__ = "RealdebridCom"
__type__ = "hoster"
- __version__ = "0.57"
+ __version__ = "0.58"
__pattern__ = r'https?://(?:[^/]*\.)?real-debrid\..*'
@@ -38,7 +38,7 @@ class RealdebridCom(MultiHoster):
self.resumeDownload = True
- def handleMulti(self):
+ def handlePremium(self):
data = json_loads(self.load("https://real-debrid.com/ajax/unrestrict.php",
get={'lang' : "en",
'link' : quote(self.pyfile.url, ""),
diff --git a/module/plugins/hoster/RehostTo.py b/module/plugins/hoster/RehostTo.py
index da0baf913..b1d0c6e93 100644
--- a/module/plugins/hoster/RehostTo.py
+++ b/module/plugins/hoster/RehostTo.py
@@ -8,7 +8,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class RehostTo(MultiHoster):
__name__ = "RehostTo"
__type__ = "hoster"
- __version__ = "0.15"
+ __version__ = "0.16"
__pattern__ = r'https?://.*rehost\.to\..*'
@@ -26,7 +26,7 @@ class RehostTo(MultiHoster):
self.resumeDownload = True
- def handleMulti(self):
+ def handlePremium(self):
data = self.account.getAccountInfo(self.user)
long_ses = data['long_ses']
diff --git a/module/plugins/hoster/SimplyPremiumCom.py b/module/plugins/hoster/SimplyPremiumCom.py
index 98233b292..87ccb317e 100644
--- a/module/plugins/hoster/SimplyPremiumCom.py
+++ b/module/plugins/hoster/SimplyPremiumCom.py
@@ -11,7 +11,7 @@ from module.plugins.hoster.UnrestrictLi import secondsToMidnight
class SimplyPremiumCom(MultiHoster):
__name__ = "SimplyPremiumCom"
__type__ = "hoster"
- __version__ = "0.05"
+ __version__ = "0.06"
__pattern__ = r'https?://.*(simply-premium)\.com'
@@ -25,7 +25,7 @@ class SimplyPremiumCom(MultiHoster):
self.resumeDownload = False
- def handleMulti(self):
+ def handlePremium(self):
for i in xrange(5):
page = self.load("http://www.simply-premium.com/premium.php", get={'info': "", 'link': self.pyfile.url})
self.logDebug("JSON data: " + page)
diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py
index e17ee41de..b4be77031 100644
--- a/module/plugins/hoster/SimplydebridCom.py
+++ b/module/plugins/hoster/SimplydebridCom.py
@@ -8,7 +8,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class SimplydebridCom(MultiHoster):
__name__ = "SimplydebridCom"
__type__ = "hoster"
- __version__ = "0.13"
+ __version__ = "0.14"
__pattern__ = r'http://(?:www\.)?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd\.php/*'
@@ -23,7 +23,7 @@ class SimplydebridCom(MultiHoster):
self.chunkLimit = 1
- def handleMulti(self):
+ def handlePremium(self):
#fix the links for simply-debrid.com!
self.link = self.pyfile.url
self.link = self.link.replace("clz.to", "cloudzer.net/file")
diff --git a/module/plugins/hoster/UnrestrictLi.py b/module/plugins/hoster/UnrestrictLi.py
index 36d866613..7535d7b41 100644
--- a/module/plugins/hoster/UnrestrictLi.py
+++ b/module/plugins/hoster/UnrestrictLi.py
@@ -29,7 +29,7 @@ def secondsToMidnight(gmt=0):
class UnrestrictLi(MultiHoster):
__name__ = "UnrestrictLi"
__type__ = "hoster"
- __version__ = "0.16"
+ __version__ = "0.17"
__pattern__ = r'https?://(?:[^/]*\.)?(unrestrict|unr)\.li'
@@ -43,7 +43,7 @@ class UnrestrictLi(MultiHoster):
self.resumeDownload = True
- def handleMulti(self):
+ def handleFree(self):
for _i in xrange(5):
page = self.load('https://unrestrict.li/unrestrict.php',
post={'link': self.pyfile.url, 'domain': 'long'})
diff --git a/module/plugins/hoster/ZeveraCom.py b/module/plugins/hoster/ZeveraCom.py
index 34aa6aacf..26d64555b 100644
--- a/module/plugins/hoster/ZeveraCom.py
+++ b/module/plugins/hoster/ZeveraCom.py
@@ -6,7 +6,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
class ZeveraCom(MultiHoster):
__name__ = "ZeveraCom"
__type__ = "hoster"
- __version__ = "0.24"
+ __version__ = "0.25"
__pattern__ = r'http://(?:www\.)?zevera\.com/.*'
@@ -21,7 +21,7 @@ class ZeveraCom(MultiHoster):
self.chunkLimit = 1
- def handleMulti(self):
+ def handlePremium(self):
if self.account.getAPIData(self.req, cmd="checklink", olink=self.pyfile.url) != "Alive":
self.fail(_("Offline or not downloadable"))
diff --git a/module/plugins/internal/MultiHoster.py b/module/plugins/internal/MultiHoster.py
index 4425cfce0..e5c28d034 100644
--- a/module/plugins/internal/MultiHoster.py
+++ b/module/plugins/internal/MultiHoster.py
@@ -2,13 +2,13 @@
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, replace_patterns, set_cookies
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class MultiHoster(SimpleHoster):
__name__ = "MultiHoster"
__type__ = "hoster"
- __version__ = "0.23"
+ __version__ = "0.24"
__pattern__ = r'^unmatchable$'
@@ -18,9 +18,6 @@ class MultiHoster(SimpleHoster):
DIRECT_LINK = True
- MULTI_HOSTER = True
- LOGIN_ACCOUNT = True
- LOGIN_PREMIUM = False
def setup(self):
@@ -28,36 +25,34 @@ class MultiHoster(SimpleHoster):
self.multiDL = self.premium
- def prepare(self):
- self.info = {}
- self.link = ""
- self.multihost = False
+ def process(self, pyfile):
+ self.prepare()
- self.req.setOption("timeout", 120)
+ if self.directDL:
+ self.logDebug("Looking for direct download link...")
+ self.handleDirect()
- if isinstance(self.COOKIES, list):
- set_cookies(self.req.cj, self.COOKIES)
+ if not self.link and not self.lastDownload:
+ self.preload()
- if self.DIRECT_LINK is None:
- self.directDL = bool(self.account)
- else:
- self.directDL = self.DIRECT_LINK
+ if self.premium and (not self.CHECK_TRAFFIC or self.checkTrafficLeft()):
+ self.logDebug("Handled as premium download")
+ self.handlePremium()
- if (self.__pattern__ != self.core.pluginManager.hosterPlugins[self.__name__]['pattern']
- or re.match(self.__pattern__, self.pyfile.url) is None):
+ else:
+ self.logDebug("Handled as free download")
+ self.handleFree()
- if self.LOGIN_ACCOUNT and not self.account:
- self.logError(_("Required account not found"))
+ self.downloadLink(self.link)
+ self.checkFile()
- elif self.LOGIN_PREMIUM and not self.premium:
- self.logError(_("Required premium account not found"))
- else:
- self.multihost = True
+ def handlePremium(self):
+ return self.handleFree()
- self.pyfile.url = replace_patterns(self.pyfile.url,
- self.FILE_URL_REPLACEMENTS if hasattr(self, "FILE_URL_REPLACEMENTS") else self.URL_REPLACEMENTS) #@TODO: Remove FILE_URL_REPLACEMENTS check in 0.4.10
-
- def handleMulti(self):
- raise NotImplementedError
+ def handleFree(self):
+ if self.premium:
+ raise NotImplementedError
+ else:
+ self.logError(_("Required account not found"))