summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/Account.py34
-rw-r--r--module/plugins/accounts/Ftp.py2
-rw-r--r--module/plugins/accounts/Http.py2
-rw-r--r--module/plugins/accounts/MovReelCom.py4
-rw-r--r--module/plugins/accounts/StahnuTo.py1
-rw-r--r--module/plugins/accounts/TurbobitNet.py1
-rw-r--r--module/plugins/hoster/NetloadIn.py4
7 files changed, 25 insertions, 23 deletions
diff --git a/module/plugins/Account.py b/module/plugins/Account.py
index e75fc0ecb..f6c59ae25 100644
--- a/module/plugins/Account.py
+++ b/module/plugins/Account.py
@@ -36,16 +36,16 @@ class Account(Base):
associated hoster plugin. Plugin should also provide `loadAccountInfo`
"""
__name__ = "Account"
- __version__ = "0.2"
+ __version__ = "0.3"
__type__ = "account"
__description__ = """Base account plugin"""
__author_name__ = "mkaay"
__author_mail__ = "mkaay@mkaay.de"
- #: after that time [in minutes] pyload will relogin the account
- login_timeout = 600
- #: account data will be reloaded after this time
- info_threshold = 600
+ #: after that time (in minutes) pyload will relogin the account
+ login_timeout = 10 * 60
+ #: after that time (in minutes) account data will be reloaded
+ info_threshold = 10 * 60
def __init__(self, manager, accounts):
@@ -84,17 +84,20 @@ class Account(Base):
self.logWarning(
_("Could not login with account %(user)s | %(msg)s") % {"user": user
, "msg": _("Wrong Password")})
- data["valid"] = False
-
+ success = data["valid"] = False
except Exception, e:
self.logWarning(
_("Could not login with account %(user)s | %(msg)s") % {"user": user
, "msg": e})
- data["valid"] = False
+ success = data["valid"] = False
if self.core.debug:
print_exc()
+ else:
+ success = True
finally:
- if req: req.close()
+ if req:
+ req.close()
+ return success
def relogin(self, user):
req = self.getAccountRequest(user)
@@ -104,7 +107,7 @@ class Account(Base):
if user in self.infos:
del self.infos[user] #delete old information
- self._login(user, self.accounts[user])
+ return self._login(user, self.accounts[user])
def setAccounts(self, accounts):
self.accounts = accounts
@@ -284,9 +287,10 @@ class Account(Base):
def checkLogin(self, user):
""" checks if user is still logged in """
if user in self.timestamps:
- if self.timestamps[user] + self.login_timeout * 60 < time():
+ if self.login_timeout > 0 and self.timestamps[user] + login_timeout * 60 > time():
self.logDebug("Reached login timeout for %s" % user)
- self.relogin(user)
- return False
-
- return True
+ return self.relogin(user)
+ else:
+ return True
+ else:
+ return False
diff --git a/module/plugins/accounts/Ftp.py b/module/plugins/accounts/Ftp.py
index b454cba7a..18e25c716 100644
--- a/module/plugins/accounts/Ftp.py
+++ b/module/plugins/accounts/Ftp.py
@@ -11,4 +11,4 @@ class Ftp(Account):
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- login_timeout = info_threshold = 1000000
+ login_timeout = info_threshold = -1 #: Unlimited
diff --git a/module/plugins/accounts/Http.py b/module/plugins/accounts/Http.py
index e2f236e41..932b0aa64 100644
--- a/module/plugins/accounts/Http.py
+++ b/module/plugins/accounts/Http.py
@@ -11,4 +11,4 @@ class Http(Account):
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- login_timeout = info_threshold = 1000000
+ login_timeout = info_threshold = -1 #: Unlimited
diff --git a/module/plugins/accounts/MovReelCom.py b/module/plugins/accounts/MovReelCom.py
index 2225261f0..3bcb3313d 100644
--- a/module/plugins/accounts/MovReelCom.py
+++ b/module/plugins/accounts/MovReelCom.py
@@ -11,8 +11,8 @@ class MovReelCom(XFSPAccount):
__author_name__ = "t4skforce"
__author_mail__ = "t4skforce1337[AT]gmail[DOT]com"
- login_timeout = 60 #: after that time [in minutes] pyload will relogin the account
- info_threshold = 30 #: account data will be reloaded after this time
+ login_timeout = 60
+ info_threshold = 30
MAIN_PAGE = "http://movreel.com/"
diff --git a/module/plugins/accounts/StahnuTo.py b/module/plugins/accounts/StahnuTo.py
index 529e2131f..a2742bae7 100644
--- a/module/plugins/accounts/StahnuTo.py
+++ b/module/plugins/accounts/StahnuTo.py
@@ -31,7 +31,6 @@ class StahnuTo(Account):
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- #login_timeout = 60
def loadAccountInfo(self, user, req):
html = req.load("http://www.stahnu.to/")
diff --git a/module/plugins/accounts/TurbobitNet.py b/module/plugins/accounts/TurbobitNet.py
index 19ffaf1e5..03e17430b 100644
--- a/module/plugins/accounts/TurbobitNet.py
+++ b/module/plugins/accounts/TurbobitNet.py
@@ -31,7 +31,6 @@ class TurbobitNet(Account):
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
- #login_timeout = 60
def loadAccountInfo(self, user, req):
html = req.load("http://turbobit.net")
diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py
index 4b8842d18..a011d87b4 100644
--- a/module/plugins/hoster/NetloadIn.py
+++ b/module/plugins/hoster/NetloadIn.py
@@ -176,9 +176,9 @@ class NetloadIn(Hoster):
return True
if ">An access request has been made from IP address <" in page:
wait = self.get_wait_time(page)
- if wait == 0:
+ if not wait:
self.logDebug("Netload: Wait was 0 setting 30")
- wait = 30
+ wait = 30 * 60
self.logInfo(_("Netload: waiting between downloads %d s." % wait))
self.wantReconnect = True
self.setWait(wait)