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 | |
parent | win connection fix (diff) | |
download | pyload-5e2cd8c23ff4d3c1c2142212de4bb4e7cc6d575a.tar.xz |
youtube fix, xdccrequest abort dl implemented
-rw-r--r-- | module/network/XDCCRequest.py | 13 | ||||
-rw-r--r-- | module/plugins/hoster/YoutubeCom.py | 4 |
2 files changed, 13 insertions, 4 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 diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 0616d6dc1..34d757ac0 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -42,7 +42,9 @@ class YoutubeCom(Hoster): if self.getConf("quality") == "sd": desired_fmt = "6" elif self.getConf("quality") == "hd" and hd_available: - desired_fmt = "2" + desired_fmt = "22" + elif self.getConf("quality") == "fullhd" and hd_available: + desired_fmt = "37" fmt_pattern = 'fmt_url_map=(.+?)&' fmt_url_map = re.search(fmt_pattern, html).group(1) |