A lightweight Windows application that reads the currently playing song from Spotify and YouTube (in browsers) and writes it to a text file. Perfect for streamers, content creators, or anyone who wants to display or log their currently playing music.
- Monitors Spotify and YouTube in browser windows for song changes
- Supports all major browsers: Chrome, Firefox, Edge, Brave, and Opera
- Writes the current song information to a text file (
current_song.txt) - Updates the file only when the song changes
- Ignores paused state (keeps the last song information)
- Works without requiring Spotify API credentials
- Low resource usage
- No installation needed - single executable file
You can download the latest release from the Releases page.
- Windows operating system
- Spotify desktop application and/or a web browser for YouTube
- Start the Spotify desktop application or open YouTube in a browser
- Run
SpotifySongTracker.exe - The current song information will be written to
current_song.txtin the same directory - Press Ctrl+C in the console window to exit the application
To have the application run automatically when Windows starts:
- Create a shortcut to
SpotifySongTracker.exe - Press
Win+R, typeshell:startupand press Enter - Move the shortcut to the Startup folder that opens
- In OBS, add a Text source
- Select "Read from file" and browse to the
current_song.txtfile - Customize the text appearance as desired
- The text will update automatically when the song changes in Spotify or YouTube
The application:
- Locates the Spotify application window and browser windows with YouTube
- For Spotify: Reads the window title, which contains the song and artist information
- For YouTube: Extracts the video title from browser tabs
- Writes this information to a text file
- Checks for changes every 2 seconds (configurable)
- Prioritizes Spotify over YouTube when both are playing
- Go 1.24.3 or higher
- Git
-
Clone the repository:
git clone https://github.com/Arkkis/GoSpotifySong.git cd GoSpotifySong -
Build the executable:
go build -o SpotifySongTracker.exe
This project uses GitHub Actions to automatically build and release the application whenever changes are pushed to the main branch. Each new push creates a release with:
- Date-based versioning (YYYY.MM.DD format)
- For multiple releases on the same day, time is added (YYYY.MM.DD-HHMM format)
- Windows executable ready to download and use
- Release notes containing the commit message
You can modify the following constants in the code:
outputFile: Change the output file location/name (default:current_song.txt)checkInterval: Change how frequently the application checks for song changes (default: every 2 seconds)
The application detects YouTube music playing in:
- Google Chrome
- Mozilla Firefox
- Microsoft Edge
- Brave
- Opera
- Other browsers may work as well
Contributions are welcome! Feel free to submit a Pull Request.
This project is open source and available under the MIT License.