Error in splitting playlist entries
Brought to you by:
gilm
In the subroutines parse_m3u_playlist and parse_pls_playlist the following line is wrong:
my (@lines) = split('\n', $playlist);
If the server, requested for a playlist, responds with a playlist with entries separated with LineFeed+NewLine (\r\n) this split will leave the LineFeed character (\r) at the end of the playlist entries. This will in turn cause parsing of the playlist entry in subroutine split_url to fail at the following line:
if ($url =~ /^([\d\w\._\-]+)(:\d+)??(\/.*)??$/)
Solution:
Change the lines with the split command in the subroutines parse_m3u_playlist and parse_pls_playlist to the following line:
my (@lines) = split(/[\r\n]+/, $playlist);
//Per Henriksson