-
Notifications
You must be signed in to change notification settings - Fork 36
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
why the streaming content-type is wrong ? #94
Comments
I haven't tried the code, but could it be an issue of cutting of the new path too early? Maybe some String does not provide the correct length? My first idea would be to change
into
|
..or -another blind guess- could it be that the String keeps data over the redirect, so that Content-Type: text/html |
I've updated the code, for a better view of the header to the console, and to adapt either HTTP/1.0 or HTTP/1.1 depending of the header received... no change. 1- there is a client.connect/client.print to the radio station, What is surprising me, the same radio provider can deliver either radios in streaming which works fine after on or 2 url redirect, and radios which need something more to connect correctly.... |
It is not a problem of the lengh of the path:
the 2 first temporary paths was working, not the 2 last. |
I'll test the code and double check the station with my own redirect implementation .. this may take a few days ;-) |
After some trouble, I was able to connect with the station using my redirect implementation with the feedback given below. Looks like there are 5 redirects before anything happens.
|
is it the right way to declare a cookie?
with
because this does not solve the "HTTP/1.1 400 Bad request" answer from the server |
I have no idea (yet). Actually I never worked with cookies. Hence I'm as curious about the outcome.. Anyway, I'm going to test the code you posted in the first place. After three tries with my code it's always that the 5th redirect does work, so it should do the same with your code, even without cookies. |
hi @Dr-Dawg here is the code. Thanks
|
I've tried to trace HTTP dialog with https://www.rexswain.com/httpview.html but I have not notice anything special. With Modzilla Firefox, if I delete all cookies and run one "non-working" radio station from a private windows, I first have a timeout error message. Only the very first time. Unfortunately I cannot reproduce this error with the tool above, it is working each time |
hmm, would be easier with the definitions, I take, it's something like
Still, I receive some compiling errors starting with
By the way, it seems that you are definig a String cookie in if( client.available() && !pause ) |
Hi @Dr-Dawg you're right. Here is the full test code for a .ino file:
|
I had to do some minor modifications, in order to make the code work with ESP32 and without WiFiManager.h I also added the following else statement, so you can actually hear music after reading the header
For a 'normal' station there is a header output and music, for Kassara Barikama I got stucked after the 8th header line in the client.readStringUntil command in the following loop:
It's not an infinite loop, it gets stuck in client.readStringUntil('\n'), possibly it reads the mp3 stream that does not provide "\n"? |
Hi all, it is not an issue of the library, but I do not know where to find documentation to solve the issue.
Most of small local radios use redirect url, for instance:
1- Radio Kankan (it is a cityname of Guinea West Africa):
http://stream.zeno.fm//ab9q4v3mb
The console gives:
Request access to: Radio KANKAN
Request access to: stream.zeno.fm:80/ab9q4v3mb
Try to reconnect...
-->HTTP/1.1 302
-->location: http://stream.zenolive.com/ab9q4v3mb?zs=3rXgc_2kRwuG_ScHzZfXSQ
new url fields = stream.zenolive.com + /ab9q4v3mb?zs=3rXgc_2kRwuG_ScHzZfXSQ
-->Access-Control-Allow-Origin: *
-->Location: http://node-29.zeno.fm/ab9q4v3mb?zs=3rXgc_2kRwuG_ScHzZfXSQ&rj-tok=AAABf7urGXYASuMmCX_O1AEP9A&rj-ttl=5
new url fields = node-29.zeno.fm + /ab9q4v3mb?zs=3rXgc_2kRwuG_ScHzZfXSQ&rj-tok=AAABf7urGXYASuMmCX_O1AEP9A&rj-ttl=5
@@>content-type: audio/mpeg
icy-name: -
There are several redirection, however after all the content-type: audio/mpeg appears and the station works fine
2- Kassara Barikama (Bamako Mali):
http://stream.zeno.fm/u5u4gvaxh4duv
The console gives:
Request access to: Kassara Barikama
Request access to: stream.zeno.fm:80/u5u4gvaxh4duv
Try to reconnect...
-->HTTP/1.1 302
-->location: http://stream.zenolive.com/u5u4gvaxh4duv?zs=xEwnpDv8SV2bzd5D7yTBqw
new url fields = stream.zenolive.com + u5u4gvaxh4duv?zs=xEwnpDv8SV2bzd5D7yTBqw
-->Access-Control-Allow-Origin: *
-->Location: http://node-35.zeno.fm/u5u4gvaxh4duv?zs=xEwnpDv8SV2bzd5D7yTBqw&rj-tok=AAABf7uvXJcAUn8ykeWJtSNSQQ&rj-ttl=5
new url fields = node-35.zeno.fm + /u5u4gvaxh4duv?zs=xEwnpDv8SV2bzd5D7yTBqw&rj-tok=AAABf7uvXJcAUn8ykeWJtSNSQQ&rj-ttl=5
-->location: http://stream.zeno.fm/y8sgkhhra3quv?zs=xEwnpDv8SV2bzd5D7yTBqw
new url fields = stream.zeno.fm + /y8sgkhhra3quv?zs=xEwnpDv8SV2bzd5D7yTBqw
@@>Content-length: 90
Cache-Control: no-cache
Connection: close
Content-Type: text/html
400 Bad request
Try to reconnect...
Try to reconnect...
This station - and many others - return a bad content-type. But both stations works fine with a PC and modzilla. So something is missing in the request to access to the url because there is reason it does not work on the ESP8266 webradio example
Here is the code:
} // end of loop
The text was updated successfully, but these errors were encountered: