Stasher Agent is a command-line interface and AI Agent for managing and stashing video content metadata. Interact with an LLM in natural language to perform tasks like updating playlist metadata, stashing files, and more.
The tool includes interactive Agent mode, as well standard CLI commands. The agent mode can utilize a Together API key or a local model via Ollama.
This is a work in progress. It is a tool I use, but there are other tools that may be better options for you.
- Stashing metadata for a specific playlist.
- Stashing data from a given URL or playlist.
- Check for differences between local and remote playlists.
- Save delta information as a job for future reference.
- Batch stashing data with customizable settings.
- Store stashed metadata in a sqlite database.
- Python 3.10+
- FFmpeg: Required for audio processing and format conversion.
- Windows:
winget install Gyan.FFmpegor download from ffmpeg.org - Linux:
sudo apt install ffmpeg - macOS:
brew install ffmpeg
- Windows:
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Install the required packages:
pip install -r requirements.txt
-
Configure your environment:
- Download OAuth credentials from the Google Console and place them in the project root.
- Create a
.envfile (optional) to specify the secrets file location:CLIENT_SECRETS_FILE=client_secrets.json
- (Optional) Customize behavior in
controls.toml.
To run the CLI, use the following command:
-
Authentication
python main.py auth
Initiates the OAuth flow to grant the application access to your YouTube account.
-
Update a Playlist
python main.py update-playlist --playlist-id <PLAYLIST_ID>
-
Update All Playlists
python main.py update-all-playlists
-
Stash a Video
python main.py stash-video --video-url <VIDEO_URL> --output-path <OUTPUT_PATH> [--audio-only]
-
Check Playlist Delta
python main.py check-playlist-delta [--verbose] [--save]
-
Stash a Playlist
python main.py stash-playlist --playlist-id <PLAYLIST_ID> --output-path <OUTPUT_PATH> [--audio-only] [--batch-size <BATCH_SIZE>] [--batch-delay <BATCH_DELAY>] [--summary-interval <SUMMARY_INTERVAL>]
-
Enter Agent Mode (Cloud) Uses TogetherAI (requires API key).
python main.py run-stasher
> update playlist IfEY5_NB6is
> update all of my playlists please
> stash video IfEY5_NB6is- Enter Agent Mode (Local) Uses a local Ollama instance (requires Ollama installed and running).
python main.py run-stasher-ollama
> update playlist IfEY5_NB6is
> update all of my playlists please
> stash video IfEY5_NB6isThe application uses a hierarchy for configuration:
- Environment Variables: Defined in
.env(e.g.,CLIENT_SECRETS_FILE). - Configuration File:
controls.tomlfor default settings.
Ensure client_secrets_file points to a valid Google OAuth Client ID JSON file.
Feel free to submit issues, but for now, this is a personal project. I recommend forking and modifying to your liking.