Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clean Media (Now Playing)

Small Windows utility that reads the current system media session (SMTC), cleans up the track info via Ollama, and writes a formatted line to now_playing.txt. A minimal Tk window shows both the raw metadata and the normalized output.

Requirements

  • Windows 10/11 (SMTC support is Windows-only).
  • Python 3.11+.
  • Ollama installed and running with network access to the configured host.
  • Ollama model available (default: gemma3:4b).

Setup

  1. Run init.bat.
    • Creates venv, upgrades pip, installs requirements.txt.
    • Warns if ollama is not on your PATH.
    • If start.bat already exists it will be used after setup; otherwise a new one is generated.
  2. Ensure prompt.txt exists and contains the normalization rules for the LLM.

Configuration (config.yaml)

  • files.now_playing: path to the output text file (default: now_playing.txt).
  • files.prompt: path to the prompt rules file (default: prompt.txt).
  • ollama.address: Ollama host (default: http://localhost:11434).
  • ollama.model: model name (default: gemma3:4b).
  • ollama.keep_alive: Ollama keep-alive value.
  • update_interval: polling interval in milliseconds (default: 1000).

Running

  • Use the generated start.bat, or:
    call venv\Scripts\activate.bat
    python main.py [-debug]
  • The console minimizes in non-debug mode. When the app encounters a fatal error, it pauses for input before exiting so pythonw users can read the message.

Behavior

  • Reads the current SMTC session (YouTube Music/Spotify/etc. that expose SMTC).
  • Sends uploader/title to Ollama with prompt.txt, expects JSON back, and formats it as: title ᵇʸ artist (feat. X, Y) (remix) (feat/remix parts only when present).
  • Writes the formatted string to the configured output file.

Troubleshooting

  • Model not found: run ollama pull <model> and update config.yaml if needed.
  • Prompt errors: ensure prompt.txt is present and non-empty.
  • No track detected: confirm an SMTC-enabled player is running and active.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages