summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-09 16:52:01 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-09 16:52:01 +0100
commit12bf6e492c980814646c6bc6e88a2ed759f5acbc (patch)
tree9f9af19b6dd43e881e74d21dd9b921b13cf923f8 /module/plugins
parent[ZippyshareCom] Update NAME_PATTERN (diff)
downloadpyload-12bf6e492c980814646c6bc6e88a2ed759f5acbc.tar.xz
[PluginManager] Improve error handling for parse method
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/PluginManager.py20
-rw-r--r--module/plugins/hoster/RapidshareCom.py5
2 files changed, 11 insertions, 14 deletions
diff --git a/module/plugins/PluginManager.py b/module/plugins/PluginManager.py
index 43e9f9ad4..82702eb7f 100644
--- a/module/plugins/PluginManager.py
+++ b/module/plugins/PluginManager.py
@@ -149,19 +149,19 @@ class PluginManager:
config = self.CONFIG.findall(content)
if config:
- config = literal_eval(config[0].strip().replace("\n", "").replace("\r", ""))
- desc = self.DESC.findall(content)
- desc = desc[0][1] if desc else ""
+ try:
+ config = literal_eval(config[0].strip().replace("\n", "").replace("\r", ""))
+ desc = self.DESC.findall(content)
+ desc = desc[0][1] if desc else ""
- if type(config[0]) == tuple:
- config = [list(x) for x in config]
- else:
- config = [list(config)]
+ if type(config[0]) == tuple:
+ config = [list(x) for x in config]
+ else:
+ config = [list(config)]
- if folder not in ("accounts", "internal") and not [True for item in config if item[0] == "activated"]:
- config.insert(0, ["activated", "bool", "Activated", False if folder == "hooks" else True])
+ if folder not in ("accounts", "internal") and not [True for item in config if item[0] == "activated"]:
+ config.insert(0, ["activated", "bool", "Activated", False if folder == "hooks" else True])
- try:
self.core.config.addPluginConfig(name, config, desc)
except:
self.log.error("Invalid config in %s: %s" % (name, config))
diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py
index 30abd7c7f..2a81108cd 100644
--- a/module/plugins/hoster/RapidshareCom.py
+++ b/module/plugins/hoster/RapidshareCom.py
@@ -44,12 +44,9 @@ def getInfo(urls):
class RapidshareCom(Hoster):
__name__ = "RapidshareCom"
__type__ = "hoster"
- __version__ = "1.39"
+ __version__ = "1.40"
__pattern__ = r'https?://(?:www\.)?rapidshare\.com/(?:files/(?P<id>\d+)/(?P<name>[^?]+)|#!download\|(?:\w+)\|(?P<id_new>\d+)\|(?P<name_new>[^|]+))'
- __config__ = [("server",
- "Cogent;Deutsche Telekom;Level(3);Level(3) #2;GlobalCrossing;Level(3) #3;Teleglobe;GlobalCrossing #2;TeliaSonera #2;Teleglobe #2;TeliaSonera #3;TeliaSonera",
- "Preferred Server", "None")]
__description__ = """Rapidshare.com hoster plugin"""
__license__ = "GPLv3"