Re: Creating my first audio plugin: Melodice integration

Michael Herger <slim-b/[email protected]> Wed, 16 Nov 2022 07:01:01 +0100
Newsgroups gmane.music.equipment.slimdevices.devel
Message-ID <[email protected]>
> https://wiki.slimdevices.com/index.php/PluginBuilder.html is what I
> intend to use as the basis

Unfortunately this quite a bit dated. I'd rather start based on 
Slim::Plugin::OPMLBased. This base class provides easy ways to create 
the navigation menus. But you'll have to learn from code doing so...

The good news is there already is a Youtube plugin which should handle 
the hard part of getting playback of Youtube videos. From what I read 
this is painful. So be happy you don't have to deal with it :-).

All you might have to do is get the playlist data from melodice, then 
convert it into something the YT plugin understands (might be URLs like 
youtube://some-identifier), and queue up those tracks.

> This is the site, its very basic so I hope that makes it easier to work
> with https://melodice.org

I'd ask them whether they have an API. Because parsing HTML is ugly and 
prone to errors. Though they seem to include the required data as a 
JavaScript object in the code. Eg. I found this for "qwirkle":

songs = [
     {
         'iid': '39676',
         'eid': 'eEYDnsLUHCA',
         'title': 'Though the Stars Still Stay Out',
     },{
         'iid': '10079',
         'eid': 'toXNVbvFXyk',
         'title': '&quot;Resonant Chamber&quot; - Animusic.com',
     },{
         'iid': '10082',
         'eid': 'M6r4pAqOBDY',
         'title': 'Animusic HD - Fiber Bundles (1080p)',
     },{
         'iid': '10081',
         'eid': 'YOQJxRCCpw8',
         'title': 'Animusic HD- Pogo Sticks (1080p)',
     },{
         'iid': '10084',
         'eid': 'Cgt4DEBQy50',
         'title': 'Animusic - Aqua Harp',
     },{
         'iid': '10085',
         'eid': 'OROAGNbsikQ',
         'title': 'Animusic - Acoustic Curves',
     },{
         'iid': '10080',
         'eid': 'hyCIpKAIFyo',
         'title': '&quot;Pipe Dream&quot; - Animusic.com',
     },
];

But as I said: an API would be much better and robust to use.