summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jeix <devnull@localhost> 2010-10-02 20:06:09 +0200
committerGravatar Jeix <devnull@localhost> 2010-10-02 20:06:09 +0200
commitebf957d0fbaa0d52ce248276eee755eff3b60092 (patch)
treecdf537743d4a47bf0a4c2a55b49159dd2581142c
parentclosed #140 (diff)
downloadpyload-ebf957d0fbaa0d52ce248276eee755eff3b60092.tar.xz
urlencode fix
-rwxr-xr-xmodule/network/Request.py8
-rw-r--r--module/web/ajax/views.py2
2 files changed, 7 insertions, 3 deletions
diff --git a/module/network/Request.py b/module/network/Request.py
index f322c847a..bbce37d6b 100755
--- a/module/network/Request.py
+++ b/module/network/Request.py
@@ -127,7 +127,7 @@ class Request:
self.pycurl.setopt(pycurl.NOPROGRESS, 1)
- url = str(url)
+ url = self.__myquote(str(url))
if post:
if not no_post_encode:
@@ -204,7 +204,7 @@ class Request:
def download(self, url, file_name, folder, get={}, post={}, ref=True, cookies=True, no_post_encode=False):
- url = str(url)
+ url = self.__myquote(str(url))
self.pycurl.setopt(pycurl.NOPROGRESS, 0)
@@ -384,6 +384,10 @@ class Request:
self.pycurl.close()
except:
pass
+
+ def __myquote(self, url):
+ return urllib.quote(url, safe="%/:=&?~#+!$,;'@()*[]")
+
def getURL(url, get={}, post={}):
"""
diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py
index 5e911e0ba..603bb993a 100644
--- a/module/web/ajax/views.py
+++ b/module/web/ajax/views.py
@@ -56,7 +56,7 @@ def add_package(request):
queue = int(request.POST['add_dest'])
- links = request.POST['add_links'].replace(" ", "\n").split("\n")
+ links = request.POST['add_links'].split("\n")
try:
f = request.FILES['add_file']