summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/plugins/Plugin.py2
-rw-r--r--module/plugins/hooks/ClickAndLoad.py7
-rw-r--r--module/plugins/hoster/FileserveCom.py17
-rw-r--r--module/pyunrar.py5
-rw-r--r--module/web/templates/default/package_ui.js4
5 files changed, 29 insertions, 6 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index 77e4e8183..e8ef15202 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -272,3 +272,5 @@ class Plugin(object):
if self.core.config["permission"]["change_file"]:
chmod(join(location, name), int(self.core.config["permission"]["file"],8))
+
+ return join(location, name) \ No newline at end of file
diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py
index f0372dbf8..0ca492cb7 100644
--- a/module/plugins/hooks/ClickAndLoad.py
+++ b/module/plugins/hooks/ClickAndLoad.py
@@ -64,7 +64,12 @@ def server(self, *settings):
thread.start_new_thread(forward, (client_socket, server_socket))
thread.start_new_thread(forward, (server_socket, client_socket))
except socket.error, e:
- if e.errno == 98:
+ if hasattr(e, "errno"):
+ errno = e.errno
+ else:
+ errno = e.args[0]
+
+ if errno == 98:
self.core.log.warning(_("Click'N'Load: Port 9666 already in use"))
return
thread.start_new_thread(server, (self,)+settings)
diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py
index adf62434d..c2deb3751 100644
--- a/module/plugins/hoster/FileserveCom.py
+++ b/module/plugins/hoster/FileserveCom.py
@@ -2,6 +2,7 @@
import re
+from os import stat
from os.path import join
from module.plugins.Hoster import Hoster
@@ -93,7 +94,21 @@ class FileserveCom(Hoster):
self.load(self.pyfile.url, post={"downloadLink":"show"})
self.load(self.pyfile.url, post={"download":"normal"}, just_header=True)
- self.download(self.pyfile.url, post={"download":"normal"})
+ dl = self.download(self.pyfile.url, post={"download":"normal"})
+
+ size = stat(dl)
+ size = size.st_size
+
+ if size < 40000:
+ f = open(dl, "rb")
+ content = f.read()
+ m = re.search(r'<html>', content)
+ if m is not None:
+ self.setWait(720)
+ self.wantReconnect = True
+ self.wait()
+ self.handleFree()
+ return
#TODO: validate download it could be html file with errors
diff --git a/module/pyunrar.py b/module/pyunrar.py
index 4db7e1775..6c718514d 100644
--- a/module/pyunrar.py
+++ b/module/pyunrar.py
@@ -24,7 +24,7 @@ from time import sleep
from tempfile import mkdtemp
from shutil import rmtree, move
from shutil import Error as FileError
-from os.path import join, abspath, basename, dirname
+from os.path import join, abspath, basename, dirname, exists
from os import remove, makedirs
EXITMAP = {
@@ -92,7 +92,8 @@ class Unrar():
self.tmpdir = mkdtemp()
else:
self.tmpdir = tmpdir
- makedirs(tmpdir)
+ if not exists(tmpdir):
+ makedirs(tmpdir)
def listContent(self, password=None):
"""
diff --git a/module/web/templates/default/package_ui.js b/module/web/templates/default/package_ui.js
index 6ef254e6a..70f5f35b6 100644
--- a/module/web/templates/default/package_ui.js
+++ b/module/web/templates/default/package_ui.js
@@ -30,7 +30,7 @@ function indicateSuccess(){
success.start("opacity", 1).chain(function(){
(function(){
success.start("opacity", 0);
- }).delay(100);
+ }).delay(200);
});
}
@@ -40,7 +40,7 @@ function indicateFail(){
fail.start("opacity", 1).chain(function(){
(function(){
fail.start("opacity", 0);
- }).delay(100);
+ }).delay(200);
});
}