Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BBC Radio Two on BBC Sounds Cast No Longer Working #101151

Open
DrMikeyS opened this issue Sep 30, 2023 · 31 comments
Open

BBC Radio Two on BBC Sounds Cast No Longer Working #101151

DrMikeyS opened this issue Sep 30, 2023 · 31 comments
Assignees

Comments

@DrMikeyS
Copy link

DrMikeyS commented Sep 30, 2023

The problem

Using cast and BBC Sounds works fine for most radio stations include Radio 1 and Radio 4, but the radio 2 stream fails to play.

For example, the below code does not play any audio stream:
service: media_player.play_media data: media_content_type: cast media_content_id: ' { "app_name": "bbcsounds", "media_id": "bbc_radio_two", "is_live": true }' target: device_id: a052b41711e2f011c18ba32c7f9f107b

Whereas this works fine:
service: media_player.play_media data: media_content_type: cast media_content_id: ' { "app_name": "bbcsounds", "media_id": "bbc_radio_one", "is_live": true }' target: device_id: a052b41711e2f011c18ba32c7f9f107b

It is mentioned in some other posts in tangential matters that the BBC is standing down the mp3 streams this year. I don't know if this might be related?

What version of Home Assistant Core has the issue?

2023.9.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

cast

Link to integration documentation on our website

https://www.home-assistant.io/integrations/cast/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @emontnemery, mind taking a look at this issue as it has been labeled with an integration (cast) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of cast can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign cast Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


cast documentation
cast source
(message by IssueLinks)

@DrMikeyS
Copy link
Author

Here is a workaround:
service: media_player.play_media data: media_content_type: audio media_content_id: >- http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/bbc_radio_two.m3u8 target: device_id: b0527cab28db6d3a4e041787031a3a89

@jbeardon
Copy link

jbeardon commented Oct 1, 2023

Just a +1 to this.
Radio 1 is working OK.

Logger: homeassistant.components.cast.media_player
Source: components/cast/media_player.py:378
Integration: Google Cast (documentation, issues)
First occurred: 30 September 2023 at 13:59:00 (7 occurrences)
Last logged: 30 September 2023 at 14:21:27

Failed to cast media bbc_radio_two. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

@gavink2
Copy link

gavink2 commented Oct 5, 2023

Now failing for Radios 1, 2 & 4:

Logger: homeassistant.components.cast.media_player
Source: components/cast/media_player.py:378
Integration: Google Cast (documentation, issues)
First occurred: 07:30:09 (7 occurrences)
Last logged: 09:36:13

Failed to cast media bbc_radio_fourfm. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address
Failed to cast media bbc_radio_one. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address
Failed to cast media bbc_radio_two. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

@DrMikeyS
Copy link
Author

DrMikeyS commented Oct 5, 2023

The new stream links for the various radio stations are available in this post. (see later post for clarity)

I've had a look at the code but I can't see how it currently handles BBC Sounds streams to update the links. Hopefully someone will!

In the meantime, here is the workaround:
service: media_player.play_media
data: media_content_type: audio
media_content_id: >- [m3u8 LINK FOR THE RELEVANT STREAM FROM ABOVE POST]
target: device_id: [YOUR DEVICE]

@DrMikeyS DrMikeyS closed this as completed Oct 5, 2023
@DrMikeyS DrMikeyS reopened this Oct 5, 2023
@Hobbit44
Copy link

Hobbit44 commented Oct 6, 2023

Still getting the error when using the above example? Have they changed the URLs again?

Failed to cast media http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_norfolk/bbc_radio_norfolk.isml/bbc_radio_norfolk-audio%3d48000.norewind.m3u8. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

EDIT:
The following url works with the audio cast

http://a.files.bbci.co.uk/ms6/live/3441A116-B12E-4D2F-ACA8-C1984642FA4B/audio/simulcast/hls/uk/pc_hd_abr_v2/cf/bbc_radio_one.m3u8

@DrMikeyS
Copy link
Author

DrMikeyS commented Oct 7, 2023

Good spot @Hobbit44

The workaround now is:

service: media_player.play_media
data: media_content_type: audio
media_content_id: >- http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/[BBC STATION NAME].m3u8
target: device_id: [YOUR DEVICE]

BBC STATION NAME should be of the format:
bbc_radio_one
bbc_radio_fourfm
bbc_radio_norfolk
etc.

@orbsmiv
Copy link

orbsmiv commented Oct 9, 2023

For info, here's a link to the announcement from the BBC regarding the changes to their streaming services: https://www.bbc.co.uk/sounds/help/questions/recent-changes-to-bbc-sounds/radio-changes

@dunxd
Copy link

dunxd commented Oct 11, 2023

I think the issue is somewhere in /home-assistant-libs/pychromecast which has a bbcsounds controller. I logged an issue there. I think this is caused by BBC now requiring sign in to Sounds in order to play media through it.

Note however that the method using media_content_type:audio and the URLs above works better for me. With media_content_type:cast and the app_name: bbcsounds the stream would load in a paused state, and I would need to click play to get it playing, whereas the method above goes straight to playback. I hope BBC doesn't kill off all the URLs.

I don't have a Google smart speaker, but it doesn't look like it is currently required to set them up with a BBC account in order to listen through them, so perhaps there is some hope this will last a bit longer.

@blawford
Copy link
Contributor

I have a PR in the pychromecast library for this, cause was BBC Sounds updating their app_id. Once it is merged I will up the version in core and submit a PR.

@jbeardon
Copy link

Seems like the workaround URLs have been changed or removed as of this morning (at least for R2 and R1).

@orbsmiv
Copy link

orbsmiv commented Oct 26, 2023

Seems like the workaround URLs have been changed or removed as of this morning (at least for R2 and R1).

@jbeardon yes, it looks like the following PR needs to be accepted for this to work reliably going forwards:
home-assistant-libs/pychromecast#753

@jbeardon
Copy link

Seems like the workaround URLs have been changed or removed as of this morning (at least for R2 and R1).

@jbeardon yes, it looks like the following PR needs to be accepted for this to work reliably going forwards: home-assistant-libs/pychromecast#753

Thanks - I've bumped the PR as well.

@dunxd
Copy link

dunxd commented Oct 26, 2023

Radio 6 Music working ok via the URL and media_content_type:audio this morning. Will check again tomorrow.

In the long run, BBC has stated it's intent to restrict access to all its radio station streams (except World Service) to logged in users. It's only a matter of time. And when that happens, it is annoying that any changes they make to app_id might require a several weeks long PR process here before casting is possible.

@jbeardon
Copy link

Personally, I wouldn't mind having a way to store login details for the service.

@DrMikeyS
Copy link
Author

Thanks for bumping the PR. Any ideas how we can get updated workaround URLs?

@jbeardon
Copy link

jbeardon commented Oct 26, 2023

Thanks for bumping the PR. Any ideas how we can get updated workaround URLs?

From what I have seen and read, BBC are removing all links to services that do not require a sign in.

I can 'sort of' understand why but it's still a PITA. Most of the scenarios I am using Cast in are using Chromecast Audios connected to external amps and speakers - I'm moving over to Echo Flex's as they natively use the BBC Sounds service. You could probably achieve the same using the Google Home SDK integration but I can't be bothered with all the faff with developer accounts/keys etc.

@dunxd
Copy link

dunxd commented Oct 26, 2023

Note that BBC made a specific announcement about stopping the Shoutcast service, and only providing HLS and DASH streams from this year. I would not expect them to kill all streaming URLs without an official announcement and prior warning - for example they made regular announcements on the ending of the Shoutcast streams on the streams themselves for a year before they turned them off. I haven't heard this on the HLS URLs so I would not assume they are killing them. They might change the URL format, or even have technical hitches.

Still, one day we might need a BBC Sounds integration much like we do with Spotify.

@jbeardon
Copy link

Note that BBC made a specific announcement about stopping the Shoutcast service, and only providing HLS and DASH streams from this year. I would not expect them to kill all streaming URLs without an official announcement and prior warning - for example they made regular announcements on the ending of the Shoutcast streams on the streams themselves for a year before they turned them off. I haven't heard this on the HLS URLs so I would not assume they are killing them. They might change the URL format, or even have technical hitches.

Still, one day we might need a BBC Sounds integration much like we do with Spotify.

I can see no announcement for dropping or changing the Simulcast links (which are the ones we have been using as a work-around). These are not ones that were dropping in announcements.

@dunxd
Copy link

dunxd commented Oct 26, 2023

I found another announcement regarding protected HLS and DASH streams only available to distributors with agreements with the BBC.

This thread might have some useful info. Also, this one.

It would be nice to see if applying the app_id change in the PR resolves the issue for now.

@dunxd
Copy link

dunxd commented Oct 27, 2023

I found a BBC Sounds Plugin for Logitech Media Center that implements login with a BBC Sounds account and a long lived token. It is written in Perl, so not immediately transferable to Home Assistant, but at least shows some of the mechanisms that might be used for a BBC Sounds integration. I'll keep an eye on it to see whether it shows any signs of breaking as BBC make changes.

@spattinson
Copy link

I found a BBC Sounds Plugin for Logitech Media Center that implements login with a BBC Sounds account and a long lived token. It is written in Perl, so not immediately transferable to Home Assistant, but at least shows some of the mechanisms that might be used for a BBC Sounds integration. I'll keep an eye on it to see whether it shows any signs of breaking as BBC make changes.

That plugin for LMS requires a login to work. The BbcSounds controller in pychromecast attempts to play the media via the web version of BBC sounds, eg https://www.bbc.co.uk/sounds/play/live:bbc_6music - this is where the "media_id" is used for play_media service, bbc_6music in this case. I have changed my local pychromecast as per home-assistant-libs/pychromecast#753 and it still doesn't work. That web page requires a login to work now too, try opening it in an incognito tab and it pops up a login prompt. IDK if there is any way to embed your login credentials in the url?

The only unauthenticated streams still up are those in the format http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_6music/bbc_6music.isml/bbc_6music-audio%3d96000.norewind.m3u8 and those are unplayable via home assistant/pychromecast. If you open it in vlc it plays and vlc can cast it to a chromecast audio.

@dunxd
Copy link

dunxd commented Oct 27, 2023

It does seem that login free BBC Radio is gone or imminently so. If this is true then am I right in thinking that an integration that supports credential storage will be required? If so, would this be instead of pychromecast or something that sent an authenticated/login specific URL to pychromecast for playing from Chromecast devices. How does the Spotify integration do it?

@spattinson
Copy link

spattinson commented Oct 27, 2023

Posted elsewhere is this that still works for casting http://lsn.to/B6M for 6 music and http://lsn.to/B4D for radio 4, just open in a web browser and copy the desired bitrate link eg 320k 6music is http://lstn.lv/bbc.m3u8?station=bbc_6music&bitrate=320000.

Its a sorry state of affairs that the BBC have effectively disabled embedded streaming radios wholesale, yet we can use a third party web site that looks like it was developed 20 years ago that has working links today. Oddly enough if you run chrome net export log on lstn.lv you get this:

  | 378060 | HTTP_STREAM_JOB_CONTROLLER | https://lstn.lv/bbc.m3u8?station=bbc_6music&bitrate=320000
  | 378061 | HTTP_STREAM_JOB | https://lstn.lv/
  | 378062 | HTTP_STREAM_JOB | https://lstn.lv/
  | 378063 | QUIC_STREAM_FACTORY_JOB |  
  | 378064 | SSL_CONNECT_JOB | https://lstn.lv <chrome-extension://emnphkkblegpebimobpbekeedfgemhof same_site>
  | 378065 | SOCKET | https://lstn.lv <chrome-extension://emnphkkblegpebimobpbekeedfgemhof same_site>
  | 378066 | HTTP2_SESSION | lstn.lv:443 (DIRECT)
  | 378067 | URL_REQUEST | http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_6music/bbc_6music.isml/bbc_6music-audio%3d320000.norewind.m3u8

So maybe they are doing the necessary stuff for chromecast, CORS?
 

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@blawford
Copy link
Contributor

My PR (that was mentioned above) was merged and this was incorporated into Home Assistant and I tested it as working.

@github-actions github-actions bot removed the stale label Jan 25, 2024
@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@Jilas
Copy link

Jilas commented Apr 26, 2024

I don't know if it was just bad timing, or I'm having a local issues but seems BBC has broken this again.

One of the BBC World Services listed works ok, the rest appear to try to buffer and then go idle. I do recall seeing something about them doing another change to iplayer/sounds, so could well be related. Any fix I suspect is going to break again, unless they approve the platform.

Edit 1: Just noticed I was on 2024.4.3, so updating now and will update this post with results from that).
Edit 2: Checking on my dev box that is up to date and now the freshly upgraded live box, both suffering the same issues, Testing all of them so far only the world services channels (not all) are actually working

@blawford
Copy link
Contributor

Working fine for me, I'm back on 2023.11.3 though and am not in a position to upgrade currently, but I can't see this area of the code changing unless the integration breaks and I do it! 😄

Try my script and see if it works for you?

alias: BBC Radio 1
sequence:
  - service: media_player.play_media
    data:
      media_content_type: cast
      media_content_id: >-
        { "app_name": "bbcsounds", "media_id": "bbc_radio_one", "is_live": true
        }
      extra:
        metadata:
          metadataType: 0
          title: Radio 1
          images:
            - url: >-
                https://sounds.files.bbci.co.uk/2.3.0/networks/bbc_radio_one/background_1280x720.png
    target:
      entity_id:
        - media_player.googlehome5999
mode: single

@Jilas
Copy link

Jilas commented Apr 26, 2024

Try my script and see if it works for you?

Thank you so much, that works for Radio 1,2,3 but of course.. radio 4 is not just "bbc_radio_four" but "bbc_radio_fourfm".

Its working, so the OH will be happy again.

Thank you again. (so definitely a Me thing then,, just strange timing).

@BertrumUK
Copy link

thanks @blawford Your script works fine for me as well. I just need to update all of them when I finish work as its not too easy doing it via an iPad 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests