From 1bb6ebf544b43cacf7c0755c5a8608b79b95e2d6 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 7 Jan 2012 20:11:16 +0100 Subject: MultiHoster plugin type, some fixes, new documentation structure --- module/network/HTTPDownload.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/network/HTTPDownload.py') diff --git a/module/network/HTTPDownload.py b/module/network/HTTPDownload.py index fe8075539..0d5fc59c9 100644 --- a/module/network/HTTPDownload.py +++ b/module/network/HTTPDownload.py @@ -17,9 +17,9 @@ @author: RaNaN """ -from os import remove, fsync +from os import remove from os.path import dirname -from time import sleep, time +from time import time from shutil import move from logging import getLogger @@ -28,7 +28,7 @@ import pycurl from HTTPChunk import ChunkInfo, HTTPChunk from HTTPRequest import BadHeader -from module.plugins.Plugin import Abort +from module.plugins.Hoster import Abort from module.utils import save_join, fs_encode class HTTPDownload(): -- cgit v1.2.3 From 1ecdd9f6b53fec45e1d48592e3ff56aa7a576bec Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 8 Jan 2012 16:47:52 +0100 Subject: some cleanups, closed #490 --- module/network/HTTPDownload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/network/HTTPDownload.py') diff --git a/module/network/HTTPDownload.py b/module/network/HTTPDownload.py index 0d5fc59c9..6ac39a051 100644 --- a/module/network/HTTPDownload.py +++ b/module/network/HTTPDownload.py @@ -29,7 +29,7 @@ from HTTPChunk import ChunkInfo, HTTPChunk from HTTPRequest import BadHeader from module.plugins.Hoster import Abort -from module.utils import save_join, fs_encode +from module.utils.fs import save_join, fs_encode class HTTPDownload(): """ loads a url http + ftp """ -- cgit v1.2.3 From 17b3595dc5db8b3270e6bcd07176ed4b7b47930a Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 15 Jan 2012 19:28:12 +0100 Subject: improved handling of content-disposition --- module/network/HTTPDownload.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'module/network/HTTPDownload.py') diff --git a/module/network/HTTPDownload.py b/module/network/HTTPDownload.py index 6ac39a051..59d38beee 100644 --- a/module/network/HTTPDownload.py +++ b/module/network/HTTPDownload.py @@ -49,7 +49,7 @@ class HTTPDownload(): self.abort = False self.size = 0 - self.nameDisposition = None #will be parsed from content disposition + self._name = ""# will be parsed from content disposition self.chunks = [] @@ -87,6 +87,10 @@ class HTTPDownload(): if not self.size: return 0 return (self.arrived * 100) / self.size + @property + def name(self): + return self._name if self.disposition else "" + def _copyChunks(self): init = fs_encode(self.info.getChunkName(0)) #initial chunk name @@ -113,8 +117,8 @@ class HTTPDownload(): remove(fname) #remove chunk fo.close() - if self.nameDisposition and self.disposition: - self.filename = save_join(dirname(self.filename), self.nameDisposition) + if self.name: + self.filename = save_join(dirname(self.filename), self.name) move(init, fs_encode(self.filename)) self.info.remove() #remove info file @@ -144,8 +148,7 @@ class HTTPDownload(): finally: self.close() - if self.nameDisposition and self.disposition: return self.nameDisposition - return None + return self.name def _download(self, chunks, resume): if not resume: -- cgit v1.2.3 From 4df2b77fdf42046fe19bd371be7c7255986b5980 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 6 Mar 2012 13:36:39 +0100 Subject: renamed hooks to addons, new filemanager and database, many new api methods you will loose ALL your LINKS, webinterface will NOT work --- module/network/HTTPDownload.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/network/HTTPDownload.py') diff --git a/module/network/HTTPDownload.py b/module/network/HTTPDownload.py index 59d38beee..520a4e5f4 100644 --- a/module/network/HTTPDownload.py +++ b/module/network/HTTPDownload.py @@ -31,6 +31,8 @@ from HTTPRequest import BadHeader from module.plugins.Hoster import Abort from module.utils.fs import save_join, fs_encode +# TODO: save content-disposition for resuming + class HTTPDownload(): """ loads a url http + ftp """ -- cgit v1.2.3 From 50d4df8b4d48b855bd18e9922355b7f3f2b4da4e Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 20 Mar 2012 14:57:45 +0100 Subject: captcha decrypting for all plugin types, new interaction manager --- module/network/HTTPDownload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/network/HTTPDownload.py') diff --git a/module/network/HTTPDownload.py b/module/network/HTTPDownload.py index 520a4e5f4..05ca44406 100644 --- a/module/network/HTTPDownload.py +++ b/module/network/HTTPDownload.py @@ -28,7 +28,7 @@ import pycurl from HTTPChunk import ChunkInfo, HTTPChunk from HTTPRequest import BadHeader -from module.plugins.Hoster import Abort +from module.plugins.Base import Abort from module.utils.fs import save_join, fs_encode # TODO: save content-disposition for resuming -- cgit v1.2.3 From b40b32ee05f611323a7827fad2a25fa0a28dcb24 Mon Sep 17 00:00:00 2001 From: X3n0m0rph59 Date: Sun, 22 Apr 2012 19:56:17 +0200 Subject: a huge pile of spelling fixes --- module/network/HTTPDownload.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/network/HTTPDownload.py') diff --git a/module/network/HTTPDownload.py b/module/network/HTTPDownload.py index 05ca44406..c6d2e1547 100644 --- a/module/network/HTTPDownload.py +++ b/module/network/HTTPDownload.py @@ -34,7 +34,7 @@ from module.utils.fs import save_join, fs_encode # TODO: save content-disposition for resuming class HTTPDownload(): - """ loads a url http + ftp """ + """ loads an url, http + ftp supported """ def __init__(self, url, filename, get={}, post={}, referer=None, cj=None, bucket=None, options={}, progressNotify=None, disposition=False): @@ -174,7 +174,7 @@ class HTTPDownload(): while 1: #need to create chunks - if not chunksCreated and self.chunkSupport and self.size: #will be setted later by first chunk + if not chunksCreated and self.chunkSupport and self.size: #will be set later by first chunk if not resume: self.info.setSize(self.size) @@ -193,7 +193,7 @@ class HTTPDownload(): self.chunks.append(c) self.m.add_handle(handle) else: - #close immediatly + #close immediately self.log.debug("Invalid curl handle -> closed") c.close() @@ -291,7 +291,7 @@ class HTTPDownload(): if self.abort: raise Abort() - #sleep(0.003) #supress busy waiting - limits dl speed to (1 / x) * buffersize + #sleep(0.003) #suppress busy waiting - limits dl speed to (1 / x) * buffersize self.m.select(1) for chunk in self.chunks: -- cgit v1.2.3