librespot-java icon indicating copy to clipboard operation
librespot-java copied to clipboard

Support new format for Expires url parameter in CDN Manager

Open tagdara opened this issue 2 years ago • 0 comments

In the last few days I noticed a number of track crashes or skips and discovered errors in the log similar to this:

2023-10-19 22:39:36,593 WARN CdnManager:186 - Couldn't extract expiration, invalid parameter in CDN url: https://audio4-gm-fb.spotifycdn.com/audio/b2...43?Expires=1697866776~FullPath~hmac=_Pl...t0=

Supported formats previously came in two flavors:

  • one where the expires value was just sent as part of the name of the url parameter: https://audio4-fa.scdn.co/audio/09...51?1697904085_be...9L-IF-tO...bU=

  • one where token was used and exp was parsed out: https://audio4-ak-spotify-com.akamaized.net/audio/0f...cf?token=exp=1697904087~hmac=80...99

I added support for this new Expires parameter into setUrl in the CDN Manager, matching the format of the code which checks the token version

tagdara avatar Oct 20 '23 17:10 tagdara