Open NonaSuomy opened 7 years ago
Hi, sorry but I did not understand how to use the script, could you make a practical example? Thanks Ezio
@desadsea Information Added to First Comment!
@desadsea I have to thank you, I clicked on your name and you had a fork repository for Esp-radio with Arduino, been hacking away at it and got it loaded, radio stations stream flawlessly, where I couldn't get Ka-Radio to stream anything over 24Kbps. It does 320kbps@160Mhz 256kbps@80Mhz, Also, it uses no EXT RAM just a Ring Buffer. Guess I will be switching over to it for now until I find an issue with it that I can't solve like stuttering with Ka-Radio Issue #24. Will have to try this script with it as well :+1: Edit: Simple change to get it working with it just change the word "instant" to "station" and it works w00t! Stream no longer drops out randomly seems to sound less tinny for some reason. Looks like it has an MQTT function will have to check that out as my house automation is MQTT based :smile_cat: GIST for esp-radio change
@NonaSuomy Thank you for having responded, and helped me to figure out how Python script works, As soon as I have the time I want to try, with regard to the esp with arduino, it's not my project I put it on githbub and how would you like to try it, thank you again for your kindness Ezio.
Did an OpenHAB mod for ESP-Radio
And integrated the xml parser into ESP-Radio for IHeartRadio
What is the interest of streamtheworld?
Le 04/05/2017 à 07:24, NonaSuomy a écrit :
Did an OpenHAB mod for ESP-Radio https://github.com/Edzelf/Esp-radio/issues/77
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/karawin/Ka-Radio/issues/25#issuecomment-299099335, or mute the thread https://github.com/notifications/unsubscribe-auth/AHQrB8n2OdXzGyYdg6YvdJxKvUFJnMlIks5r2WEXgaJpZM4M1IXF.
Just to note the parser I did was included into the main branch of ESP-Radio now for anyone interested presets look like ihr/CIMXFM.
StreamTheWorld consumes local radio station content and then they rebranded the site as iHeartRadio.
Some people enjoy local radio content stations for stuff relative to them or feels of nostalgia.
Send a radio station to your Ka-Radio player: GIST
Simple script, at the top of the script is the usage example, basically find a radio station on iheartradio:
iheartradio station list USA iheartradio iheartradio Canada
Look at the source code of the iheartradio page (click on song history will help a bit) you will find things like this in it:
view-source:http://www.iheartradio.ca/all-stations/7.13793734?mode=history
This is what we want:
IHR_TRAN is the callsign for the station you want to play. (Trancid)
Another stations callsign CIMXFM etc.
This is the radio station we are grabbing below from iheartradio 89x "CIMXFM"
Make sure you have python2 and curl installed on the system you are sending the station from, download the script to a file on that device, then type the command, I named the script streamtheworldka.py, so type on the command line:
First, test with the call sign above/below make sure it is all in CAPS as I know that one works (may not work outside of Canada), the hard part would be finding how they named the call sign for the station you want, and some may be location locked so be aware. Also add FM/AM on the end of the call sign or the script will complain "Callsign is missing FM, AM".
The script then tells the website to give us the ShoutCast stream URL for audio stream compatibility purposes with _SC.
The script is grabbing the stream URL that is a randomly encoded string of characters for that station you want, then send the URL to the ESP8266.
The script requests a URL like this: http://playerservices.streamtheworld.com/api/livestream?version=1.5&mount=CIMXFM&lang=en
Then it sends back an XML which we extract the values from:
The script extracts,
Random generated IP: 18853.live.streamtheworld.com Port: 80, 3690, etc MountPoint(callsign): CIMXFM
I noticed that there was ShoutCast compatibility in the XML which it shows to add "_CS" onto the mount point: CIMXFMAAC_CS
Then the script sends this data gathered from the XML to Ka-Radio device:
curl http://10.13.37.65/?instant="18853.live.streamtheworld.com:3690/CIMXFMAAC_SC"
Then Ka-Radio should start playing the stream.
If you attach a serial cable to Ka-Radio you should be able to debug what URL is getting passed to it, to see if the station is getting sent properly.
Successful run should look like this on the serial line:
Someone with FreeRTOS skills could probably bake this into Ka-Radio, if there was enough memory, but probably best if it was a plugin of sorts, as they could change the way their API works at any moment. Have a hardware button that always generates the random URL and play's your favorite radio station.
Hope it helps!