diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-06-26 11:37:44 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-06-26 11:37:44 +0200 |
commit | e260b201f94a2a1e470b85a6499ea70e20a11277 (patch) | |
tree | 356dc9f5a7d8ef14cf6befb8cfa324b991571a0c /module/network/Request.py | |
parent | fixed occasionally appearing cli bug, catpcha method for sharebiz @ ~60% (diff) | |
download | pyload-e260b201f94a2a1e470b85a6499ea70e20a11277.tar.xz |
Cli stable, able to abort downloads, pause/kill server
Diffstat (limited to 'module/network/Request.py')
-rwxr-xr-x | module/network/Request.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/module/network/Request.py b/module/network/Request.py index 0b518cf66..346412446 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -24,6 +24,9 @@ from cStringIO import StringIO retrieveUrl returns response as string """ +class AbortDownload(Exception): + pass + class Request: def __init__(self): @@ -33,6 +36,8 @@ class Request: self.dl_arrived = 0 self.dl = False + self.abort = False + self.cookies = [] self.lastURL = None self.cj = cookielib.CookieJar() @@ -146,6 +151,7 @@ class Request: self.dl_arrived = 0 self.dl_time = time.time() for chunk in conn: + if self.abort: raise AbortDownload self.dl_arrived += len(chunk) file.write(chunk) file.close() |