summaryrefslogtreecommitdiffstats
path: root/module/plugins/addons
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/addons')
-rw-r--r--module/plugins/addons/AlldebridCom.py21
-rw-r--r--module/plugins/addons/CaptchaBrotherhood.py4
-rw-r--r--module/plugins/addons/Checksum.py53
-rw-r--r--module/plugins/addons/EasybytezCom.py29
-rw-r--r--module/plugins/addons/ExternalScripts.py6
-rw-r--r--module/plugins/addons/ExtractArchive.py2
-rw-r--r--module/plugins/addons/LinkdecrypterCom.py23
-rw-r--r--module/plugins/addons/MultishareCz.py21
-rw-r--r--module/plugins/addons/Premium4Me.py15
-rw-r--r--module/plugins/addons/PremiumizeMe.py25
-rw-r--r--module/plugins/addons/RealdebridCom.py21
-rw-r--r--module/plugins/addons/RehostTo.py12
-rw-r--r--module/plugins/addons/UpdateManager.py86
-rw-r--r--module/plugins/addons/XFileSharingPro.py36
-rw-r--r--module/plugins/addons/ZeveraCom.py22
15 files changed, 166 insertions, 210 deletions
diff --git a/module/plugins/addons/AlldebridCom.py b/module/plugins/addons/AlldebridCom.py
index f9657ed8c..6818b8c43 100644
--- a/module/plugins/addons/AlldebridCom.py
+++ b/module/plugins/addons/AlldebridCom.py
@@ -7,33 +7,22 @@ from module.plugins.internal.MultiHoster import MultiHoster
class AlldebridCom(MultiHoster):
__name__ = "AlldebridCom"
- __version__ = "0.11"
+ __version__ = "0.13"
__type__ = "hook"
__config__ = [("activated", "bool", "Activated", "False"),
("https", "bool", "Enable HTTPS", "False"),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
- ("hosterList", "str", "Hoster list (comma separated)", "")]
+ ("hosterList", "str", "Hoster list (comma separated)", ""),
+ ("unloadFailing", "bool", "Revert to stanard download if download fails", "False"),
+ ("interval", "int", "Reload interval in hours (0 to disable)", "24")]
__description__ = """Real-Debrid.com hook plugin"""
__author_name__ = ("Andy, Voigt")
__author_mail__ = ("spamsales@online.de")
- replacements = [("freakshare.net", "freakshare.com")]
-
def getHoster(self):
https = "https" if self.getConfig("https") else "http"
page = getURL(https + "://www.alldebrid.com/api.php?action=get_host").replace("\"","").strip()
- hosters = set([x.strip() for x in page.split(",") if x.strip()])
-
- configMode = self.getConfig('hosterListMode')
- if configMode in ("listed", "unlisted"):
- configList = set(self.getConfig('hosterList').strip().lower().replace('|',',').replace(';',',').split(','))
- configList.discard(u'')
- if configMode == "listed":
- hosters &= configList
- else:
- hosters -= configList
-
- return list(hosters)
+ return [x.strip() for x in page.split(",") if x.strip()]
diff --git a/module/plugins/addons/CaptchaBrotherhood.py b/module/plugins/addons/CaptchaBrotherhood.py
index a22a5ee1d..bdf547827 100644
--- a/module/plugins/addons/CaptchaBrotherhood.py
+++ b/module/plugins/addons/CaptchaBrotherhood.py
@@ -44,7 +44,7 @@ class CaptchaBrotherhoodException(Exception):
class CaptchaBrotherhood(Hook):
__name__ = "CaptchaBrotherhood"
- __version__ = "0.03"
+ __version__ = "0.04"
__description__ = """send captchas to CaptchaBrotherhood.com"""
__config__ = [("activated", "bool", "Activated", False),
("username", "str", "Username", ""),
@@ -53,7 +53,7 @@ class CaptchaBrotherhood(Hook):
__author_name__ = ("RaNaN", "zoidberg")
__author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz")
- API_URL = "http://ocrhood.gazcad.com/"
+ API_URL = "http://www.captchabrotherhood.com/"
def setup(self):
self.info = {}
diff --git a/module/plugins/addons/Checksum.py b/module/plugins/addons/Checksum.py
index aec4bd0d7..b290838bb 100644
--- a/module/plugins/addons/Checksum.py
+++ b/module/plugins/addons/Checksum.py
@@ -19,7 +19,8 @@
from __future__ import with_statement
import hashlib, zlib
from os import remove
-from os.path import getsize, isfile
+from os.path import getsize, isfile, splitext
+import re
from module.utils import save_join, fs_encode
from module.plugins.Hook import Hook
@@ -50,7 +51,7 @@ def computeChecksum(local_file, algorithm):
class Checksum(Hook):
__name__ = "Checksum"
- __version__ = "0.06"
+ __version__ = "0.07"
__description__ = "Verify downloaded file size and checksum (enable in general preferences)"
__config__ = [("activated", "bool", "Activated", True),
("action", "fail;retry;nothing", "What to do if check fails?", "retry"),
@@ -58,12 +59,19 @@ class Checksum(Hook):
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
+ methods = { 'sfv':'crc32', 'crc': 'crc32', 'hash': 'md5'}
+ regexps = { 'sfv': r'^(?P<name>[^;].+)\s+(?P<hash>[0-9A-Fa-f]{8})$',
+ 'md5': r'^(?P<name>[0-9A-Fa-f]{32}) (?P<file>.+)$',
+ 'crc': r'filename=(?P<name>.+)\nsize=(?P<size>\d+)\ncrc32=(?P<hash>[0-9A-Fa-f]{8})$',
+ 'default': r'^(?P<hash>[0-9A-Fa-f]+)\s+\*?(?P<name>.+)$' }
+
def setup(self):
- self.algorithms = sorted(getattr(hashlib, "algorithms", ("md5", "sha1", "sha224", "sha256", "sha384", "sha512")), reverse = True)
- self.algorithms.extend(["crc32", "adler32"])
-
if not self.config['general']['checksum']:
- self.logInfo("Checksum validation is disabled in general configuration")
+ self.logInfo("Checksum validation is disabled in general configuration")
+
+ self.algorithms = sorted(getattr(hashlib, "algorithms", ("md5", "sha1", "sha224", "sha256", "sha384", "sha512")), reverse = True)
+ self.algorithms.extend(["crc32", "adler32"])
+ self.formats = self.algorithms + ['sfv', 'crc', 'hash']
def downloadFinished(self, pyfile):
"""
@@ -127,4 +135,35 @@ class Checksum(Hook):
elif action == "retry":
if local_file:
remove(local_file)
- pyfile.plugin.retry(reason = msg, max_tries = self.getConfig("max_tries")) \ No newline at end of file
+ pyfile.plugin.retry(reason = msg, max_tries = self.getConfig("max_tries"))
+
+
+ def packageFinished(self, pypack):
+ download_folder = save_join(self.config['general']['download_folder'], pypack.folder, "")
+
+ for link in pypack.getChildren().itervalues():
+ file_type = splitext(link["name"])[1][1:].lower()
+ #self.logDebug(link, file_type)
+
+ if file_type not in self.formats:
+ continue
+
+ hash_file = fs_encode(save_join(download_folder, link["name"]))
+ if not isfile(hash_file):
+ self.logWarning("File not found: %s" % link["name"])
+ continue
+
+ with open(hash_file) as f:
+ text = f.read()
+
+ for m in re.finditer(self.regexps.get(file_type, self.regexps['default']), text):
+ data = m.groupdict()
+ self.logDebug(link["name"], data)
+
+ local_file = fs_encode(save_join(download_folder, data["name"]))
+ algorithm = self.methods.get(file_type, file_type)
+ checksum = computeChecksum(local_file, algorithm)
+ if checksum == data["hash"]:
+ self.logInfo('File integrity of "%s" verified by %s checksum (%s).' % (data["name"], algorithm, checksum))
+ else:
+ self.logWarning("%s checksum for file %s does not match (%s != %s)" % (algorithm, data["name"], checksum, data["hash"])) \ No newline at end of file
diff --git a/module/plugins/addons/EasybytezCom.py b/module/plugins/addons/EasybytezCom.py
index 21a988555..6a4ded85b 100644
--- a/module/plugins/addons/EasybytezCom.py
+++ b/module/plugins/addons/EasybytezCom.py
@@ -4,14 +4,9 @@ from module.network.RequestFactory import getURL
from module.plugins.internal.MultiHoster import MultiHoster
import re
-def getConfigSet(option):
- s = set(option.lower().replace(',','|').split('|'))
- s.discard(u'')
- return s
-
class EasybytezCom(MultiHoster):
__name__ = "EasybytezCom"
- __version__ = "0.02"
+ __version__ = "0.03"
__type__ = "hook"
__config__ = [("activated", "bool", "Activated", "False"),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
@@ -21,16 +16,16 @@ class EasybytezCom(MultiHoster):
__author_mail__ = ("zoidberg@mujmail.cz")
def getHoster(self):
-
- hoster = set(['2shared.com', 'easy-share.com', 'filefactory.com', 'fileserve.com', 'filesonic.com', 'hotfile.com', 'mediafire.com', 'megaupload.com', 'netload.in', 'rapidshare.com', 'uploading.com', 'wupload.com', 'oron.com', 'uploadstation.com', 'ul.to', 'uploaded.to'])
+ self.account = self.core.accountManager.getAccountPlugin(self.__name__)
+ user = self.account.selectAccount()[0]
- configMode = self.getConfig('hosterListMode')
- if configMode in ("listed", "unlisted"):
- configList = set(self.getConfig('hosterList').strip().lower().replace('|',',').replace(';',',').split(','))
- configList.discard(u'')
- if configMode == "listed":
- hoster &= configList
- else:
- hoster -= configList
+ try:
+ req = self.account.getAccountRequest(user)
+ page = req.load("http://www.easybytez.com")
- return list(hoster) \ No newline at end of file
+ found = re.search(r'</textarea>\s*Supported sites:(.*)', page)
+ return found.group(1).split(',')
+ except Exception, e:
+ self.logDebug(e)
+ self.logWarning("Unable to load supported hoster list, using last known")
+ return ['bitshare.com', 'crocko.com', 'ddlstorage.com', 'depositfiles.com', 'extabit.com', 'hotfile.com', 'mediafire.com', 'netload.in', 'rapidgator.net', 'rapidshare.com', 'uploading.com', 'uload.to', 'uploaded.to'] \ No newline at end of file
diff --git a/module/plugins/addons/ExternalScripts.py b/module/plugins/addons/ExternalScripts.py
index 00fc7c114..8f5a5841e 100644
--- a/module/plugins/addons/ExternalScripts.py
+++ b/module/plugins/addons/ExternalScripts.py
@@ -26,7 +26,7 @@ from module.utils.fs import save_join, exists, join, listdir
class ExternalScripts(Addon):
__name__ = "ExternalScripts"
- __version__ = "0.21"
+ __version__ = "0.22"
__description__ = """Run external scripts"""
__config__ = [("activated", "bool", "Activated", "True")]
__author_name__ = ("mkaay", "RaNaN", "spoob")
@@ -84,7 +84,7 @@ class ExternalScripts(Addon):
def downloadFinished(self, pyfile):
for script in self.scripts['download_finished']:
- self.callScript(script, pyfile.pluginname, pyfile.url, pyfile.name, pyfile.id,
+ self.callScript(script, pyfile.pluginname, pyfile.url, pyfile.name,
save_join(self.core.config['general']['download_folder'], pyfile.package().folder, pyfile.name),
pyfile.id)
@@ -94,7 +94,7 @@ class ExternalScripts(Addon):
folder = self.core.config['general']['download_folder']
folder = save_join(folder, pypack.folder)
- self.callScript(script, pypack.name, folder, pypack.id)
+ self.callScript(script, pypack.name, folder, pypack.password, pypack.id)
def beforeReconnecting(self, ip):
for script in self.scripts['before_reconnect']:
diff --git a/module/plugins/addons/ExtractArchive.py b/module/plugins/addons/ExtractArchive.py
index 5f749ed0d..369b20ba9 100644
--- a/module/plugins/addons/ExtractArchive.py
+++ b/module/plugins/addons/ExtractArchive.py
@@ -195,8 +195,6 @@ class ExtractArchive(Addon):
files_ids = new_files_ids # also check extracted files
if not matched: self.logInfo(_("No files found to extract"))
-
-
def startExtracting(self, plugin, fid, passwords, thread):
pyfile = self.core.files.getFile(fid)
diff --git a/module/plugins/addons/LinkdecrypterCom.py b/module/plugins/addons/LinkdecrypterCom.py
index ac939afd9..2cb91d120 100644
--- a/module/plugins/addons/LinkdecrypterCom.py
+++ b/module/plugins/addons/LinkdecrypterCom.py
@@ -24,31 +24,36 @@ from module.utils import remove_chars
class LinkdecrypterCom(Hook):
__name__ = "LinkdecrypterCom"
- __version__ = "0.14"
+ __version__ = "0.16"
__description__ = """linkdecrypter.com - regexp loader"""
__config__ = [ ("activated", "bool", "Activated" , "True") ]
__author_name__ = ("zoidberg")
-
+
def coreReady(self):
page = getURL("http://linkdecrypter.com/")
- m = re.search(r'<b>Supported</b>: <i>([^+<]*)', page)
+ m = re.search(r'<b>Supported\(\d+\)</b>: <i>([^+<]*)', page)
if not m:
self.logError(_("Crypter list not found"))
return
-
- online = m.group(1).split(', ')
+
builtin = [ name.lower() for name in self.core.pluginManager.crypterPlugins.keys() ]
builtin.extend([ "downloadserienjunkiesorg" ])
-
- online = [ crypter.replace(".", "\\.") for crypter in online if remove_chars(crypter, "-.") not in builtin ]
+
+ crypter_pattern = re.compile("(\w[\w.-]+)")
+ online = []
+ for crypter in m.group(1).split(', '):
+ m = re.match(crypter_pattern, crypter)
+ if m and remove_chars(m.group(1), "-.") not in builtin:
+ online.append(m.group(1).replace(".", "\\."))
+
if not online:
self.logError(_("Crypter list is empty"))
return
- regexp = r"https?://([^.]+\.)*?(%s)/.*" % "|".join(online)
+ regexp = r"http://([^.]+\.)*?(%s)/.*" % "|".join(online)
dict = self.core.pluginManager.crypterPlugins[self.__name__]
dict["pattern"] = regexp
dict["re"] = re.compile(regexp)
- self.logDebug("REGEXP: " + regexp) \ No newline at end of file
+ self.logDebug("REGEXP: " + regexp)
diff --git a/module/plugins/addons/MultishareCz.py b/module/plugins/addons/MultishareCz.py
index a00c6cb2b..7e5a3e007 100644
--- a/module/plugins/addons/MultishareCz.py
+++ b/module/plugins/addons/MultishareCz.py
@@ -4,14 +4,9 @@ from module.network.RequestFactory import getURL
from module.plugins.internal.MultiHoster import MultiHoster
import re
-def getConfigSet(option):
- s = set(option.lower().split('|'))
- s.discard(u'')
- return s
-
class MultishareCz(MultiHoster):
__name__ = "MultishareCz"
- __version__ = "0.03"
+ __version__ = "0.04"
__type__ = "hook"
__config__ = [("activated", "bool", "Activated", "False"),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
@@ -20,21 +15,9 @@ class MultishareCz(MultiHoster):
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
- replacements = [("share-rapid.cz", "sharerapid.com")]
HOSTER_PATTERN = r'<img class="logo-shareserveru"[^>]*?alt="([^"]+)"></td>\s*<td class="stav">[^>]*?alt="OK"'
def getHoster(self):
page = getURL("http://www.multishare.cz/monitoring/")
- hosters = set(h.lower().strip() for h in re.findall(self.HOSTER_PATTERN, page))
-
- configMode = self.getConfig('hosterListMode')
- if configMode in ("listed", "unlisted"):
- configList = set(self.getConfig('hosterList').strip().lower().replace('|',',').replace(';',',').split(','))
- configList.discard(u'')
- if configMode == "listed":
- hosters &= configList
- elif configMode == "unlisted":
- hosters -= configList
-
- return list(hosters) \ No newline at end of file
+ return re.findall(self.HOSTER_PATTERN, page) \ No newline at end of file
diff --git a/module/plugins/addons/Premium4Me.py b/module/plugins/addons/Premium4Me.py
index fc3ce2343..b49eb41a9 100644
--- a/module/plugins/addons/Premium4Me.py
+++ b/module/plugins/addons/Premium4Me.py
@@ -15,23 +15,10 @@ class Premium4Me(MultiHoster):
__author_name__ = ("RaNaN", "zoidberg")
__author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz")
- replacements = [("freakshare.net", "freakshare.com")]
-
def getHoster(self):
page = getURL("http://premium4.me/api/hosters.php?authcode=%s" % self.account.authcode)
- hosters = set([x.strip() for x in page.replace("\"", "").split(";")])
-
- configMode = self.getConfig('hosterListMode')
- if configMode in ("listed", "unlisted"):
- configList = set(self.getConfig('hosterList').strip().lower().replace(',','|').split('|'))
- configList.discard(u'')
- if configMode == "listed":
- hosters &= configList
- elif configMode == "unlisted":
- hosters -= configList
-
- return list(hosters)
+ return [x.strip() for x in page.replace("\"", "").split(";")]
def coreReady(self):
diff --git a/module/plugins/addons/PremiumizeMe.py b/module/plugins/addons/PremiumizeMe.py
index 3825e9219..a10c24f85 100644
--- a/module/plugins/addons/PremiumizeMe.py
+++ b/module/plugins/addons/PremiumizeMe.py
@@ -5,20 +5,18 @@ from module.network.RequestFactory import getURL
class PremiumizeMe(MultiHoster):
__name__ = "PremiumizeMe"
- __version__ = "0.1"
+ __version__ = "0.12"
__type__ = "hook"
__description__ = """Premiumize.Me hook plugin"""
__config__ = [("activated", "bool", "Activated", "False"),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"),
- ("hosterList", "str", "Hoster list (comma separated)", "")]
+ ("hosterList", "str", "Hoster list (comma separated)", ""),
+ ("unloadFailing", "bool", "Revert to stanard download if download fails", "False"),
+ ("interval", "int", "Reload interval in hours (0 to disable)", "24")]
__author_name__ = ("Florian Franzen")
__author_mail__ = ("FlorianFranzen@gmail.com")
-
- replacements = [("freakshare.net", "freakshare.com")]
-
- interval = 0 # Disable periodic calls, we dont use them anyway
def getHoster(self):
# If no accounts are available there will be no hosters available
@@ -38,20 +36,7 @@ class PremiumizeMe(MultiHoster):
return []
# Extract hosters from json file
- hosters = set(data['result']['hosterlist'])
-
-
- # Read config to check if certain hosters should not be handled
- configMode = self.getConfig('hosterListMode')
- if configMode in ("listed", "unlisted"):
- configList = set(self.getConfig('hosterList').strip().lower().replace('|',',').replace(';',',').split(','))
- configList.discard(u'')
- if configMode == "listed":
- hosters &= configList
- else:
- hosters -= configList
-
- return list(hosters)
+ return data['result']['hosterlist']
def coreReady(self):
# Get account plugin and check if there is a valid account available
diff --git a/module/plugins/addons/RealdebridCom.py b/module/plugins/addons/RealdebridCom.py
index bd3179673..be74b47c3 100644
--- a/module/plugins/addons/RealdebridCom.py
+++ b/module/plugins/addons/RealdebridCom.py
@@ -5,32 +5,21 @@ from module.plugins.internal.MultiHoster import MultiHoster
class RealdebridCom(MultiHoster):
__name__ = "RealdebridCom"
- __version__ = "0.41"
+ __version__ = "0.43"
__type__ = "hook"
__config__ = [("activated", "bool", "Activated", "False"),
("https", "bool", "Enable HTTPS", "False"),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"),
- ("hosterList", "str", "Hoster list (comma separated)", "")]
+ ("hosterList", "str", "Hoster list (comma separated)", ""),
+ ("unloadFailing", "bool", "Revert to stanard download if download fails", "False"),
+ ("interval", "int", "Reload interval in hours (0 to disable)", "24")]
__description__ = """Real-Debrid.com hook plugin"""
__author_name__ = ("Devirex, Hazzard")
__author_mail__ = ("naibaf_11@yahoo.de")
- replacements = [("freakshare.net", "freakshare.com")]
-
def getHoster(self):
https = "https" if self.getConfig("https") else "http"
page = getURL(https + "://real-debrid.com/api/hosters.php").replace("\"","").strip()
- hosters = set([x.strip() for x in page.split(",") if x.strip()])
-
- configMode = self.getConfig('hosterListMode')
- if configMode in ("listed", "unlisted"):
- configList = set(self.getConfig('hosterList').strip().lower().replace('|',',').replace(';',',').split(','))
- configList.discard(u'')
- if configMode == "listed":
- hosters &= configList
- else:
- hosters -= configList
-
- return list(hosters)
+ return [x.strip() for x in page.split(",") if x.strip()]
diff --git a/module/plugins/addons/RehostTo.py b/module/plugins/addons/RehostTo.py
index b16987f5c..7ca5e5cde 100644
--- a/module/plugins/addons/RehostTo.py
+++ b/module/plugins/addons/RehostTo.py
@@ -5,17 +5,19 @@ from module.plugins.internal.MultiHoster import MultiHoster
class RehostTo(MultiHoster):
__name__ = "RehostTo"
- __version__ = "0.41"
+ __version__ = "0.42"
__type__ = "hook"
- __config__ = [("activated", "bool", "Activated", "False")]
+ __config__ = [("activated", "bool", "Activated", "False"),
+ ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
+ ("hosterList", "str", "Hoster list (comma separated)", ""),
+ ("unloadFailing", "bool", "Revert to stanard download if download fails", "False"),
+ ("interval", "int", "Reload interval in hours (0 to disable)", "24")]
__description__ = """rehost.to hook plugin"""
__author_name__ = ("RaNaN")
__author_mail__ = ("RaNaN@pyload.org")
- replacements = [("freakshare.net", "freakshare.com")]
-
def getHoster(self):
page = getURL("http://rehost.to/api.php?cmd=get_supported_och_dl&long_ses=%s" % self.long_ses)
@@ -36,4 +38,4 @@ class RehostTo(MultiHoster):
self.ses = data["ses"]
self.long_ses = data["long_ses"]
- return MultiHoster.coreReady(self)
+ return MultiHoster.coreReady(self) \ No newline at end of file
diff --git a/module/plugins/addons/UpdateManager.py b/module/plugins/addons/UpdateManager.py
index 5bc6ac447..c800b44bf 100644
--- a/module/plugins/addons/UpdateManager.py
+++ b/module/plugins/addons/UpdateManager.py
@@ -23,25 +23,27 @@ from os import stat
from os.path import join, exists
from time import time
-from module.plugins.PluginManager import IGNORE
+from module.ConfigParser import IGNORE
from module.network.RequestFactory import getURL
-from module.plugins.Addon import threaded, Expose, Addon
+from module.plugins.Hook import threaded, Expose, Hook
-class UpdateManager(Addon):
+class UpdateManager(Hook):
__name__ = "UpdateManager"
- __version__ = "0.12"
+ __version__ = "0.13"
__description__ = """checks for updates"""
__config__ = [("activated", "bool", "Activated", "True"),
- ("interval", "int", "Check interval in minutes", "360"),
+ ("interval", "int", "Check interval in minutes", "480"),
("debug", "bool", "Check for plugin changes when in debug mode", False)]
__author_name__ = ("RaNaN")
__author_mail__ = ("ranan@pyload.org")
+ URL = "http://get.pyload.org/check2/%s/"
+ MIN_TIME = 3 * 60 * 60 # 3h minimum check interval
+
@property
def debug(self):
return self.core.debug and self.getConfig("debug")
-
def setup(self):
if self.debug:
self.logDebug("Monitoring file changes")
@@ -51,26 +53,20 @@ class UpdateManager(Addon):
self.periodical = self.checkChanges
self.mtimes = {} #recordes times
else:
- self.interval = self.getConfig("interval") * 60
+ self.interval = max(self.getConfig("interval") * 60, self.MIN_TIME)
self.updated = False
self.reloaded = True
+ self.version = "None"
self.info = {"pyload": False, "plugins": False}
@threaded
def periodical(self):
- if self.core.version.endswith("-dev"):
- self.logDebug("No update check performed on dev version.")
- return
-
- update = self.checkForUpdate()
- if update:
- self.info["pyload"] = True
- else:
- self.log.info(_("No Updates for pyLoad"))
- self.checkPlugins()
+ updates = self.checkForUpdate()
+ if updates:
+ self.checkPlugins(updates)
if self.updated and not self.reloaded:
self.info["plugins"] = True
@@ -78,7 +74,7 @@ class UpdateManager(Addon):
elif self.updated and self.reloaded:
self.log.info(_("Plugins updated and reloaded"))
self.updated = False
- else:
+ elif self.version == "None":
self.log.info(_("No plugin updates available"))
@Expose
@@ -87,57 +83,63 @@ class UpdateManager(Addon):
self.periodical()
def checkForUpdate(self):
- """checks if an update is available"""
+ """checks if an update is available, return result"""
try:
- version_check = getURL("http://get.pyload.org/check/%s/" % self.core.api.getServerVersion())
- if version_check == "":
- return False
- else:
- self.log.info(_("*** New pyLoad Version %s available ***") % version_check)
- self.log.info(_("*** Get it here: http://pyload.org/download ***"))
- return True
+ if self.version == "None": # No updated known
+ version_check = getURL(self.URL % self.core.api.getServerVersion()).splitlines()
+ self.version = version_check[0]
+
+ # Still no updates, plugins will be checked
+ if self.version == "None":
+ self.log.info(_("No Updates for pyLoad"))
+ return version_check[1:]
+
+
+ self.info["pyload"] = True
+ self.log.info(_("*** New pyLoad Version %s available ***") % self.version)
+ self.log.info(_("*** Get it here: http://pyload.org/download ***"))
+
except:
self.log.warning(_("Not able to connect server for updates"))
- return False
+
+ return None # Nothing will be done
- def checkPlugins(self):
+ def checkPlugins(self, updates):
""" checks for plugins updates"""
# plugins were already updated
if self.info["plugins"]: return
- try:
- updates = getURL("http://get.pyload.org/plugins/check/")
- except:
- self.log.warning(_("Not able to connect server for updates"))
- return False
-
- updates = updates.splitlines()
reloads = []
vre = re.compile(r'__version__.*=.*("|\')([0-9.]+)')
+ url = updates[0]
+ schema = updates[1].split("|")
+ updates = updates[2:]
for plugin in updates:
- path, version = plugin.split(":")
- prefix, filename = path.split("/")
+ info = dict(zip(schema, plugin.split("|")))
+ filename = info["name"]
+ prefix = info["type"]
+ version = info["version"]
if filename.endswith(".pyc"):
name = filename[:filename.find("_")]
else:
name = filename.replace(".py", "")
- #TODO: obsolete
+ #TODO: obsolete in 0.5.0
if prefix.endswith("s"):
type = prefix[:-1]
else:
type = prefix
- plugins = self.core.pluginManager.getPlugins(type)
+ plugins = getattr(self.core.pluginManager, "%sPlugins" % type)
if name in plugins:
- if float(plugins[name].version) >= float(version):
+ if float(plugins[name]["v"]) >= float(version):
continue
if name in IGNORE or (type, name) in IGNORE:
@@ -150,7 +152,7 @@ class UpdateManager(Addon):
})
try:
- content = getURL("http://get.pyload.org/plugins/get/" + path)
+ content = getURL(url % info)
except Exception, e:
self.logWarning(_("Error when updating %s") % filename, str(e))
continue
@@ -171,7 +173,7 @@ class UpdateManager(Addon):
def checkChanges(self):
- if self.last_check + self.getConfig("interval") * 60 < time():
+ if self.last_check + max(self.getConfig("interval") * 60, self.MIN_TIME) < time():
self.old_periodical()
self.last_check = time()
diff --git a/module/plugins/addons/XFileSharingPro.py b/module/plugins/addons/XFileSharingPro.py
index 3981db2d0..105c70113 100644
--- a/module/plugins/addons/XFileSharingPro.py
+++ b/module/plugins/addons/XFileSharingPro.py
@@ -5,7 +5,7 @@ import re
class XFileSharingPro(Hook):
__name__ = "XFileSharingPro"
- __version__ = "0.03"
+ __version__ = "0.04"
__type__ = "hook"
__config__ = [ ("activated" , "bool" , "Activated" , "True"),
("loadDefault", "bool", "Include default (built-in) hoster list" , "True"),
@@ -25,29 +25,25 @@ class XFileSharingPro(Hook):
if self.getConfig('loadDefault'):
hosterList |= set((
#WORKING HOSTERS:
- "azsharing.com", "banashare.com", "fileband.com", "kingsupload.com", "migahost.com", "ryushare.com", "xfileshare.eu",
- #NOT TESTED:
- "aieshare.com", "amonshare.com", "asixfiles.com",
- "bebasupload.com", "boosterking.com", "buckshare.com", "bulletupload.com", "crocshare.com", "ddlanime.com", "divxme.com",
- "dopeshare.com", "downupload.com", "eyesfile.com", "eyvx.com", "fik1.com", "file4safe.com", "file4sharing.com",
- "fileforth.com", "filemade.com", "filemak.com", "fileplaygroud.com", "filerace.com", "filestrack.com",
- "fileupper.com", "filevelocity.com", "fooget.com", "4bytez.com", "freefilessharing.com", "glumbouploads.com", "grupload.com",
- "heftyfile.com", "hipfile.com", "host4desi.com", "hulkshare.com", "idupin.com", "imageporter.com", "isharefast.com",
- "jalurcepat.com", "laoupload.com", "linkzhost.com", "loombo.com", "maknyos.com",
- "mlfat4arab.com", "movreel.com", "netuploaded.com", "ok2upload.com", "180upload.com", "1hostclick.com", "ovfile.com",
- "putshare.com", "pyramidfiles.com", "q4share.com", "queenshare.com", "ravishare.com", "rockdizfile.com", "sendmyway.com",
+ "aieshare.com", "asixfiles.com", "banashare.com", "cyberlocker.ch", "eyesfile.co", "eyesfile.com",
+ "fileband.com", "filedwon.com", "filedownloads.org", "hipfile.com", "kingsupload.com", "mlfat4arab.com",
+ "netuploaded.com", "odsiebie.pl", "q4share.com", "ravishare.com", "uptobox.com", "verzend.be",
+ #NOT TESTED:
+ "bebasupload.com", "boosterking.com", "divxme.com", "filevelocity.com", "glumbouploads.com", "grupload.com", "heftyfile.com",
+ "host4desi.com", "laoupload.com", "linkzhost.com", "movreel.com", "rockdizfile.com", "limfile.com"
"share76.com", "sharebeast.com", "sharehut.com", "sharerun.com", "shareswift.com", "sharingonline.com", "6ybh-upload.com",
- "skipfile.com", "spaadyshare.com", "space4file.com", "speedoshare.com", "uploadbaz.com", "uploadboost.com", "uploadc.com",
- "uploaddot.com", "uploadfloor.com", "uploadic.com", "uploadville.com", "uptobox.com", "vidbull.com", "zalaa.com",
+ "skipfile.com", "spaadyshare.com", "space4file.com", "uploadbaz.com", "uploadc.com",
+ "uploaddot.com", "uploadfloor.com", "uploadic.com", "uploadville.com", "vidbull.com", "zalaa.com",
"zomgupload.com", "kupload.org", "movbay.org", "multishare.org", "omegave.org", "toucansharing.org", "uflinq.org",
"banicrazy.info", "flowhot.info", "upbrasil.info", "shareyourfilez.biz", "bzlink.us", "cloudcache.cc", "fileserver.cc"
- "farshare.to", "kingshare.to", "filemaze.ws", "filehost.ws", "goldfile.eu", "filestock.ru", "moidisk.ru"
- "4up.me", "kfiles.kz", "odsiebie.pl", "upchi.co.il", "upit.in", "verzend.be"
- ))
-
+ "farshare.to", "filemaze.ws", "filehost.ws", "filestock.ru", "moidisk.ru", "4up.im", "100shared.com",
+ #WRONG FILE NAME:
+ "sendmyway.com", "upchi.co.il", "180upload.com",
#NOT WORKING:
- """
- """
+ "amonshare.com", "imageporter.com", "file4safe.com",
+ #DOWN OR BROKEN:
+ "ddlanime.com", "fileforth.com", "loombo.com", "goldfile.eu", "putshare.com"
+ ))
hosterList -= (excludeList)
hosterList -= set(('', u''))
diff --git a/module/plugins/addons/ZeveraCom.py b/module/plugins/addons/ZeveraCom.py
index 46c752c21..cadf60069 100644
--- a/module/plugins/addons/ZeveraCom.py
+++ b/module/plugins/addons/ZeveraCom.py
@@ -5,29 +5,15 @@ from module.plugins.internal.MultiHoster import MultiHoster
class ZeveraCom(MultiHoster):
__name__ = "ZeveraCom"
- __version__ = "0.01"
+ __version__ = "0.02"
__type__ = "hook"
__config__ = [("activated", "bool", "Activated", "False"),
("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"),
("hosterList", "str", "Hoster list (comma separated)", "")]
__description__ = """Real-Debrid.com hook plugin"""
- __author_name__ = ("Devirex, Hazzard")
- __author_mail__ = ("naibaf_11@yahoo.de")
-
- replacements = [("freakshare.net", "freakshare.com"), ("2shared.com", "twoshared.com"), ("4shared.com", "fourshared.com"),
- ("easy-share.com", "crocko.com"), ("hellshare.com", "hellshare.cz")]
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
def getHoster(self):
page = getURL("http://www.zevera.com/jDownloader.ashx?cmd=gethosters")
- hosters = set([x.strip() for x in page.replace("\"", "").split(",")])
-
- configMode = self.getConfig('hosterListMode')
- if configMode in ("listed", "unlisted"):
- configList = set(self.getConfig('hosterList').strip().lower().replace('|',',').replace(';',',').split(','))
- configList.discard(u'')
- if configMode == "listed":
- hosters &= configList
- else:
- hosters -= configList
-
- return list(hosters) \ No newline at end of file
+ return [x.strip() for x in page.replace("\"", "").split(",")] \ No newline at end of file