I have a sample .m3u file of internet radio urls (from the Twonky distribution)
which aren't parsed correctly by playlists.js, because the title is preceded
by a number "-1", but the matching pattern doesn't provide for a "-" in
this position. Here is a way to correct it:
[root@greg js]# diff -u playlists.js.orig playlists.js
--- playlists.js.orig 2008-06-04 12:50:39.000000000 -1000
+++ playlists.js 2008-06-04 12:50:51.000000000 -1000
@@ -89,6 +89,11 @@
// duration = RegExp.$1; // currently unused
title = RegExp.$2;
+ else if (line.match(/^#EXTINF:(-\d+),(\S.+)$/i))
+ // duration = RegExp.$1; // currently unused NEGATIVE VALUE
+ title = RegExp.$2;
else if (! line.match(/^(#|\s*$)/))
addPlaylistItem(line, title, playlistChain);
If the above gets word-wrapped, I'm sorry, but I don't
know how to avoid that.
Thanks for the info and for the patch!
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.