The existing LMS addon for BBC Sounds can't exactly be copied and pasted but it does demonstrate how to interact with the BBC Sounds API.
https://github.com/expectingtofly/LMS_BBC_Sounds_Plugin
#BBC Sounds Music Provider
1 messages · Page 1 of 1 (latest)
BBC Sounds Music Provider
I just have a few moments and am going back through the general chat and recording meaningful stuff here. Ignore me.
My plan is to take a proper look at https://github.com/music-assistant/server/blob/main/music_assistant/server/providers/tunein/__init__.py and create something similar for bbc sounds. Config items for sounds_username and sounds_password, support the ProviderFeature.LIBRARY_RADIOS and ProviderFeature.BROWSE, add some code to use the credentials to get the cookie and save it if it isn't present or expired, then add code to go get a JWT, parse the station list, and then maybe check back with the LMS code to see how to get it to actually play.
FYI: we also recently updated our development docs a but and now incude a template provider to get started fast. But yeah, looking at e.g. tunein is also good to get the grasps of it
Just ask for help here when you get stuck!
Not sure if you notriced it but we fixed a bug i our HLS stream handling and now all BBC streams work out of the box in MA (e.g. the ones that are on TuneIn)
Just checking in with you. We have some others requesting this so wondering if you have made any progress?
Just pushed beta 17 which includes our own hls streaming engine so (fingers crossed!) this should fix the BBC streams
Hello team. I have a very early version of a working BBC Sounds provider.
I am sure I am missing something obvious not knowing the codebase inside out, but I can't anything that is called in the provider between browse() and then playing the item in the builtin player. I am looking to attach the correct metatdata to the radio object but get_stream_details() doesn't seem to be called?
Ignore the above, I think it was just caching.
This is getting pretty close to a first version, it will just have live radio for now with other features to come later.
I’ll send a PR for review shortly but a few questions/issues @sinful rose:
- with external API changes likely, my initial feeling is to publish the non-MA code as a dependency, any objections to doing this?
- The last piece I’m finishing off is when there is a playing song, update the player metadata to match and return to the station metadata when there isn’t. What’s the cleanest approach here as the stream itself won’t be changing and I’ll need to watch for changes and modify the player/queue directly?
- I’ve had a few issues with caching, both on the e.g. get_radio() and get_stream_details() data, as well as the actual stream jumping between different stations / returning to earlier parts of the stream. Do you have any insight or tips on this or whether it’s related to dev environment etc?
- Yeah just send in a (draft) PR to get early feedback!
- Yes, whenever/if possible try to have a dedicated library that does the actual communication but try to make it async and use a shared aiohttp instance.
- If you want to dynamically update the "in band" data and its not provided by the stream, you can update the streamdata - see the siriusXM provider for exmample
- you'd need to get more details about the cache issue, now its a bit hard to understand what you mean
Perfect, thanks for those.
On the last issue, if I had a bit more to go on I’d open an issue but I’m not sure if it’s working as intended or not given I’m messing around in a dev environment.
E.g. if I make a change to how some of the stream details are displayed, even after a restart, and reload, some of streams I have played previously seem to show the old version whereas unplayed ones show the new one. So it looks like somewhere it’s cached?
I still have no idea what exactly you mean. Maybe specify what you mean exactly or share a screenshot ?
Yeah, I should have started with pictures... E.g. I have commented out the Radio.metadata.description which appears to be used on the details page (sorry if there is a proper term).
If I view a radio I have viewed before, it is still there, if I view one I haven't, it is not there, as expected.
Yeah, that is to be expected. Your data gets added into the db
You can use the contextmenu top right to refresh the item to enforce a full fetch of data from your provider and overwrite db info
Ah, that's incredibly obvious now you've pointed it out! I was trying to achieve the same thing with 'Syncronise now' on the provider, thanks for saving me many more hours
I’ve started the initial foray into the VOD functionality which is still served as HLS/dash. FFmpeg supports seeking fine, but I’m hitting a block trying to show the duration and seeking bar in the interface as it looks like they’re disabled for streams.
I’m not averse to writing a get_audio_stream(), but feels like a HLS with a known length must have been tackled before but I could spot it in GitHub.
Did you mark the media type as track or episode ?
And set a duration ?
Also, in the streamdetails you need to provide if the stream is seekable
Yeah I've tried every variation of media type, seek parameters, duration etc but nothing seems to have worked. I am playing to the web-based player if that's linked at all