How to add Web Sources


#1

Hi, first of sorry for my beginner question!
I would like to add a web source “http://www.amazon.it/” to my list,
generate an “amazon.it.src” file.
I’m running window 7 and I read another thread in this forum that explain about.
If I understood well the file must be saved in:
“C:\Documents and Settings<username>\Application Data\Mp3tag\data\sources” (it is an hidden file)
However I dont understand how to generate the .src file, in the above mentioned thread there is a list of web source to download, I would like to create mine so, could you be so kind explain to me how to do it?
Really thanks for your help, really apreciated!


#2

You can start a search on your computer to find the .src files.
But just adding a file with the name of your preferred web source will hardly be enough as long as the code that is in the file does not do the right thing.
Yet, you can open any of the src files with the Windows editor as they are plain text files.
Happy programming.


#3

Thanks a lot for your help ohrenkino,
what do you mean by “window editor”?
".src" files are txt file, I can open them with any text editor, notepad as exp.
Obviously I’m not a programmer, I’m not able to edit it by myself.
I tought it was possible to add src files to our web source list in an easier way.
So basically you are saying that, without programmer skills, it’s impossible add files to our web sources list, right?

I ask if it’s possible cause, what about songs in different language than English? Italian song as exp?
In “amazon.com” I can find some of italian LP songs that I was looking for, however just the most famous, no record about less know LP. There are other web site, italian one, where I can find those LP, however I can’t extract from them the info that I need cause I can’t add them to my web source list.

Any suggestions?

Thanks for your help, really apreciated!


#4

Yes, I meant the text editor that comes with the basic Windows installation. But any other editor is just as good.

You can start a trial:
Copy of the amazon.com.src file to e.g. amazon.it.src
Open it with an editor :wink:

In that file there are numerous references to amazon.com
Replace these with your local amazon web address, e.g. amazon.it

E.g. the section
[Name]=Amazon.com
[BasedOn]=http://webservices.amazon.com
[IndexUrl]=http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AssociateTag=none&Operation=ItemSearch&SearchIndex=Music&Keywords=%s&ItemPage=1&ResponseGroup=ItemAttributes,Small,Tracks,Images
[AlbumUrl]=http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AssociateTag=none&Operation=ItemLookup&ItemId

would become
[Name]=amazon.it
[BasedOn]=http://webservices.amazon.it
[IndexUrl]=http://webservices.amazon.it/onca/xml?Service=AWSECommerceService&AssociateTag=none&Operation=ItemSearch&SearchIndex=Music&Keywords=%s&ItemPage=1&ResponseGroup=ItemAttributes,Small,Tracks,Images
[AlbumUrl]=http://webservices.amazon.it/onca/xml?Service=AWSECommerceService&AssociateTag=none&Operation=ItemLookup&ItemId

try if this modification addresses the Italian amazon site.


#5

Thanks a lot,
I’m going to follow your suggestions,
your help is really apreciated!


#6

I follow your suggestions editing the file like this, basically change only amazon.com to amazon.it:

Mp3tag parsing for Amazon Web Service (v2.36 and higher)

Web source created and maintained by dano

Last modified 2011-01-26

minor additions by Florian and Dave Reid

Save it in your Mp3tag data directory, i.e.

C:\Documents and Settings*username*\Application Data\Mp3tag\data\sources

[Name]=Amazon.it
[BasedOn]=http://webservices.amazon.it
[IndexUrl]=http://webservices.amazon.it/onca/xml?Service=AWSECommerceService&AssociateTag=none&Operation=ItemSearch&SearchIndex=Music&Keywords=%s&ItemPage=1&ResponseGroup=ItemAttributes,Small,Tracks,Images
[AlbumUrl]=http://webservices.amazon.it/onca/xml?Service=AWSECommerceService&AssociateTag=none&Operation=ItemLookup&ItemId
[WordSeperator]=%20
[IndexFormat]=%_url%|%_preview%|%Artist%|%Publisher%|%Tracks%|%Released%|%Album%
[SearchBy]=%album%

[ParserScriptIndex]=…

This script parses the webpage for all releases

by this albumname.

The output format is defined by IndexFormat above, which

is used by the selection dialog

regexpreplace “[^<]+” ""
do
findinline ""
say "="
findinline ""
sayuntil ""
say "&ItemPage=1&ResponseGroup=ItemAttributes,Small,Tracks,Images"
say “|”

# Preview
findinline "<DetailPageURL>"
sayuntil "</DetailPageURL>"
say "|"

# Artist
findinline "<ItemAttributes>"
if "<Artist>"
	findinline "<Artist>"
	sayuntil "</Artist>"
else
	if "<Creator"
		findinline "<Creator"
		findinline ">"
		sayuntil "</Creator>"
	else
		if "<Author>"
			findinline "<Author>"
			sayuntil "</Author>"
		endif
	endif
endif
say "|"

# Publisher
sayregexp "(?<=<Label>)[^<]+(?=</Label>)" ", " "</ItemAttributes>"
say "|"

# Total tracks
sayregexp "(?<=Track Number=\")\d+(?=\">[^<]+</Track></Disc>)" ", " "</Item>"
say "|"

# Released	
sayregexp "(?<=<ReleaseDate>)[-0-9]{4,10}(?=</ReleaseDate>)" ", " "</ItemAttributes>"
say "|"

#Album
findinline "<Title>"
sayuntil "</Title>"

saynewline
findinline "</Item>"

while “”

[ParserScriptAlbum]=…

This script parses the albums page for all common information.

The current output variable is set via the outputto command

All these fields are used by the confirm online information dialog

regexpreplace …

it doesn’t work, I get an error, a window pops up saying: “error connecting to server, 400 error.”


#7

It was a a quick and dirty attempt.
From now on it is up to the ones who know better how to write a web source script.
Sorry, I have to leave you here.


#8

If you try to use the IndexURL in a web browser, you get the following XML-Response:

Without your personal Amazon Accesskey, you can’t get valid responses. Please have a look here: http://docs.aws.amazon.com/AWSSimpleQueueS…redentials.html


#9

Thanks a lot,
a little bit to complecated, thanks a nyway!