more urlencode

This commit is contained in:
j 2014-10-05 19:54:13 +02:00
parent 865e94da22
commit 1f14f6db55

View file

@ -2,7 +2,7 @@
# encoding: utf-8 # encoding: utf-8
from __future__ import print_function from __future__ import print_function
import re import re
from six.moves import urllib from six.moves.urllib.parse import urlencode
from ox.cache import read_url from ox.cache import read_url
from ox.html import decode_html, strip_tags from ox.html import decode_html, strip_tags
@ -29,7 +29,7 @@ def compose_url(request, parameters):
if request == 'advancedSearch': if request == 'advancedSearch':
url = 'http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZSearch.woa/wa/advancedSearch?' url = 'http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZSearch.woa/wa/advancedSearch?'
if parameters['media'] == 'music': if parameters['media'] == 'music':
url += urllib.urlencode({ url += urlencode({
'albumTerm': parameters['title'], 'albumTerm': parameters['title'],
'allArtistNames': parameters['artist'], 'allArtistNames': parameters['artist'],
'composerTerm': '', 'composerTerm': '',
@ -42,7 +42,7 @@ def compose_url(request, parameters):
'songTerm': '' 'songTerm': ''
}) })
elif parameters['media'] == 'movie': elif parameters['media'] == 'movie':
url += urllib.urlencode({ url += urlencode({
'actorTerm': '', 'actorTerm': '',
'closedCaption': 0, 'closedCaption': 0,
'descriptionTerm': '', 'descriptionTerm': '',