summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/network/XDCCRequest.py13
-rw-r--r--module/plugins/hoster/YoutubeCom.py4
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)