Use custom urlencode function. fixes #121
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user