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

Fix: Reauthenticate with SiriusXM when playing a station #1789

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

btoconnor
Copy link
Contributor

This attempts to address music-assistant/hass-music-assistant#3165

As stated on the issue:
I think the problem is that we authenticate with SiriusXM when the server starts up so that we can confirm authentication details, and load the list of channels. However, the sxm session expires frequently. By the time the user attempts to play a station, there's a decent chance that the session is expired. The sxm-client will attempt to re-authenticate automatically, but by the time this happens, there's a decent chance ffmpeg will raise a TimeoutError.

This patch makes it so that the code preemptively attempts to re-authenticate with SiriusXM before handing over the m3u8 playlist, ensuring that there is a valid session. It's possible this will cause a slight delay to start the feed, but in my (limited) testing, this was fine, and still preferable to the TimeoutError being raised.

@OzGav
Copy link
Contributor

OzGav commented Nov 24, 2024

@btoconnor Could you check this as pytest is failing?

@btoconnor
Copy link
Contributor Author

Looks like those are failing on jellyfin tests

@OzGav
Copy link
Contributor

OzGav commented Nov 24, 2024

Yeah sorry I only glanced at it. Doesn’t seem your problem!

@btoconnor
Copy link
Contributor Author

@OzGav anyway to rerun these tests? I can't seem to find anything on my end. I can push up a dummy commit if necessary, or I can just wait and do nothing 🙃

@OzGav
Copy link
Contributor

OzGav commented Nov 25, 2024

Yeah I think wait for Marcel

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

Successfully merging this pull request may close these issues.

2 participants