Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Some Song Variables Not Working, Came up with a fix to share
Myth Monk
post Dec 4 2008, 02:17 AM
Post #1


Newbie
*

Group: Members
Posts: 3
Joined: 4-December 08
Member No.: 637



So I ran into an interesting problem while running AMIP.

Some of the files I have will not parse normally into AMIP callbacks (I have no idea why).
as far as I have noticed, this affects my entire collection of Man Or Astro-Man? music.

The weird thing is, it works fine in clipboard mode using the %1 %2 %4 variables, and %name, but try as I might I could NOT get them to work with my curl output script.

But I came up with a fix. So far this has only been tested with foobar2000 and its default output.

CODE
# cURL config file
url = http://10.0.2.128/musicgrab.php
#use HTTP GET
-G
# list of params to pass
#%?1<yes | no>
%?1<-d "artist=$ue(%1)"|-d "artist=$ue($strip( -,$strip(\. ,$regmatch(%s,\. .*? -,0))))">
%?4<-d "album=$ue(%4)"|-d "album=$ue($strip( #.*/.*,$strip(\],$strip(\[,$regmatch(%s,\[.*\],0)))))">
%?2<-d "title=$ue(%2)"|-d "title=$ue($strip(.*\] ,%s))">
-d "duration=$ue($pad(%min,0):%sec)"


This assumes that %s outputs in the following %s format (which was the default):
$num(%_playlist_number%,3). [%artist% - ]$if(%title%,['['%album%[ #[%disc%/]$num(%tracknumber%,2)]'] ']%title%,%_filename_ext%)

(and it assumes musicgrab.php is looking for a GET string with the variables artist, album, title, and duration, but obviously that can be fairly easily modified)

This took me quite a lot of head-scratching time, so I thought I'd post it, just in case anyone else came across the same problem.

My callback configuration (under Change):
CODE
/template: (C:\curl\grenademusic.conf) C:\curl\grenadeconf.out
/exec: (C:\curl\curl.exe) -K grenadeconf.out
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members: