Skip to content
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

Headless mode #155

Closed
danboid opened this issue May 12, 2022 · 7 comments
Closed

Headless mode #155

danboid opened this issue May 12, 2022 · 7 comments

Comments

@danboid
Copy link

danboid commented May 12, 2022

I have got a TV box running Armbian that I'd like to turn into an internet radio device. pyradio is very close to being ideal for my purposes but it doesn't seem to have a headless mode yet, which is what I want so that I can use pyradio without having a display attached to my TV box and I'd be able to use it using a infrared remote, pushing buttons to trigger commands to control pyradio.

I'd like to see pyradio gain a new --headless option or similar that would not open the ncurses UI but instead start playing a random station in the background unless the user specifies a specific station. The only headless commands I think I'll need are start playing (random station), skip to random station, adjust volume and stop/quit.

@s-n-g
Copy link
Collaborator

s-n-g commented May 13, 2022

Hi @danboid

So, here's the thing... pyradio just has to be in the foreground for it to function. If put in the background, playback just stops working

Furthermore, it is a tui application; not opening the ncurses UI is impossible, it would mean rewriting the whole thing from scratch...

Having said that, if you think you can run it in a terminal application or a virtual terminal (do you run X?), then we could talk about creating an interface of some kind to control it remotely.

I think I could make it listen to a socket, or read input from a file, or something, instead of wating for keyboard input, but not have it running in the background or without its tui

@danboid
Copy link
Author

danboid commented May 13, 2022

Aha! I thought there might be some such catch but not to worry, I'll easily be able to write want I want with mplayer and a few lines of shell script so feel free to close this if adding this feature is too much work which sounds like its the case. I was unable to find a ready made solution, pyradio was about the closest to fitting the bill but custom script time it is.

I'll update this ticket when I've created my simple headless streaming thing with a link to its repo.

@s-n-g
Copy link
Collaborator

s-n-g commented May 13, 2022

ok then, I'll just close this one for now

Do post the solution you come up with and reopen the issue to have us all informed :)

@s-n-g s-n-g closed this as completed May 13, 2022
@danboid
Copy link
Author

danboid commented May 13, 2022

I will let you know.

What is the largest, recently tested and up-to-date list of internet radio stations in txt/m3u/csv/ods whatever format that you know of? I noticed there is a large list in #39 but it's quite outdated and lots of its links are broken. As a last resort I can filter the working ones from that file if you don't know of a better source?

@s-n-g
Copy link
Collaborator

s-n-g commented May 13, 2022

Yeah, that's the one I have as well...
Quite outdated, but enough to experiment with...
Sorry I cannot be of any more help...

@s-n-g
Copy link
Collaborator

s-n-g commented May 13, 2022

So silly of me!
You can also use this:

curl -L http://de1.api.radio-browser.info/json/stations | json_reformat |less

or this to get the json data in a file

curl -L http://de1.api.radio-browser.info/json/stations > radiobrowser.json

Then you can parse the file (tell me if you need help to do that)

@danboid
Copy link
Author

danboid commented Jun 9, 2022

@s-n-g

I've 'finished' my project:

https://github.com/danboid/TVBIRR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants