summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/internal/MultiHoster.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-07 15:34:19 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-07 15:34:19 +0100
commitd8771b13f1c658ac726ac93195a48ad87169eccd (patch)
treea81899c2905d59ff20341ffcad35c949d880a0b4 /pyload/plugins/internal/MultiHoster.py
parentTiny code cosmetics (diff)
parent[SkipRev] Tiny fixup (diff)
downloadpyload-d8771b13f1c658ac726ac93195a48ad87169eccd.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: module/plugins/hoster/NowDownloadEu.py module/plugins/hoster/NowDownloadSx.py module/plugins/hoster/NowVideoAt.py module/plugins/hoster/NowVideoSx.py pyload/plugins/account/RapidshareCom.py pyload/plugins/addon/ExtractArchive.py pyload/plugins/addon/HotFolder.py pyload/plugins/addon/UpdateManager.py pyload/plugins/hook/Captcha9kw.py pyload/plugins/hook/DebridItaliaCom.py pyload/plugins/hoster/DebridItaliaCom.py pyload/plugins/hoster/Keep2shareCc.py pyload/plugins/hoster/NetloadIn.py pyload/plugins/hoster/NowDownloadEu.py pyload/plugins/hoster/NowVideoAt.py pyload/plugins/hoster/RapidshareCom.py pyload/plugins/hoster/ShareonlineBiz.py pyload/plugins/internal/MultiHoster.py pyload/plugins/internal/SimpleHoster.py
Diffstat (limited to 'pyload/plugins/internal/MultiHoster.py')
-rw-r--r--pyload/plugins/internal/MultiHoster.py44
1 files changed, 23 insertions, 21 deletions
diff --git a/pyload/plugins/internal/MultiHoster.py b/pyload/plugins/internal/MultiHoster.py
index 4eb4a6f31..4d466d350 100644
--- a/pyload/plugins/internal/MultiHoster.py
+++ b/pyload/plugins/internal/MultiHoster.py
@@ -16,18 +16,21 @@ class MultiHoster(Addon):
__authors__ = [("pyLoad Team", "admin@pyload.org")]
- interval = 24 * 60 * 60 #: reload hosters daily
-
- HOSTER_REPLACEMENTS = [("2shared.com", "twoshared.com"), ("4shared.com", "fourshared.com"), ("cloudnator.com", "shragle.com"),
- ("ifile.it", "filecloud.io"), ("easy-share.com", "crocko.com"), ("freakshare.net", "freakshare.com"),
- ("hellshare.com", "hellshare.cz"), ("share-rapid.cz", "sharerapid.com"), ("sharerapid.cz", "sharerapid.com"),
- ("ul.to", "uploaded.to"), ("uploaded.net", "uploaded.to"), ("1fichier.com", "onefichier.com")]
+ interval = 12 * 60 * 60 #: reload hosters every 12h
+
+ HOSTER_REPLACEMENTS = [("1fichier.com", "onefichier.com"), ("2shared.com", "twoshared.com"),
+ ("4shared.com", "fourshared.com"), ("cloudnator.com", "shragle.com"),
+ ("easy-share.com", "crocko.com"), ("freakshare.net", "freakshare.com"),
+ ("hellshare.com", "hellshare.cz"), ("ifile.it", "filecloud.io"),
+ ("putlocker.com", "firedrive.com"), ("share-rapid.cz", "multishare.cz"),
+ ("sharerapid.cz", "multishare.cz"), ("ul.to", "uploaded.to"),
+ ("uploaded.net", "uploaded.to")]
HOSTER_EXCLUDED = []
def setup(self):
- self.hosters = []
- self.supported = []
+ self.hosters = []
+ self.supported = []
self.new_supported = []
@@ -110,8 +113,10 @@ class MultiHoster(Addon):
"""reload hoster list periodically"""
self.logInfo(_("Reloading supported hoster list"))
- old_supported = self.supported
- self.supported, self.new_supported, self.hosters = [], [], []
+ old_supported = self.supported
+ self.supported = []
+ self.new_supported = []
+ self.hosters = []
self.overridePlugins()
@@ -123,11 +128,8 @@ class MultiHoster(Addon):
def overridePlugins(self):
- pluginMap = {}
- for name in self.core.pluginManager.hosterPlugins.keys():
- pluginMap[name.lower()] = name
-
- accountList = [name.lower() for name, data in self.core.accountManager.accounts.iteritems() if data]
+ pluginMap = dict((name.lower(), name) for name in self.core.pluginManager.hosterPlugins.keys())
+ accountList = [name.lower() for name, data in self.core.accountManager.accounts.iteritems() if data]
excludedList = []
for hoster in self.getHosterCached():
@@ -146,14 +148,14 @@ class MultiHoster(Addon):
return
module = self.core.pluginManager.getPlugin(self.__type__, self.__name__)
- klass = getattr(module, self.__name__)
+ klass = getattr(module, self.__name__)
# inject plugin plugin
self.logDebug("Overwritten Hosters", ", ".join(sorted(self.supported)))
for hoster in self.supported:
dict = self.core.pluginManager.hosterPlugins[hoster]
dict['new_module'] = module
- dict['new_name'] = self.__name__
+ dict['new_name'] = self.__name__
if excludedList:
self.logInfo(_("The following hosters were not overwritten - account exists"), ", ".join(sorted(excludedList)))
@@ -162,7 +164,7 @@ class MultiHoster(Addon):
self.logDebug("New Hosters", ", ".join(sorted(self.new_supported)))
# create new regexp
- regexp = r'.*(%s).*' % "|".join([x.replace(".", "\\.") for x in self.new_supported])
+ regexp = r'.*(%s).*' % "|".join([x.replace(".", "\.") for x in self.new_supported])
if hasattr(klass, "__pattern__") and isinstance(klass.__pattern__, basestring) and '://' in klass.__pattern__:
regexp = r'%s|%s' % (klass.__pattern__, regexp)
@@ -170,7 +172,7 @@ class MultiHoster(Addon):
dict = self.core.pluginManager.hosterPlugins[self.__name__]
dict['pattern'] = regexp
- dict['re'] = re.compile(regexp)
+ dict['re'] = re.compile(regexp)
def unloadHoster(self, hoster):
@@ -190,9 +192,9 @@ class MultiHoster(Addon):
# reset pattern
klass = getattr(self.core.pluginManager.getPlugin(self.__type__, self.__name__), self.__name__)
- dict = self.core.pluginManager.hosterPlugins[self.__name__]
+ dict = self.core.pluginManager.hosterPlugins[self.__name__]
dict['pattern'] = getattr(klass, "__pattern__", r'^unmatchable$')
- dict['re'] = re.compile(dict['pattern'])
+ dict['re'] = re.compile(dict['pattern'])
def downloadFailed(self, pyfile):