MS3FGX / SomaFM

A simple Python 3.x terminal interface for streaming SomaFM
GNU General Public License v3.0
52 stars 10 forks source link

https vs http #7

Open rustyhodge opened 6 months ago

rustyhodge commented 6 months ago

We have changed the channels.json file to return http: links when called via http:// and https:// links when called via https://somafm.com./channels.json

Rather than re-writing URLs to http for players that don't support https, I would suggest just fetching the http channels.json and maybe offer a configuration flag to enable or disable https.

MS3FGX commented 6 months ago

Awesome, that will let me simplify things greatly. Appreciate the heads up.

MS3FGX commented 6 months ago

This feature has been added as of https://github.com/MS3FGX/SomaFM/commit/3a3ba9cfa8a0620e9fc5256e3b9c55d91f69efc2

Giving the script the -S or --ssl option will cause it to re-download channels.json over HTTPS. From that point on, all stream operations will be done over HTTPS, so you don't need to keep passing the option. If you want to go back to HTTP, you can delete the cache data with -d and then just run the script normally.

As mentioned elsewhere, player support for this is spotty at best. In my personal testing on Linux, the only one that seems to work is mpv. Will test on Windows shortly. I'm going to leave this issue open for a bit to see if anyone has any feedback.