Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: AMG script (Read 19335 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

AMG script

below is little script/program that can automatically fetch data from AMG and write it in files tags (with foobar and foo_comserver2) or in tab delimetered csv files stored in passed files folder

2 usage scenarios:

1. foobar and foo_comserver2 installed:
 - make playlist, name it "amg" and add some tracks
 - double click script/program or run it with some arguments
 - it will try to fetch data from AMG, including album cover (200x200px amg_%album%.jpg) and Song reviews (not many releases include song reviews of course)

2. from command line:
Code: [Select]
AMG file_path artist album [-track tracknumber title]
additional arguments that can be add as last arguments (if any) are:
_noc_ (don't download cover)
_nosr_ (don't fetch Song Review)
_nofoo_ (don't use foobar as tagger, just write csv files)

It uses just one request per release (on last release basis) so all data is cached then reused if needed without requesting for every track
This fields can be fetched: Mood, Style, Artist_URL, Release_URL, Release_Date, Release_Rating, Theme, Label, Genre, Review, Composer, Performer, Song_Review and album cover

example: "python amg.pyc" (or double click on amg.exe) will process all files in playlist named "AMG" and add this tags:
 - composer/performer/song_review in corresponding tags
 - all other tags will be written to multivalue %amg% tag with each value following this rule - "%AMG_tag_name%: tag_value"

i.e. if I want to map Review, Rating, Genre and Style from %amg% tag, it can be done with properties dialog > automatically fill values (or more easily with masstagger):

[a href=\"http://img87.imageshack.us/img87/5356/sshot10.png\" target=\"_blank\"]

Compiled with Python 2.6 + Python Win32 Extensions (for com server)
[attachment=5840:amg_script.7z]
Frozen stand alone bundle (2.57 MB):
[attachment=5841:amg.7z]
known limitation (other than design) is no unicode support i.e. if filename is in unicode it will just be skipped

source script by sending email by PM

AMG script

Reply #1
awesome!! thank you very much.

is it posible to use this to write to custom db tags?
last.fm/user/boces

 

AMG script

Reply #2
Good point, I totally forgot about custum_db
I'll make it possible and try to solve problem with unicode filenames somewhere in near future

AMG script

Reply #3
It doesn't work for me.  I don't know why. I have followed all instructions, but I got an error that said "unknown commandline parameter: /tag:AMG=AMG_Mood...etc."

AMG script

Reply #4
Add _dbg_ as argument and see what command line produces
Any more info, like OS, is it portable foobar, which is your foobar install folder, etc?

I'm porting it to Python 3 right now (for unicode support) and some more changes like making it "modular" so that other scripts could work with it, custom_db support etc... but it will be at the end of the next week as I'm somewhat "busy" right now

AMG script

Reply #5
Quote
Add _dbg_ as argument and see what command line produces
Any more info, like OS, is it portable foobar, which is your foobar install folder, etc?

OS is WinXP SP2. It was portable version (c:\foobar2000\), but I tried standart installation (c:\program files\foobar2000\) and got same error. Pic releated

AMG script

Reply #6
It's not clear what could it be. I guess it's happening on any release?
You can try with this bundle (it's built with python 2.5 as I uninstalled 2.6, so you need to download whole package): [attachment=5860:amg_test.7z]
It will print exact command line which you can sent me by PM or paste it here and hopefully well see what's wrong

Also as not many people download it, maybe it's something XP related, as I don't have XP anywhere near. Command line length is large, but it shouldn't be more than 8192 characters (max limit), who know...

AMG script

Reply #7
You're right, it is command line length problem. It works fine with albums which has a bit information in AMG.
Any ideas to using it on XP? I totally do not want install Seven 

AMG script

Reply #8
Hm, it doesn't seem to me that "Blue Train" has more than 8000 chars, it should be around 2-3000 unless there is some nonsense in the parsed tags, can you comment?
I'll think about some workaround for future release

BTW 2048 char limitation is for NT4 and 2000

AMG script

Reply #9
I can't get this script to work with columns_ui... is this possible?

AMG script

Reply #10
I also can't figure out the masstagger script for taking values from %amg% with the ';'  separator...

this is what I'm using as a guessing pattern in masstagger:
Code: [Select]
%%AMG_Genre: %genre%;%%

AMG script

Reply #11
do you use
Code: [Select]
$meta_sep(amg,;)
as source field?

AMG script

Reply #12
Thanks 2E7AH for this, it is great. 

It's not clear what could it be. I guess it's happening on any release?

I think you may have to have the masstagger component installed for it to work.
Without masstagger I get "unknown commandline parameter: /tag:Composer=" errors, similar to what dscmn was getting.

Also 2E7AH, can you please post the uncompiled amg.pyc file as I would like to add the ability to pick up the AMG track picks and AMG album pick flags.

Cheers.

AMG script

Reply #13
Without masstagger I get "unknown commandline parameter: /tag:Composer=" errors, similar to what dscmn was getting.

that's right - without masstagger "/tag" switch doesn't work, I forgot about that so check will be written in next script

Quote
Also 2E7AH, can you please post the uncompiled amg.pyc file as I would like to add the ability to pick up the AMG track picks and AMG album pick flags.

done (just send mail by pm, you don't need to reply here)

btw, new different version soon
- unicode support
- ini file for managing tags (no more switches),
- modular scripts (amg and discogs as first examples - it's not some proper plugin/modular system as I'm not a programmer but works for now)
- custom db option
- etc minor things

some time is needed for porting to python 3000, which just demoralizes me - changes to script and changed python syntax at the same time is wrong combination

AMG script

Reply #14
First: many thanks for this script!It helped me a lot!

Do you still plan to work on a new version?

AMG script

Reply #15
Good to hear  and yes, there will be new version, mainly because I want to provide working script with unicode filename support and INI settings for custom tags. I know I said it should be out till now, but I just made mess of it splitting it in different scripts when now I plan to use classes in just one script + ini file. I'm enthusiastic about Python (looking/working with other things) and just postpone anything related to Python 3. I'll have plenty free time these days and I'll make it

AMG script

Reply #16
Okay. Great to hear it.

AMG script

Reply #17
I'm pretty new to foobar.  I thought I'd ask about getting a little more instruction on getting this to work through foobar with comserver and masstagger?

AMG script

Reply #18
OP should be readable I think, in case you are having trouble with masstagger, here is quick info:

example picture in OP is for properties dialog - "automatically fill values" command, which is the same as masstagger "guess value" command

source is "$meta_sep(amg,;)" which introduces semicolon between values in multivalue %amg% tag

pattern depends on what info you want to place in custom tags: empty double percent (%%) replaces any characters before matched string after it, so if you like to extract only Genre and Style, you should use %%AMG_Style: %style%;%%AMG_Genre: %genre%;

obviously the order or values in %amg% tag is important, and as pointed in OP it's in this order: AMG_Mood; AMG_Style; AMG_Artist_URL; AMG_Release_URL; AMG_Release_Date; AMG_Rating; AMG_Theme; AMG_Label; AMG_Genre; AMG_Review

so "AMG_Style: %style%;" is before "AMG_Genre: %genre%;", and double percent replaces any characters that could be between them, if any

hopefully I'll write new script soon

AMG script

Reply #19
OP should be readable I think, in case you are having trouble with masstagger, here is quick info:

example picture in OP is for properties dialog - "automatically fill values" command, which is the same as masstagger "guess value" command

source is "$meta_sep(amg," which introduces semicolon between values in multivalue %amg% tag

pattern depends on what info you want to place in custom tags: empty double percent (%%) replaces any characters before matched string after it, so if you like to extract only Genre and Style, you should use %%AMG_Style: %style%;%%AMG_Genre: %genre%;

obviously the order or values in %amg% tag is important, and as pointed in OP it's in this order: AMG_Mood; AMG_Style; AMG_Artist_URL; AMG_Release_URL; AMG_Release_Date; AMG_Rating; AMG_Theme; AMG_Label; AMG_Genre; AMG_Review

so "AMG_Style: %style%;" is before "AMG_Genre: %genre%;", and double percent replaces any characters that could be between them, if any

hopefully I'll write new script soon


Thanks, I got it working with that.  The script is great!

AMG script

Reply #20
Seems that links in 1st post are broken, where else can I get this script?

AMG script

Reply #21
Seems that links in 1st post are broken, where else can I get this script?

Actualy all links to this file are broken. Can I get the one that's working?
Or maybe someone could send me this script in PM?

AMG script

Reply #22
OP should be readable I think, in case you are having trouble with masstagger, here is quick info:

example picture in OP is for properties dialog - "automatically fill values" command, which is the same as masstagger "guess value" command

source is "$meta_sep(amg," which introduces semicolon between values in multivalue %amg% tag

pattern depends on what info you want to place in custom tags: empty double percent (%%) replaces any characters before matched string after it, so if you like to extract only Genre and Style, you should use %%AMG_Style: %style%;%%AMG_Genre: %genre%;

obviously the order or values in %amg% tag is important, and as pointed in OP it's in this order: AMG_Mood; AMG_Style; AMG_Artist_URL; AMG_Release_URL; AMG_Release_Date; AMG_Rating; AMG_Theme; AMG_Label; AMG_Genre; AMG_Review

so "AMG_Style: %style%;" is before "AMG_Genre: %genre%;", and double percent replaces any characters that could be between them, if any

hopefully I'll write new script soon



Hey 2E7AH, any chance that you're still working on this?
I'd love to see that update!

AMG script

Reply #23
Is there any place where the amg script can be downloaded? Or can somebody send it to me via e-mail?
It's a great piece of code, doing exactly what I need to keep the genres and the styles well organized. Not to mention the composers for individual tracks are not available elsewhere.

Many thanks in advance.

AMG script

Reply #24
please help avout script.i hope we can all use