Report your playing songs to slack!
This script will look for active Chromecasts in your LAN, then report the currently played song to a slack channel of your choosing.
I tested this script with Python >= 3.5. Other versions (3.0 and up) should work, but haven't been tested.
- Have a working Chromecast in your LAN, playing music from your favorite source (Spotify, Soundcloud, ...).
- Create a bot user in your Slack account.
- Install chromecastslack on any computer in your LAN.
- Use the API token (xoxb-a-b) to execute the bot.
git clone [email protected]:sh0oki/chromecastslack.git
cd chromecastslack
pip3 install -r ./requirements.txt
SLACKBOT_TOKEN=xoxb-my-token CHANNEL=musicreactions SLACK_USERNAME=Discobear python3 listener.py
Use your favorite init script to execute the script after restart. CHANNEL and SLACK_USERNAME variables are optional, their default values are shown above.