A userscript and server to update your Slack status with your current YouTube Music/Spotify/SoundCloud track.
an example status:
- Clone this repo:
git clone https://github.com/whirlxd/ytmusic-slack cd ytmusic-slack- Install dependencies:
npm install - Create a
.envfile in the root directory with the following content:
SLACK_USER_TOKEN=xoxp-your-slack-user-token
PORT=8787
EMOJI=:youtube-music: (if your workspace has this emoji)
TEMPLATE=${title} :: ${artist}
MIN_UPDATE_SECONDS=4
PRIVATE_KEY= a secret key for auth b/w script and server
EMOJI_YOUTUBE=:youtube-music:
EMOJI_SPOTIFY=:spotify_logo:
EMOJI_SOUNDCLOUD=:soundcloudnobg:
- Start the server:
node server.js - Install a userscript manager in your browser (e.g., Tampermonkey).
- Create a new userscript and copy the content of
userscript.jsinto it. - Adjust the
SETconstant inuserscript.jsto point to your server (e.g.,http://localhost:8787/now-playing). - Save the userscript and ensure it's enabled on
music.youtube.com // open.spotify.com // soundcloud.com. - Play some music on YouTube Music and watch your Slack status update!
- If you are a teen you can host this - Nest. See this guide I have written.
- Make sure your Slack workspace allows custom status updates via user tokens.
- The userscript checks for the current track every 10 seconds by default. You can adjust this interval in the
INTERVAL_MSconstant inuserscript.js. - The server clears your Slack status when no music is playing or when the track is paused.
- Ensure that your browser and the server can communicate (eg. no firewall blocking, especially in Brave).
- This project is for personal use and may violate YouTube Music's // Spotify's // SoundCloud's or Slack's terms of service. Use at your own risk. idrc
- If need be there are some AI generated docs here - may contain errors.
GNU General Public License. See LICENSE file for details.


