Use custom urlencode function. fixes #121

This commit is contained in:
Ruud
2012-04-21 20:55:21 +02:00
parent 8b80c50d89
commit fd462514c3
22 changed files with 79 additions and 66 deletions
+2 -4
View File
@@ -1,5 +1,6 @@
from couchpotato import addView
from couchpotato.core.event import fireEvent, addEvent
from couchpotato.core.helpers.encoding import tryUrlencode
from couchpotato.core.helpers.variable import getExt
from couchpotato.core.logger import CPLog
from couchpotato.environment import Env
@@ -11,10 +12,8 @@ import glob
import math
import os.path
import re
import socket
import time
import traceback
import urllib
import urllib2
log = CPLog(__name__)
@@ -114,7 +113,6 @@ class Plugin(object):
del self.http_failed_disabled[host]
self.wait(host)
try:
if multipart:
@@ -127,7 +125,7 @@ class Plugin(object):
data = opener.open(request, timeout = timeout).read()
else:
log.info('Opening url: %s, params: %s' % (url, [x for x in params.iterkeys()]))
data = urllib.urlencode(params) if len(params) > 0 else None
data = tryUrlencode(params) if len(params) > 0 else None
request = urllib2.Request(url, data, headers)
data = urllib2.urlopen(request, timeout = timeout).read()