diff options
author | Jeix <devnull@localhost> | 2011-02-16 19:55:00 +0100 |
---|---|---|
committer | Jeix <devnull@localhost> | 2011-02-16 19:55:00 +0100 |
commit | 5e2cd8c23ff4d3c1c2142212de4bb4e7cc6d575a (patch) | |
tree | c06d1a4f8da4a787fc05ac41d957212bd20023df /module/network/XDCCRequest.py | |
parent | win connection fix (diff) | |
download | pyload-5e2cd8c23ff4d3c1c2142212de4bb4e7cc6d575a.tar.xz |
youtube fix, xdccrequest abort dl implemented
Diffstat (limited to 'module/network/XDCCRequest.py')
-rw-r--r-- | module/network/XDCCRequest.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/module/network/XDCCRequest.py b/module/network/XDCCRequest.py index 01015cc62..92ccb4839 100644 --- a/module/network/XDCCRequest.py +++ b/module/network/XDCCRequest.py @@ -20,6 +20,7 @@ import socket import re +from os import remove from os.path import exists from time import time @@ -27,8 +28,8 @@ from time import time import struct from select import select -class XDCCError(Exception): - pass +from module.plugins.Plugin import Abort + class XDCCRequest(): def __init__(self, timeout=30, proxies={}): @@ -88,7 +89,10 @@ class XDCCRequest(): # recv loop for dcc socket while True: if self.abort: - break + dccsock.close() + fh.close() + remove(filename) + raise Abort() data = dccsock.recv(4096) dataLen = len(data) @@ -121,6 +125,9 @@ class XDCCRequest(): return filename + def abortDownloads(self): + self.abort = True + @property def size(self): return self.filesize |