Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Mar 2005 09:18:28 +0100
From:      "Harald Meub" <harald@meub.net>
To:        trevor@FreeBSD.org
Cc:        ports@FreeBSD.org
Subject:   FreeBSD Port: streamripper-1.61.3
Message-ID:  <4237F9E4.22826.1304E63B@localhost>

next in thread | raw e-mail | index | archive | help
Hi Trevor!

I noticed you marked current streamripper as broken.

> IGNORE: "is marked as broken: "fails to split up 
> streams into tracks""

It works perfectly if you change the regex default rules, the default 
rules aren't compatible with the used regex lib. I currently just 
override the default with an adapted 'parse_rules.txt' file (calling 
streamripper with '-w <rulesfile>').

The broken rules are:
>>>
# This is the normal parsing rule: "Artist - Title"
# The trailing "A1" means that the artist (A) matches subpattern 1
# The trailing "T2" means that the title (T) matches subpattern 2
m/^[[:space:]]*([^-]*?)[[:space:]]*-
[[:space:]]*(.*?)[[:space:]]*$/A1T2

# This is slightly different parsing rule: "Artist, Title"
m/^[[:space:]]*([^,]*?)[[:space:]]*,[[:space:]]*(.*?)[[:space:]]*$/A1T
2
<<<

I use this rule instead:
m/^[[:space:]]*([^-]*)[[:space:]]*-[[:space:]]*(.*)[[:space:]]*$/A1T2

The difference is the '?' minimal match modifier. With this, 
streamripper complains a malformed rule when starting and fails to 
split.

Best should IMHO be to patch the default which you can find in 
lib/parse.c simply by removing the two question marks in line 78!
>>>
-	"^[[:space:]]*([^-]*?)[[:space:]]*-[[:space:]]*(.*?)[[:space:]]*$",
+	"^[[:space:]]*([^-]*)[[:space:]]*-[[:space:]]*(.*)[[:space:]]*$",
<<<
I haven't tested it but this should do!

hope it helps,
bye, harald

---
Harald Meub
harald@meub.net



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4237F9E4.22826.1304E63B>