Feed Purifier automates YouTube Home feed cleanup with Zendriver:
- Extracts visible videos from the Home feed with Zendriver
- Classifies each video as
TRASHorGOLDvia LLM (OllamaorOpenAI) - Executes action:
TRASH-> clickNot interestedGOLD-> open, watch, like, close
By default the tool runs in dry-run mode (no clicks). Use --execute to perform real actions (perform clicks).
- Create a virtual environment and install dependencies:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt- Configure environment by copying
.env.exampleto.envand editing values:
cp .env.example .envExample for Ollama:
CLASSIFIER_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama3.1Example for OpenAI:
CLASSIFIER_PROVIDER=openai
OPENAI_API_KEY=...
OPENAI_MODEL=gpt-4o-miniNote: For custom OpenAI-compatible endpoints, set the base URL:
OPENAI_BASE_URL=http://localhost:4144- Run:
python -m feed_purifier.main --execute --watch-seconds 120 --max-videos 20After login
- Delete the cookies marked with red recktangle in the screenshot to remain logged in to YouTube.
- Once you've removed the marked cookies, press Enter in the login terminal to save the authenticated cookies and continue.
Use a custom cookie file path explicitly:
python -m feed_purifier.main --auth-cookies ./yt_auth_state.jsonTo dry ran:
python -m feed_purifier.main --watch-seconds 120 --max-videos 20Force login:
python -m feed_purifier.main --loginWhere: feed_purifier/classifier.py
Tip: Edit the SYSTEM_PROMPT (the prompt string near the top of the file) to customize how videos are classified.
- YouTube UI changes can break selectors over time.
This project is licensed under the MIT License — see the LICENSE file for details.

