This is a lightweight bot script that allows Nightbot commands to post information about songs playing in your local foobar2000 player. It works by simply reading out the players window title (which is customizable in foobar2000) and posting it to the Nightbot API. The bot therefore might also work with other media players that similarly put information in the window title.
To install, you can either clone the repo and install the listed dependencies:
$ git clone https://github.com/TimH96/foobar2000-nightbot-extension
$ cd foobar2000-nightbot-extension
$ pip install -r requirements.txt
$ python __main__.py
Or you can simply download and run the latest executable from the releases page.
The bot will need to be configured upon first execution with the following information:
client_id
andclient_secret
are required to interact with the Nightbot API. You will need to make an application on this page (name itFoobarExtension
or something along those lines, you can leave the redirect URI field empty) and get your client ID and secret from there.output_text
is the text that shows when using the command. Use%win%
as a substitute for the actual information in the window title, for exampleCurrently playing: %win%
. There will be an error if you don't use the%win%
token in your output text.cmd_id
is which command to ultimately change and post the song information to. Simply type in the number corresponding to your desired command from the given list.
After the configuration, simply run the exectuable. Upon each run you will be prompted to select which window to take the information from. If you ever want to change your configuration, you can manually edit the config.json
or delete/move it and reconfigure from scratch. Note that you can also use alternative paths to the config file via the --path
/-p
command line argument.