Page 1 of 1

Google search uses wrong parameters

PostPosted: Thu Oct 27, 2011 9:16 am
by ThyMaster
Hi,

if I use the Google search option to gather more information on a specific artist, Subsonic uses the following parameters:
Code: Select all
http://www.google.com/musicsearch?q=%22Artist Name%22+%22album Name%22

This doesn't work (anymore?). It opens a Goolge web page with help tips but no search result.
I assume the parameter "musicsearch" is depreciated (or not working with German Google).

Pls fix.

TIA
-Thymaster

Re: Google search uses wrong parameters

PostPosted: Thu Oct 27, 2011 10:54 am
by BKKKPewsey
You get the same help page with English google as well so it appears to be a generic problem.
:mrgreen:

Re: Google search uses wrong parameters

PostPosted: Thu Oct 27, 2011 11:19 am
by califrag
Most of the default search options are broken or don't work reliably.

I've created a branch of Subsonic where I've changed a LOT of things, these search buttons being one of them.

If you aren't interested in completely switching over, you can fix these search features by opening the file jetty/2384/webapp/WEB-INF/jsp/main.jsp

Find these codes
Code: Select all
<sub:url value="http://www.google.com/musicsearch" var="googleUrl" encoding="UTF-8">
    <sub:param name="q" value="\"${artist}\" \"${album}\""/>
</sub:url>
<sub:url value="http://en.wikipedia.org/wiki/Special:Search" var="wikipediaUrl" encoding="UTF-8">
     <sub:param name="search" value="\"${album}\""/>
     <sub:param name="go" value="Go"/>
</sub:url>
<sub:url value="allmusic.view" var="allmusicUrl">
    <sub:param name="album" value="${album}"/>
</sub:url>
<sub:url value="http://www.last.fm/search" var="lastFmUrl" encoding="UTF-8">
    <sub:param name="q" value="\"${artist}\" \"${album}\""/>
    <sub:param name="type" value="album"/>
</sub:url>

And change it to these:
Code: Select all
<sub:url value="http://www.google.com/search" var="googleUrl" encoding="UTF-8">
    <sub:param name="q" value="\"${artist}\" \"${album}\""/>
</sub:url>
<sub:url value="http://www.google.com/search" var="wikipediaUrl" encoding="UTF-8">
    <sub:param name="q" value="site:wikipedia.org \"${artist}\" \"${album}\""/>
    <sub:param name="btnI" value="I\'m+Feeling+Lucky"/>
</sub:url>
<sub:url value="http://www.google.com/search" var="allmusicUrl" encoding="UTF-8">
    <sub:param name="q" value="site:allmusic.com \"${artist}\" \"${album}\""/>
    <sub:param name="btnI" value="I\'m+Feeling+Lucky"/>
</sub:url>
<sub:url value="http://www.google.com/search" var="lastFmUrl" encoding="UTF-8">
     <sub:param name="q" value="site:last.fm album \"${artist}\" \"${album}\""/>
     <sub:param name="btnI" value="I\'m+Feeling+Lucky"/>
</sub:url>


This will make all of the search buttons use Google's I'm Feeling Lucky search feature to search the specific site by "site: ...com" for the specific tags, then go to the first option.

It seems to provide more accurate results for most of the artists and albums that I've tried.

Re: Google search uses wrong parameters

PostPosted: Thu Oct 27, 2011 12:27 pm
by pemholder
califrag wrote:If you aren't interested in completely switching over, you can fix these search features by opening the file jetty/2384/webapp/WEB-INF/jsp/right.jsp


I think you mean main.jsp.

Re: Google search uses wrong parameters

PostPosted: Thu Oct 27, 2011 12:41 pm
by califrag
pemholder wrote:
califrag wrote:If you aren't interested in completely switching over, you can fix these search features by opening the file jetty/2384/webapp/WEB-INF/jsp/right.jsp


I think you mean main.jsp.

ah yep. sorry.

it's 5:41am my time.

i fixed it