summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/Base.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-11 01:04:09 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-11 01:04:09 +0200
commitc3b3f3ea5c813edbe3e6941c535c78ad494244ee (patch)
tree6a76a01cdf3d5fe678e02618bdbe7d0c5ce8ca8c /module/plugins/internal/Base.py
parentFix https://github.com/pyload/pyload/issues/2002 (diff)
downloadpyload-c3b3f3ea5c813edbe3e6941c535c78ad494244ee.tar.xz
Fix https://github.com/pyload/pyload/issues/1998
Fix https://github.com/pyload/pyload/issues/1999 Fix https://github.com/pyload/pyload/issues/2001
Diffstat (limited to 'module/plugins/internal/Base.py')
-rw-r--r--module/plugins/internal/Base.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/module/plugins/internal/Base.py b/module/plugins/internal/Base.py
index 578b12f7f..6f0a902f3 100644
--- a/module/plugins/internal/Base.py
+++ b/module/plugins/internal/Base.py
@@ -45,13 +45,14 @@ def check_abort(fn):
class Base(Plugin):
- __name = "Base"
+ __name__ = "Base"
__type__ = "base"
__version__ = "0.11"
__status__ = "testing"
__pattern__ = r'^unmatchable$'
- __config__ = [("use_premium", "bool", "Use premium account if available", True)]
+ __config__ = [("activated" , "bool", "Activated" , True),
+ ("use_premium", "bool", "Use premium account if available", True)]
__description__ = """Base plugin for Hoster and Crypter"""
__license__ = "GPLv3"
@@ -114,8 +115,7 @@ class Base(Plugin):
@classmethod
def get_info(cls, url="", html=""):
- url = fixurl(url, unquote=True)
-
+ url = fixurl(url, unquote=True)
info = {'name' : parse_name(url),
'pattern': {},
'size' : 0,
@@ -123,7 +123,7 @@ class Base(Plugin):
'url' : replace_patterns(url, cls.URL_REPLACEMENTS)}
try:
- info['pattern'] = re.match(cls.__pattern, url).groupdict()
+ info['pattern'] = re.match(cls.__pattern__, url).groupdict()
except Exception:
pass
@@ -170,10 +170,10 @@ class Base(Plugin):
pass
if self.account:
- self.req = self.pyload.requestFactory.getRequest(self.__name__, self.account.user)
+ self.req = self.pyload.requestFactory.getRequest(self.classname, self.account.user)
self.premium = self.account.info['data']['premium'] #@NOTE: Avoid one unnecessary get_info call by `self.account.premium` here
else:
- self.req = self.pyload.requestFactory.getRequest(self.__name__)
+ self.req = self.pyload.requestFactory.getRequest(self.classname)
self.premium = False
self.setup_base()
@@ -182,7 +182,7 @@ class Base(Plugin):
def load_account(self):
if not self.account:
- self.account = self.pyload.accountManager.getAccountPlugin(self.__name__)
+ self.account = self.pyload.accountManager.getAccountPlugin(self.classname)
if not self.account:
self.account = False
@@ -209,7 +209,7 @@ class Base(Plugin):
self.pyfile.setStatus("starting")
self.log_debug("PROCESS URL " + self.pyfile.url,
- "PLUGIN VERSION %s" % self.__version)
+ "PLUGIN VERSION %s" % self.__version__)
self.process(self.pyfile)
@@ -463,7 +463,7 @@ class Base(Plugin):
except Exception: #: Bad bad bad... rewrite this part in 0.4.10
res = self.load(url,
just_header=True,
- req=self.pyload.requestFactory.getRequest(self.__name__))
+ req=self.pyload.requestFactory.getRequest(self.classname))
header = {'code': req.code}
for line in res.splitlines():