[PR #1183] [MERGED] Parse expiry timestamp from spotifycdn.com CDN URLs (Fixes #1182) #1269

Closed
opened 2026-02-27 20:01:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/1183
Author: @kingosticks
Created: 6/29/2023
Status: Merged
Merged: 7/4/2023
Merged by: @roderickvd

Base: devHead: fix-parse-expiry


📝 Commits (3)

  • 2625db3 Parse expiry timestamp from spotifycdn.com CDN URLs (Fixes #1182)
  • be8a7a9 Ignore expiry timestamps we can't parse
  • 099aafd Use duration and remove empty strings

📊 Changes

1 file changed (+66 additions, -22 deletions)

View changed files

📝 core/src/cdn_url.rs (+66 -22)

📄 Description

The CDN URLs list now includes spotifycdn.com which has a different format. It was being erroneously interpreted using the scdn.co format and trying to parse non-digit characters as a timestamp.

It was trying to interpret the entire query string of "https://audio-gm-off.spotifycdn.com/audio/4712bc9e47f7feb4ee3450ef2bb545e1d83c3d54?Expires=1688165560FullPathhmac=IIZA28qptl8cuGLq15-SjHKHtLoxzpy_6r_JpAU4MfM=" as a number.

Maybe it would be better to match on the domain? Or at least catch the parse() error and just pretend it's not expiring?


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/librespot-org/librespot/pull/1183 **Author:** [@kingosticks](https://github.com/kingosticks) **Created:** 6/29/2023 **Status:** ✅ Merged **Merged:** 7/4/2023 **Merged by:** [@roderickvd](https://github.com/roderickvd) **Base:** `dev` ← **Head:** `fix-parse-expiry` --- ### 📝 Commits (3) - [`2625db3`](https://github.com/librespot-org/librespot/commit/2625db3d7cac2f4bf28376e4aeb4a7ff38c904ca) Parse expiry timestamp from spotifycdn.com CDN URLs (Fixes #1182) - [`be8a7a9`](https://github.com/librespot-org/librespot/commit/be8a7a936b1506dcb02b70292ef743c1b107458d) Ignore expiry timestamps we can't parse - [`099aafd`](https://github.com/librespot-org/librespot/commit/099aafdce2c34f510dadb57e96565f9ba8d44354) Use duration and remove empty strings ### 📊 Changes **1 file changed** (+66 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `core/src/cdn_url.rs` (+66 -22) </details> ### 📄 Description The CDN URLs list now includes spotifycdn.com which has a different format. It was being erroneously interpreted using the scdn.co format and trying to parse non-digit characters as a timestamp. It was trying to interpret the entire query string of "https://audio-gm-off.spotifycdn.com/audio/4712bc9e47f7feb4ee3450ef2bb545e1d83c3d54?Expires=1688165560~FullPath~hmac=IIZA28qptl8cuGLq15-SjHKHtLoxzpy_6r_JpAU4MfM=" as a number. Maybe it would be better to match on the domain? Or at least catch the `parse()` error and just pretend it's not expiring? --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:01:48 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#1269
No description provided.