diff options
author | Daniel Bornkessel <daniel@bornkessel.com> | 2013-01-02 00:49:54 +0100 |
---|---|---|
committer | Daniel Bornkessel <daniel@bornkessel.com> | 2013-01-02 00:49:54 +0100 |
commit | 81d5d00850b5a1096421e9001da20fa564f0156f (patch) | |
tree | 14bda06a8c3956240d35ac9bfdbfc568832a1e4a /module/network/HTTPChunk.py | |
parent | fixed some animations (diff) | |
download | pyload-81d5d00850b5a1096421e9001da20fa564f0156f.tar.xz |
Remove '/' from filename to avoid filepath exception
When a http url has a filename set to something that contains a '/',
pyload will error out when trying to merge the chunks as it sees the '/'
as part of the path.
Example:
HTTP Header contains:
filename=55/filename.img
Chunks are saved as:
<path to download folder>/55filename.img.chunk0
<path to download folder>/55filename.img.chunk1
Exception on merge will complain:
Error: file does not exist: <path to download folder>/55/
as it thinks '55/' is a subdir
Diffstat (limited to 'module/network/HTTPChunk.py')
-rw-r--r-- | module/network/HTTPChunk.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/module/network/HTTPChunk.py b/module/network/HTTPChunk.py index d17177ee7..84a2acc5f 100644 --- a/module/network/HTTPChunk.py +++ b/module/network/HTTPChunk.py @@ -263,7 +263,7 @@ class HTTPChunk(HTTPRequest): m = search("filename(?P<type>=|\*=(?P<enc>.+)'')(?P<name>.*)", line) if m: - name = remove_chars(m.groupdict()['name'], "\"';").strip() + name = remove_chars(m.groupdict()['name'], "\"';/").strip() self.p._name = name self.log.debug("Content-Disposition: %s" % name) @@ -295,4 +295,4 @@ class HTTPChunk(HTTPRequest): """ closes everything, unusable after this """ if self.fp: self.fp.close() self.c.close() - if hasattr(self, "p"): del self.p
\ No newline at end of file + if hasattr(self, "p"): del self.p |