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

Podcasts on external URL's don't load #818

Open
benpye opened this issue Jul 2, 2021 · 12 comments
Open

Podcasts on external URL's don't load #818

benpye opened this issue Jul 2, 2021 · 12 comments

Comments

@benpye
Copy link

benpye commented Jul 2, 2021

It looks like Spotify have once again broken podcasts with librespot. I have tested with the latest commit from the dev branch ( b519a4a ) and it still reproduces. Playing a standard track works fine, but attempting to play the latest episode of The Skewer fails, if I begin playing on my laptop then the librespot device shows as 'Unavailable to control'. If I am currently playing a track and then try to play the podcast, I see the following in the verbose log:

[2021-07-02T00:58:48Z DEBUG librespot_connect::spirc] kMessageTypeLoad "<redacted>" 315b822369766c8f6dad5851a974166a082e54cf 1689891374 1625187525412 kPlayStatusStop
[2021-07-02T00:58:48Z DEBUG librespot_connect::spirc] State: context_uri: "spotify:episode:71GqrzfNxk42xod8TxFFqk" index: 4294967295 position_ms: 0 status: kPlayStatusStop position_measured_at: 1625187528631 context_description: "The Skewer" shuffle: false repeat: false playing_from_fallback: true
[2021-07-02T00:58:48Z DEBUG librespot_connect::spirc] Frame has 0 tracks
[2021-07-02T00:58:48Z INFO  librespot_connect::spirc] No more tracks left in queue
[2021-07-02T00:58:48Z TRACE librespot_connect::spirc] Sending status to server: [kPlayStatusStop]
[2021-07-02T00:58:48Z DEBUG librespot_playback::player] command=Stop
[2021-07-02T00:58:48Z TRACE librespot_playback::player] == Stopping sink ==
@roderickvd
Copy link
Member

This may sound silly but as I don't listen to podcasts myself:
did it work before and if so, on which version?

@michaelherger
Copy link
Contributor

My application is based on librespot 0.2.0, and it's playing podcasts just fine. But The Skewer indeed would not play. This likely is more of a problem with how the BBC (which are well known to change things often, and apply strong geo fencing) is streaming their podcasts. Or they're using codec which is not supported by librespot.

FWIW: if I listen to that podcast on Spotify directly I'm getting an announcement about me being outside the UK.

@roderickvd
Copy link
Member

That's a good catch, as I'm working on the new Spotify API I haven't seen any proper handling of geofencing errors yet. Is that the root of this issue? If so then we can update the issue description to match and track it for future implementation.

@michaelherger
Copy link
Contributor

I don't know whether it's the root, or whether they simply are using a codec we can't handle yet. AFAIK not all podcasts are sent using the same Ogg based codec as regular streams. But there are people who know better than I do.

@ashthespy
Copy link
Member

ashthespy commented Jul 2, 2021

I pulled some info out using Mercury - they are serving a mp3 file as quite a few other podcasts :-(

{
  "gid": "e6e3fd3712235507a2977726d152506c",
  "name": "Episode 5",
  "duration": 895000,
  "description": "The week’s biggest stories like you’ve never heard them before. The news, remixed as a twisted comedy treat. Jon Holmes presents the multi-award winning The Skewer. Headphones on.  This week - Hancock’s Half Hour, Fatal Matt-action, and The Death of Stalin – sorry – Starmer.  The multi-award winning, 'dizzying, dazzling, haunting and moving' satirical comedy returns to twist itself into these turbulent times.  With contributions from brand new and diverse audio talent, The Skewer is the sound the abyss makes as it stares back at you through your ears.  'A kind of concept album made of music and news. There's simply nothing else like it.'  AWARDS Gold Winner 2021 Radio Academy Awards (Best Comedy) Silver Winner 2021 Radio Academy Awards (Best New Show) BBC Audio and Drama Awards 2021 Gold winner  British Podcast Awards 2021 Nominee New York Festival Gold Winner 2020 Audio Production Awards Gold Winner 2020 British Podcast Awards 2020 Winner  Audio Production Awards 2019 Winner Winner (Sound Design) Audio Production Awards 2020 BBC Radio and Music Awards 2020 Nominee Chortle Awards Nominee 2020   Producer: Jon Holmes An Unusual production for BBC Radio 4",
  "publish_time": {
    "year": 2021,
    "month": 7,
    "day": 1,
    "hour": 8,
    "minute": 47
  },
  "cover_image": {
    "image": [{
      "file_id": "ab6765630000f68d6a0db3d51b9aba38d55a6da1",
      "size": "SMALL",
      "width": 64,
      "height": 64
    }, {
      "file_id": "ab67656300005f1f6a0db3d51b9aba38d55a6da1",
      "size": "DEFAULT",
      "width": 300,
      "height": 300
    }, {
      "file_id": "ab6765630000ba8a6a0db3d51b9aba38d55a6da1",
      "size": "LARGE",
      "width": 640,
      "height": 640
    }]
  },
  "language": "en",
  "explicit": true,
  "show": {
    "gid": "6d976e2216404a0f844a55592bac263d",
    "name": "The Skewer"
  },
  "restriction": [{
    "countries_forbidden": "",
    "catalogue_str": ["all", "free", "premium", "shuffle", "commercial"]
  }],
  "interpret_restriction_using_geoip": false,
  "suppress_monetization": false,
  "allow_background_playback": false,
  "external_url": "https://open.live.bbc.co.uk/mediaselector/<snip>/p09n2mrf.mp3",
  "type": "FULL"
}

While there are some hints towards some geo policing, it doesn't seem much different from the country restriction for normal tracks.

I would put this down to not being available as OGG and thus not populating the frame with any GIDs?
If it's indeed just a matter of mp3 #651 might be a good tracking issue for non OGG formats.

@benpye
Copy link
Author

benpye commented Jul 2, 2021

Just to add, I am in Canada, and the regular Spotify client plays the content fine. BBC podcasts and radios should be available outside of the UK.

did it work before and if so, on which version?

I have listened to this podcast before - back in February, and I think I was using librespot then too - but I am not 100% certain.

@roderickvd
Copy link
Member

If you think this is a regression and not linked to geofencing or MP3/AAC's not playing, then it would be very helpful to know which version did play this specific track successfully.

@6i6i
Copy link

6i6i commented Jul 8, 2021

I had the same problem that I couldn't select my librespot player from spotify client on android smartphone when playing a podcast episode. I had to play a song, select to play on librespot player and after that select the podcast episode.

Today I updated to the latest version of librespot and now the problem seems to be gone. I can directly select the librespot player from android smartphone and also spotify web.

@roderickvd
Copy link
Member

I'm closing this for now, but if anyone encounters this then please respond to my request in #818 (comment).

@roderickvd
Copy link
Member

I'm reopening this ticket, because the issue is that we need to stream for an external URL instead of the Spotify servers.

@roderickvd roderickvd reopened this Jan 2, 2022
@roderickvd roderickvd changed the title librespot not usable as Spotify Connect target for podcasts Podcasts on external URL's don't load Jan 2, 2022
@roderickvd roderickvd added new api and removed audio labels Jan 12, 2022
@sashahilton00
Copy link
Member

The external urls are actually used by a few different podcast providers, it's a quirk from the times before Spotify acquired whatever the podcast company was a few years back.

With regards to geofencing, the BBC at least on their videos used to pull a trick where the URL would always return content, so abc123.mp3 was never a 404, but it one had a non-UK IP address, it would substitute in a 30 second video saying the content was region locked. Might be something similar going on here, though I thought BBC audio content was available worldwide...

@roderickvd
Copy link
Member

Spirc V2 frames just don’t contain the URLs. But, when having librespot connected but inactive, playing from an official client, we do see them over the wire.

I tried a bunch of things with regards to the version string and ident frame but just don’t get the URL.

In the end I think we require the dealer first because that protocol seems to be something like spirc v3.

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

6 participants