pub fn decode(content: &str) -> Result<Vec<PlaylistValue>>Expand description
Decode playlist content string. It checks for M3U, PLS, XSPF and ASX content in the string.
Returns the parsed entries from the playlist, in playlist order.
NOTE: currently there is a mix of url and other things in this list
ยงExample
let list = playlist_decoder::decode(r##"<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>
<track>
<title>Nobody Move, Nobody Get Hurt</title>
<creator>We Are Scientists</creator>
<location>file:///mp3s/titel_1.mp3</location>
</track>
<track>
<title>See The World</title>
<creator>The Kooks</creator>
<location>http://www.example.org/musik/world.ogg</location>
</track>
</trackList>
</playlist>"##).unwrap();
assert!(list.len() == 2, "Did not find 2 urls in example");
for item in list {
println!("{:?}", item);
}