@@ -38,7 +38,7 @@ def json_decode(output):
3838 }
3939
4040sites_langs = {
41- 'www.audible.com' : { 'lang' : 'en' , 'urltitle' : u'title=' , 'rel_date' : u'Release date' , 'nar_by' : u'Narrated By' , 'nar_by2' : u'Narrated by' },
41+ 'www.audible.com' : { 'lang' : 'en' , 'urltitle' : u'title=' , 'rel_date' : u'Release ' , 'nar_by' : u'Narrated By' , 'nar_by2' : u'Narrated by' },
4242 'www.audible.co.uk' : { 'lang' : 'en' , 'urltitle' : u'searchTitle=' , 'rel_date' : u'Release Date' , 'nar_by' : u'Narrated By' , 'nar_by2' : u'Narrated by' },
4343 'www.audible.com.au' : { 'lang' : 'en' , 'urltitle' : u'searchTitle=' , 'rel_date' : u'Release Date' , 'nar_by' : u'Narrated By' , 'nar_by2' : u'Narrated by' },
4444 'www.audible.fr' : { 'lang' : 'fr' , 'urltitle' : u'searchTitle=' , 'rel_date' : u'Date de publication' , 'nar_by' : u'Narrateur(s)' , 'nar_by2' : u'Lu par' },
@@ -99,12 +99,18 @@ def SetupUrls(sitetype, base, lang='en'):
9999 Log ('/* NAR_BY_INFO = %s' , ctx ['NAR_BY_INFO' ])
100100 Log ('/********************************************************************************/' )
101101
102+ # Match titles using more flexible keyword search
103+ if Prefs ['keyword_searching' ]:
104+ urlsearchtitle = "advsearchKeywords="
105+ else :
106+ # fallback for .com title search outside US
107+ urlsearchtitle += "{0}&searchTitle="
102108
103109 AUD_BASE_URL = 'https://' + str (base ) + '/'
104110 AUD_TITLE_URL = urlsearchtitle
105111 ctx ['AUD_BOOK_INFO' ]= AUD_BASE_URL + 'pd/%s?ipRedirectOverride=true'
106112 ctx ['AUD_ARTIST_SEARCH_URL' ]= AUD_BASE_URL + 'search?searchAuthor=%s&ipRedirectOverride=true'
107- ctx ['AUD_ALBUM_SEARCH_URL' ]= AUD_BASE_URL + 'search?' + AUD_TITLE_URL + '%s &x=41&ipRedirectOverride=true'
113+ ctx ['AUD_ALBUM_SEARCH_URL' ]= AUD_BASE_URL + 'search?' + AUD_TITLE_URL + '{0} &x=41&ipRedirectOverride=true'
108114 ctx ['AUD_KEYWORD_SEARCH_URL' ]= AUD_BASE_URL + 'search?filterby=field-keywords&advsearchKeywords=%s&x=41&ipRedirectOverride=true'
109115 ctx ['AUD_SEARCH_URL' ]= AUD_BASE_URL + 'search?' + AUD_TITLE_URL + '{0}&searchAuthor={1}&x=41&ipRedirectOverride=true'
110116 return ctx
@@ -354,7 +360,7 @@ def search(self, results, media, lang, manual):
354360 elif media .artist is not None :
355361 searchUrl = ctx ['AUD_SEARCH_URL' ].format ((String .Quote ((normalizedName ).encode ('utf-8' ), usePlus = True )), (String .Quote ((media .artist ).encode ('utf-8' ), usePlus = True )))
356362 else :
357- searchUrl = ctx ['AUD_ALBUM_SEARCH_URL' ] % ( String .Quote ((normalizedName ).encode ('utf-8' ), usePlus = True ))
363+ searchUrl = ctx ['AUD_ALBUM_SEARCH_URL' ]. format (( String .Quote ((normalizedName ).encode ('utf-8' ), usePlus = True ) ))
358364 found = self .doSearch (searchUrl , ctx )
359365
360366 # Write search result status to log
0 commit comments