summaryrefslogtreecommitdiffstats
path: root/module/web/pyload
diff options
context:
space:
mode:
Diffstat (limited to 'module/web/pyload')
-rw-r--r--module/web/pyload/urls.py2
-rw-r--r--module/web/pyload/views.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/module/web/pyload/urls.py b/module/web/pyload/urls.py
index 34c3aee18..420bc8ce1 100644
--- a/module/web/pyload/urls.py
+++ b/module/web/pyload/urls.py
@@ -9,7 +9,7 @@ from django.conf.urls.defaults import *
urlpatterns = patterns('pyload',
(r'^home/$', 'views.home'),
(r'^downloads/$', 'views.downloads',{},'downloads'),
- (r'^download/(?P<path>[a-zA-z\.0-9\-/_%]+)$', 'views.download',{},'download'),
+ (r'^download/(?P<path>[a-zA-z\.0-9\-/_% "\\]+)$', 'views.download',{},'download'),
(r'^queue/$', 'views.queue',{}, 'queue'),
(r'^collector/$', 'views.collector',{}, 'collector'),
(r'^settings/$', 'views.config',{}, 'config'),
diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py
index 2891b373d..e8df50596 100644
--- a/module/web/pyload/views.py
+++ b/module/web/pyload/views.py
@@ -7,6 +7,7 @@ from os import stat
from os.path import isdir
from os.path import isfile
from os.path import join
+from urllib import unquote
from django.conf import settings
from django.contrib.auth.decorators import login_required
@@ -16,7 +17,6 @@ from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils.translation import ugettext as _
-
def check_server(function):
def _dec(view_func):
def _view(request, * args, ** kwargs):
@@ -110,14 +110,14 @@ def downloads(request):
@permission('pyload.can_download')
@check_server
def download(request, path):
+ path = unquote(path)
path = path.split("/")
-
+
dir = join(settings.DL_ROOT, path[1].replace('..', ''))
if isdir(dir) or isfile(dir):
if isdir(dir): filepath = join(dir, path[2])
elif isfile(dir): filepath = dir
- print filepath
if isfile(filepath):
try:
type, encoding = mimetypes.guess_type(filepath)