-
Notifications
You must be signed in to change notification settings - Fork 123
chore(media): Don't suppress original exception in ManifestDecodeError #397
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
Merged
tehkillerbee
merged 1 commit into
EbbLabs:main
from
blacklight:396/handle-manifest-decode-errors
Jan 15, 2026
Merged
chore(media): Don't suppress original exception in ManifestDecodeError #397
tehkillerbee
merged 1 commit into
EbbLabs:main
from
blacklight:396/handle-manifest-decode-errors
Jan 15, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The purpose of this commit is to improve error handling when decoding the manifest in the tidalapi library. Instead of suppressing the original exception when a manifest decoding error occurs, it now chains the original exception to the ManifestDecodeError. Reference: EbbLabs#396
blacklight
added a commit
to blacklight/mopidy-tidal
that referenced
this pull request
Jan 15, 2026
…TIDAL group="main" manifests TIDAL appears to have changed the MPEG-DASH MPD manifests returned for some streams to include non-numeric values in `<AdaptationSet group="...">` (e.g. group="main"). The current `mpegdash` parser expects group to be an integer and raises a `ValueError`, which `tidalapi` wraps as `ManifestDecodeError`. This caused `mopidy-tidal` playback to fail and tracks to be marked “not playable”. This PR updates mopidy-tidal’s playback provider to avoid parsing MPD manifests via tidalapi/mpegdash. For MPD manifests we only need to persist the MPD XML and return a `file://` URI, so parsing is unnecessary. **Root cause** - [`tidalapi.StreamManifest`](https://github.com/EbbLabs/python-tidal/blob/08742362ee8cef7df1362387cef60c2846aa84ee/tidalapi/media.py#L644) → [`DashInfo.from_mpd()`](https://github.com/EbbLabs/python-tidal/blob/08742362ee8cef7df1362387cef60c2846aa84ee/tidalapi/media.py#L770) → `mpegdash` parser - New MPD contains: `<AdaptationSet ... group="main" ...>` - [`mpegdash` tries to parse group as int](https://github.com/sangwonl/python-mpegdash/blob/48b52122cdbcaebe1804b79f77d05dfc1ce32900/mpegdash/nodes.py#L782) → `ValueError` → `tidalapi.exceptions.ManifestDecodeError` - Mopidy logs: backend exception + _Track is not playable_ **Changes** - **MPD path** (`ManifestMimeType.MPD`) - Stop calling `stream.get_stream_manifest()` (this triggers MPD parsing and the crash) - Use `stream.get_manifest_data()` to fetch raw MPD XML - Write the MPD to `manifest.mpd` in the extension cache directory - Return `file://…/manifest.mpd` for playback (same end result as before, but without parsing) - **BTS path** (ManifestMimeType.BTS) - Keep existing behavior using stream.get_stream_manifest() **Why this is safe** mopidy-tidal already ultimately plays MPD by writing it to disk and handing Mopidy a `file://` URI. The parsed MPD data from tidalapi wasn’t required for playback logic here; it was effectively only used for logging (codecs). Closes: EbbLabs/python-tidal#397
This was referenced Jan 15, 2026
Collaborator
Author
|
@tehkillerbee sorry, this was mistakenly closed through the other PR 🙂 |
tehkillerbee
approved these changes
Jan 15, 2026
YutongGu
pushed a commit
to enigmae/mopidy-tidal
that referenced
this pull request
Jan 22, 2026
…TIDAL group="main" manifests TIDAL appears to have changed the MPEG-DASH MPD manifests returned for some streams to include non-numeric values in `<AdaptationSet group="...">` (e.g. group="main"). The current `mpegdash` parser expects group to be an integer and raises a `ValueError`, which `tidalapi` wraps as `ManifestDecodeError`. This caused `mopidy-tidal` playback to fail and tracks to be marked “not playable”. This PR updates mopidy-tidal’s playback provider to avoid parsing MPD manifests via tidalapi/mpegdash. For MPD manifests we only need to persist the MPD XML and return a `file://` URI, so parsing is unnecessary. **Root cause** - [`tidalapi.StreamManifest`](https://github.com/EbbLabs/python-tidal/blob/08742362ee8cef7df1362387cef60c2846aa84ee/tidalapi/media.py#L644) → [`DashInfo.from_mpd()`](https://github.com/EbbLabs/python-tidal/blob/08742362ee8cef7df1362387cef60c2846aa84ee/tidalapi/media.py#L770) → `mpegdash` parser - New MPD contains: `<AdaptationSet ... group="main" ...>` - [`mpegdash` tries to parse group as int](https://github.com/sangwonl/python-mpegdash/blob/48b52122cdbcaebe1804b79f77d05dfc1ce32900/mpegdash/nodes.py#L782) → `ValueError` → `tidalapi.exceptions.ManifestDecodeError` - Mopidy logs: backend exception + _Track is not playable_ **Changes** - **MPD path** (`ManifestMimeType.MPD`) - Stop calling `stream.get_stream_manifest()` (this triggers MPD parsing and the crash) - Use `stream.get_manifest_data()` to fetch raw MPD XML - Write the MPD to `manifest.mpd` in the extension cache directory - Return `file://…/manifest.mpd` for playback (same end result as before, but without parsing) - **BTS path** (ManifestMimeType.BTS) - Keep existing behavior using stream.get_stream_manifest() **Why this is safe** mopidy-tidal already ultimately plays MPD by writing it to disk and handing Mopidy a `file://` URI. The parsed MPD data from tidalapi wasn’t required for playback logic here; it was effectively only used for logging (codecs). Closes: EbbLabs/python-tidal#397
enigmae
pushed a commit
to enigmae/mopidy-tidal
that referenced
this pull request
Jan 22, 2026
…TIDAL group="main" manifests (#4) TIDAL appears to have changed the MPEG-DASH MPD manifests returned for some streams to include non-numeric values in `<AdaptationSet group="...">` (e.g. group="main"). The current `mpegdash` parser expects group to be an integer and raises a `ValueError`, which `tidalapi` wraps as `ManifestDecodeError`. This caused `mopidy-tidal` playback to fail and tracks to be marked “not playable”. This PR updates mopidy-tidal’s playback provider to avoid parsing MPD manifests via tidalapi/mpegdash. For MPD manifests we only need to persist the MPD XML and return a `file://` URI, so parsing is unnecessary. **Root cause** - [`tidalapi.StreamManifest`](https://github.com/EbbLabs/python-tidal/blob/08742362ee8cef7df1362387cef60c2846aa84ee/tidalapi/media.py#L644) → [`DashInfo.from_mpd()`](https://github.com/EbbLabs/python-tidal/blob/08742362ee8cef7df1362387cef60c2846aa84ee/tidalapi/media.py#L770) → `mpegdash` parser - New MPD contains: `<AdaptationSet ... group="main" ...>` - [`mpegdash` tries to parse group as int](https://github.com/sangwonl/python-mpegdash/blob/48b52122cdbcaebe1804b79f77d05dfc1ce32900/mpegdash/nodes.py#L782) → `ValueError` → `tidalapi.exceptions.ManifestDecodeError` - Mopidy logs: backend exception + _Track is not playable_ **Changes** - **MPD path** (`ManifestMimeType.MPD`) - Stop calling `stream.get_stream_manifest()` (this triggers MPD parsing and the crash) - Use `stream.get_manifest_data()` to fetch raw MPD XML - Write the MPD to `manifest.mpd` in the extension cache directory - Return `file://…/manifest.mpd` for playback (same end result as before, but without parsing) - **BTS path** (ManifestMimeType.BTS) - Keep existing behavior using stream.get_stream_manifest() **Why this is safe** mopidy-tidal already ultimately plays MPD by writing it to disk and handing Mopidy a `file://` URI. The parsed MPD data from tidalapi wasn’t required for playback logic here; it was effectively only used for logging (codecs). Closes: EbbLabs/python-tidal#397 Co-authored-by: Fabio Manganiello <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The purpose of this commit is to improve error handling when decoding the manifest in the tidalapi library.
Instead of suppressing the original exception when a manifest decoding error occurs, it now chains the original exception to the ManifestDecodeError.
Reference: #396