Edzelf / ESP32-Radio

Internet radio based on ESP32, VS1053 and a TFT screen.
GNU General Public License v3.0
979 stars 229 forks source link

"HTTP/1.0 302 Found" or "HTTP/1.1 302 Moved Temporarily" server response #454

Open ArturSchTT opened 3 years ago

ArturSchTT commented 3 years ago

I'm a newbie, so forgive me if I'm talking about the obvious.

First, I'd like to thank Edzelf for a great job.

1. However, I have a request, if possible, to make the internet radio project as simple as possible, without additional functionalities (WiFi search, SD support, HTTP / MQTT, etc.), but only audio stream reception, delivery to the MP3 module and presentation of ICY information , Title / Artist to Serial or Display. The current design is too complex to learn and design my own. ( I get the message: "Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled." when i run it.).

2. There are two radios in our country that broadcast only via the Internet. In both cases, given addresses dynamically redirect to different cloud servers: // https://stream.rcs.revma.com/an1ugyygzk8uv (radio357.pl) // https://stream.rcs.revma.com/ypqt40u0x1zuv (Radio Nowy Swiat)

When trying to connect to officially given addresses, we get an HTTP 302 response instead of 200. The information about the new stream location appears then (example):

//HTTP/1.0 302 Found // // Location: http://n06a-eu.rcs.revma.com/an1ugyygzk8uv?rj-ttl=5&rj-tok=AAABeGVGJpsAi2T73-1H5g7hAQ // // Content-Length: 0 // // Connection: close // // Set-Cookie: rj-listener-cookie = 1lgdbq9wr69e7; Domain = revma.com

I tried to make a second connection in response to HTTP 302, but I am not getting an audio stream after connecting the address given in LOCATION (when I copy/paste URL from "Location" to first connection, it works fine).

How do I react to responses from the server other than "HTTP 200", eg 404 or 500, especially 302 ?