Skip to content

noQuli/youtube-feed

Repository files navigation

Feed Purifier

Feed Purifier automates YouTube Home feed cleanup with Zendriver:

  • Extracts visible videos from the Home feed with Zendriver
  • Classifies each video as TRASH or GOLD via LLM (Ollama or OpenAI)
  • Executes action:
    • TRASH -> click Not interested
    • GOLD -> open, watch, like, close

Safety default

By default the tool runs in dry-run mode (no clicks). Use --execute to perform real actions (perform clicks).

Setup

  1. Create a virtual environment and install dependencies:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
  1. Configure environment by copying .env.example to .env and editing values:
cp .env.example .env

Example for Ollama:

CLASSIFIER_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama3.1

Example for OpenAI:

CLASSIFIER_PROVIDER=openai
OPENAI_API_KEY=...
OPENAI_MODEL=gpt-4o-mini

Note: For custom OpenAI-compatible endpoints, set the base URL:

OPENAI_BASE_URL=http://localhost:4144
  1. Run:
python -m feed_purifier.main --execute --watch-seconds 120 --max-videos 20

After 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.

cookies screenshot

cookies marked

Use a custom cookie file path explicitly:

python -m feed_purifier.main --auth-cookies ./yt_auth_state.json

To dry ran:

python -m feed_purifier.main --watch-seconds 120 --max-videos 20

Force login:

python -m feed_purifier.main --login

System prompt

Where: feed_purifier/classifier.py

Tip: Edit the SYSTEM_PROMPT (the prompt string near the top of the file) to customize how videos are classified.

Notes

  • YouTube UI changes can break selectors over time.

License

This project is licensed under the MIT License — see the LICENSE file for details.

About

Feed Purifier automates YouTube Home feed cleanup with Zendriver

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors