diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2016-01-02 15:32:23 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2016-01-02 15:32:23 +0100 |
commit | 79cbeb40d503932bae76f08075b4847d4f42e691 (patch) | |
tree | 7fb05b6583e5081716a87e69bf0a14af18f6c66c /module | |
parent | [XFileSharing] Fix setup_base (diff) | |
download | pyload-79cbeb40d503932bae76f08075b4847d4f42e691.tar.xz |
Timeout for http request set to 1 minute + report effective url address in header
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/internal/Base.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/Plugin.py | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/module/plugins/internal/Base.py b/module/plugins/internal/Base.py index 104b67edc..5f766c88f 100644 --- a/module/plugins/internal/Base.py +++ b/module/plugins/internal/Base.py @@ -160,6 +160,8 @@ class Base(Plugin): self.req = self.pyload.requestFactory.getRequest(self.classname) self.premium = False + self.req.setOption("timeout", 60) #@TODO: Remove in 0.4.10 + self.setup_base() self.grab_info() self.setup() diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index 3fd4a1d58..bbb4e33b8 100644 --- a/module/plugins/internal/Plugin.py +++ b/module/plugins/internal/Plugin.py @@ -63,6 +63,7 @@ class Plugin(object): #: Browser instance, see `network.Browser` self.req = self.pyload.requestFactory.getRequest(self.classname) + self.req.setOption("timeout", 60) #@TODO: Remove in 0.4.10 #: Last loaded html self.last_html = "" @@ -145,14 +146,14 @@ class Plugin(object): file_perms = False dl_perms = False - if self.pyload.config.get("permission", "change_file"): - permission = self.pyload.config.get("permission", "folder" if os.path.isdir(path) else "file") + if self.pyload.config.get('permission', "change_file"): + permission = self.pyload.config.get('permission', "folder" if os.path.isdir(path) else "file") mode = int(permission, 8) os.chmod(path, mode) - if os.name != "nt" and self.pyload.config.get("permission", "change_dl"): - uid = pwd.getpwnam(self.pyload.config.get("permission", "user"))[2] - gid = grp.getgrnam(self.pyload.config.get("permission", "group"))[2] + if os.name != "nt" and self.pyload.config.get('permission', "change_dl"): + uid = pwd.getpwnam(self.pyload.config.get('permission', "user"))[2] + gid = grp.getgrnam(self.pyload.config.get('permission', "group"))[2] os.chown(path, uid, gid) @@ -186,6 +187,7 @@ class Plugin(object): if req is False: req = get_request() + req.setOption("timeout", 60) #@TODO: Remove in 0.4.10 elif not req: req = self.req @@ -225,7 +227,7 @@ class Plugin(object): self.dump_html() #@TODO: Move to network in 0.4.10 - header = {'code': req.code} + header = {'code': req.code, 'url': req.lastEffectiveURL} header.update(parse_html_header(req.http.header if hasattr(req, "http") else req.header)) #@NOTE: req can be a HTTPRequest or a Browser object self.last_header = header |