Fallback to `url` if `url_resolved` doesn't work
I was trying to listen to Radio Willy
The metadata returns the following URLs
{
"changeuuid": "671ea5b1-ebe1-11e9-a96c-52543be04c81",
"stationuuid": "671ea5a3-ebe1-11e9-a96c-52543be04c81",
"name": "Willy",
"url": "https://playerservices.streamtheworld.com/api/livestream-redirect/WILLY.mp3",
"url_resolved": "https://21633.live.streamtheworld.com/WILLY.mp3"
}
However, at the time of writing, the resolved URL was no longer correct.
Resolved URL returns a 503
curl --head https://21633.live.streamtheworld.com/WILLY.mp3
HTTP/1.0 503 Service Unavailable
Whereas the URL returns a 302
curl --head https://playerservices.streamtheworld.com/api/livestream-redirect/WILLY.mp3
HTTP/1.1 302 Found
Location: https://20723.live.streamtheworld.com:443/WILLY.mp3
curl --head https://20723.live.streamtheworld.com:443/WILLY.mp3
HTTP/1.0 200 OK
I now have to wait until radio-browser.info, which can take up to 24 hours apparently.
Maybe it's be possible to fall back to the url
field if the url_resolved
URI does not work?
Edited by Felix Häcker