Skip to content

Workaround for "Youtube Music playlist stalls on uploaded music" music-assistant/support#4469#3156

Draft
whitty wants to merge 2 commits intomusic-assistant:devfrom
whitty:bugfix/MPRE_stall
Draft

Workaround for "Youtube Music playlist stalls on uploaded music" music-assistant/support#4469#3156
whitty wants to merge 2 commits intomusic-assistant:devfrom
whitty:bugfix/MPRE_stall

Conversation

@whitty
Copy link

@whitty whitty commented Feb 13, 2026

This is a workaround for the "stalling" aspect of music-assistant/support#4469

MA tries to resolve albums providing the prov_album_id of the form FEmusic_library_privately_owned_release_detailb_po_<probably private_letters_and_numbers_id> which triggers an exception in ytmusic.get_album() as it checks that the ID .startswith('MPRE').

The handling of the exception seems to lead to playback stalling in this case. Catching and returning None (presumably like "not found") instead leads to a warning as follows, but playback doesn't stall.

2026-02-13 23:05:25.159 WARNING (MainThread) [music_assistant.music.track] Unable to fetch album details for ytmusic--xxxxxxx://track/JB2LoK_zfD4 - album://FEmusic_library_privately_owned_release_detailb_po_xxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx not found on provider ytmusic--xxxxxxx

This may not resolve the base issues:

  1. Why do we have a providerID for the album that cannot be looked up - has the wrong field been stored somewhere?
  2. Why does reloading MA often allow that album to be played successfully (though I don't see calls to get_album() in that case)

Approach:

I preferred to catch the exception rather than check the prefix, in case ytmusicapi resolves the issue and allows non MPRE prefixes in the future.

Since the Exception is a generic UserError type I specifically check the message and propagate any other exceptions..


Additionally I removed a duplicate lookup rather than expand the try block further.

User uploaded media may resolve a prov_album_id of the form
`FEmusic_library_privately_owned_release_detailb_po_...`
which causes an exception to be thrown by ytmusicapi.get_album().

Return None instead of throwing an otherwise uncaught
exception (#4469) which prevents playback from stalling.
@whitty whitty changed the title Workaround for "Youtube Music playlist stalls on uploaded music" #4469 Workaround for "Youtube Music playlist stalls on uploaded music" music-assistant/support#4469 Feb 13, 2026
@MarvinSchenkel
Copy link
Contributor

I would like to solve the root of the issue rather than implementing an 'except workaround'. Can you let me know what the album id is of your custom uploaded track that is triggering the issue? That might shed some light on this case.

except ytmusicapi.exceptions.YTMusicUserError as e:
if prov_album_id is not None and "must start with MPRE" in str(e):
logging.getLogger("music_assistant").getChild("YouTube Music").debug("ytmusicapi refused to handle prov_album_id: '%s'", prov_album_id)
return None
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note None is not a normal return path for ytm.get_album() there is no obvious "not-found" result

@whitty
Copy link
Author

whitty commented Feb 13, 2026

I would like to solve the root of the issue rather than implementing an 'except workaround'.

Understood. As I've pointed out the None return isn't the same as a "not found"

Can you let me know what the album id is of your custom uploaded track that is triggering the issue?

Can you explain exactly what information you are after?

As described the prov_album_id is a string of the form 'FEmusic_library_privately_owned_release_detailb_po_CP39qciXhNa_LxIUaG90dGVzdCAxMDAgdm9sdW1lIDgaCHRyaXBsZSBqIgNncG0' - I do not know if that is the album ID you are after - I did mention it in the PR description.

I do not know where this value came from - presumably from a query of the youtube api elsewhere and/or stored by MA itself from some source.

@MarvinSchenkel
Copy link
Contributor

That's exactly the info I was after. It looks like YTM internally stores this value as the album id for a track that was manually uploaded. Now of course we cannot link this to any album out there, which ultimately causes this error.

My suggestion is to prevent this value from ever creeping into MA. So instead of failing on a invalid album id in the helpers.py, we could just simply extend this check by checking if the album id is a valid id (e.g. and track_obj["album"]["id"].startswith("MPRE")). This will only add the Album to the track if the id is valid, preventing your album id from ever being synced to MA in the first place.

Copy link
Contributor

@MarvinSchenkel MarvinSchenkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a look at my suggestion and mark this PR 'Ready for review' again once you have made the changes.

@MarvinSchenkel MarvinSchenkel marked this pull request as draft February 16, 2026 08:47
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