Team 33 Project for CITS3200
Mellow is a local Chrome/Edge extension plus Flask server that filters YouTube video recommendations using a lightweight probabilistic filter and an LLM-based categorizer. The content script scrapes visible video URLs, the service worker batches them to the local server for metadata, and the background worker categorizes these videos. The extension adds overlays to the YouTube page to block videos or entire sections (e.g., Shorts/Playables) according to user settings.
Each content category has settings you control:
- Toggle a category Active/Inactive. Inactive categories are never filtered (strength is ignored).
- Choose a filter strength per active category (Weak, Moderate, Strong, Extra Strong, Blocked).
The probabilistic filter maintains a per-category block probability that increases with watchtime and decays over time. The chosen strength scales how quickly the probability rises and the rate of decay, a higher strength increases the blocking probability at a faster rate and takes longer to decay. “Blocked” is a special strength that always blocks that category.
- Clone the repository:
git clone https://github.com/mouper/CITS3200-Team-33.git
- Create a Python venv and install deps:
python -m venv .venv # Depending on your system, you may need to use 'python3' instead
. .venv/Scripts/activate # Windows PowerShell command
source .venv/bin/activate # macOS/ Linux command
pip install -r server/requirements.txt
- Create env file:
copy server/env.example server/.env # Windows PowerShell command
cp server/env.example server/.env # macOS/ Linux command
- Populate environment variables:
Populate the following keys in the .env file with your real confidential keys.
# External APIs
YT_API_KEY=your-youtube-api-key
OPENAI_API_KEY=your-openai-api-key
- Run the server:
python server/run.py
The service binds to 127.0.0.1 on the port from server/.env (default 5050).
When the server starts for the first time, it automatically initializes all databases and sets user settings to default values. The following categories are set as active by default with the filter strength set to 'Moderate':
- Sensational/Outrage News
- Politics
- Gaming
- Sexual and Explicit
- Violent and Graphic
- Controversial and Conspiracy Theories
- Open Chrome/Edge and go to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select
packages/extension/src/ - Pin the extension
- The extension should now be active
- Please note that the server must be running for the extension to function
- Click the toolbar icon → in the popup, click “Open Dashboard”
- Adjust the content category filter settings
- Visit
https://www.youtube.com - Enjoy your customised YouTube video feed!
Make sure you have a Python virtual environment activated and all dependencies installed:
pip install -r server/requirements.txt
From the project root, run:
pytest -v
This will automatically discover and run all unit, integration, and end-to-end tests in the tests/ folder and package subfolders.
To run a single test file, use:
pytest tests/test_categorised_db.py
Or for a package test:
pytest packages/llm_client/tests/test_metadata_triage.py
- If you see
ModuleNotFoundError: No module named 'databases', ensure your project root is onPYTHONPATHor run tests from the root directory. - If you get database lock errors, make sure tests are not running in parallel unless designed for it.
- For flaky tests, rerun with
pytest --maxfail=1 -vto see detailed output.
- All tests are in the
tests/folder and package-specifictests/subfolders. - Fixtures and test helpers are defined in
tests/conftest.py. - Each test file targets a specific module or feature.