summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-12-31 09:50:52 +0100
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-12-31 14:18:03 +0100
commitd2c0edb033ff500bea6d3021c4de85145e1151e6 (patch)
tree9d532b3f3f9cb0412cd7bb4e82b9afabfec6b15e
parent[misc] Check utc type for seconds_to_midnight (diff)
downloadpyload-d2c0edb033ff500bea6d3021c4de85145e1151e6.tar.xz
[SimpleCrypter][SimpleHoster] Better preload routine
-rw-r--r--module/plugins/internal/SimpleCrypter.py6
-rw-r--r--module/plugins/internal/SimpleHoster.py3
2 files changed, 7 insertions, 2 deletions
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py
index 07760d8ba..39040ae68 100644
--- a/module/plugins/internal/SimpleCrypter.py
+++ b/module/plugins/internal/SimpleCrypter.py
@@ -149,10 +149,9 @@ class SimpleCrypter(Crypter):
def handle_direct(self, pyfile):
maxredirs = int(self.pyload.api.getConfigValue("UserAgentSwitcher", "maxredirs", "plugin")) or 5 #@TODO: Remove `int` in 0.4.10
- redirect = None
+ redirect = pyfile.url
for i in xrange(maxredirs):
- redirect = redirect or pyfile.url
self.log_debug("Redirect #%d to: %s" % (i, redirect))
html = self.load(redirect)
@@ -169,6 +168,9 @@ class SimpleCrypter(Crypter):
def preload(self):
+ if self.data:
+ return
+
self.data = self.load(self.pyfile.url,
cookies=self.COOKIES,
ref=False,
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index c152ee032..5a8389a99 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -238,6 +238,9 @@ class SimpleHoster(Hoster):
def preload(self):
+ if self.data:
+ return
+
self.data = self.load(self.pyfile.url,
cookies=self.COOKIES,
ref=False,