FireFly Media Server › Firefly Media Server Forums › Firefly Media Server › Add-on Software › FireSpiff – Export XML playlist (XSPF)
- This topic has 15 replies, 5 voices, and was last updated 14 years, 10 months ago by blamm.
-
AuthorPosts
-
08/12/2007 at 2:54 PM #2014blammParticipant
Hi
Have started playing with XSL to see if I can transform the XML output from RSP to XSPF. Using [url]server:port/rsp/db/
[/url] and having some success but the call appears to be getting stuck on comments fields that are too long. Can I restrict the RCP call so that it doesn’t look at comments? Ta
08/12/2007 at 3:48 PM #15060sonichouseParticipantThe wiki details how to restrict fields returned.
http://wiki.mt-daapd.org/wiki/XML_Client_API
Best of luck
08/12/2007 at 10:12 PM #15061blammParticipant@sonichouse wrote:
The wiki details how to restrict fields returned.
http://wiki.mt-daapd.org/wiki/XML_Client_API
Best of luck
Thanks. I’m actually looking for RSP stuff. The Wiki only seems to cover DAAP which is much slower.
10/12/2007 at 6:52 AM #15062rpeddeParticipant@blamm wrote:
@sonichouse wrote:
The wiki details how to restrict fields returned.
http://wiki.mt-daapd.org/wiki/XML_Client_API
Best of luck
Thanks. I’m actually looking for RSP stuff. The Wiki only seems to cover DAAP which is much slower.
Okay, I’ve just fixed up the wiki so people can log in with their forum username/password. Hopefully that will stop the spammers.
And I’ve sent you the rsp docs via the email address you registered with. If that’s not the right one, mail me at [email protected].
— Ron
11/12/2007 at 9:36 AM #15063blammParticipantHi.
I have managed to get this working with a bit of XSL and PHP on my local WAMP server to transform the results of an RSP query on playlist 1. I know very little about coding so this is a real lashup (which you can probably tell from my code) so feel free to try and ask questions however I may not be able to provide much support. In fact any suggestions or improvements would be very welcome.
The XSPF works in both VLC and Foobar2000 (with the foo_xspf component). Unfortunately Foo doesnt seem to like playing streamed wavs from Firefly which is a bit of a limitation for those of use who stuff that Firefly has to transcode. VLC works fine but has limited navigation.
Put the following in an file called “rsp2xspf.xsl”. You will need to replace the Firefly server address and port.
http://192.168.2.10:3689/rsp/stream/
Put this in a file called “playlist.php”. You will need to change the port.
<?php
header('Content-type: application/xspf+xml');
header('Content-Disposition: attachment; filename="playlist.xspf"');
$dom = new domDocument();
$dom->load("rsp2xspf.xsl");
$proc = new xsltprocessor;
$xsl = $proc->importStylesheet($dom);
$document = new DomDocument();
$document->load("http://localhost:3689/rsp/db/1?type=browse");
print $proc->transformToXml($document);
?>Put both files in a folder on your web server.
Run the php file from your browser. It should churn for a few mins then ask you to download an XSPF. Open the XSPF in VLC or Foobar2000 and play away.
Its not fast but seems to work.
11/12/2007 at 9:47 AM #15064EVILRipperParticipantJust an idea..
You could use my DaapPlaylistGenerator which can generate a XSPF playlist too, but runs client-side. It requests all songs in DAAP (xdmap-tagged) format, which is more efficient than XSPF/RSP. Especially with lots of songs this makes a big difference in download size.
Of course, this “download size” only matters when attempting to run remote. Local shouldn’t really matter.Next to that, I really encourage you to further experiment with this, to possibly create a better product. Also, you will learn alot from it. ๐
[edit]
Errr.. I read on the XSPF site there coulnd’t be any spaces in it. It should display %20 instead of a space. This really screws up in VLC Media Player. I will remove this soon, as the playlist seems valid with spaces.
[/edit]11/12/2007 at 11:09 AM #15065blammParticipantThanks. I just tried it and it crashes.
The MS error report signature says
AppName: daapplaylistgenerator.exe AppVer: 1.0.0.1 ModName: msvcr80.dll
ModVer: 8.0.50727.762 Offset: 00008a8cI can send you more if you want it.
11/12/2007 at 9:56 PM #15066EVILRipperParticipant@blamm wrote:
Thanks. I just tried it and it crashes.
I can send you more if you want it.
Problem with this program is, is that the crash details have no use at all. I can not trace anywhere in the application where it happened, or what caused it, from the details windows gives you.
Maybe I could add some background debugging output to at least have any idea what’s going on. Possibly this will be available in a new version; Will let you know!
12/12/2007 at 3:31 PM #15067blammParticipant12/12/2007 at 3:55 PM #15068EVILRipperParticipant@blamm wrote:
How would I do that?
Quite simple.
You have seen this link: http://wiki.mt-daapd.org/wiki/XML_Client_API
Well, all those URL’s have a “?output=XML” at the end.
Take it off. ๐ You will get some unreadable bunch of data.The unofficial documentation I found: http://www.tapjam.net/daap/
This explains how it works.Explained in short:
The whole output is in tags.
The first 4 bytes defines what it is going to send.
Example: msrv; This is the response to server-info
The next 4 bytes is the size of the content of msrv.
Next, is the content of the server-info, in x bytes, determined by the second 4 bytes.This is by far the most efficient way firefly supports to send data, because all tags are a max of 8 bytes (4 for identifier, 4 for size).
This was the method used to receive info before firefly was developed, when it was still mt-daapd.
(Please correct me if I’m wrong)Decoding this xdmap-tagged data is quite a challenge, but if you write some effective functions, it’s a piece of cake.
If you want to see it for yourself, try running the following url, and downloading the whole page into a file. Next open it with any Hex Editor. (I use Notepad++) It should contain the data format I just explained. All the other tags can be referred to from the unofficial documentation.
http://:3689/server-info
Happy coding. ๐
-
AuthorPosts
- The forum ‘Add-on Software’ is closed to new topics and replies.