Python/Django implementation of the AIBlocker API server for crowdsourcing AI content classifications on YouTube videos.
- Framework: Django 5.x + Django REST Framework
- Database: PostgreSQL
- Async Tasks: Celery + Redis
- Python: 3.12+
- Python 3.12+
- PostgreSQL
- Redis
cd AIBlockerServerPy
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtcp .env.example .env
# Edit .env with your configurationRequired environment variables:
SECRET_KEY- Django secret keyDATABASE_URL- PostgreSQL connection stringREDIS_URL- Redis connection stringSALT- Salt for hashing user IDs (IMPORTANT: change in production!)
createdb aiblockerpython manage.py migrateDevelopment:
python manage.py runserver 8080Production:
gunicorn aiblocker.wsgi:application --bind 0.0.0.0:8080celery -A aiblocker worker --loglevel=info| Method | Endpoint | Description |
|---|---|---|
GET |
/api/health |
Health check |
POST |
/api/reports |
Submit AI content report |
POST |
/api/reports/{id}/vote |
Vote on a report |
GET |
/api/videos/{hash}/status |
Get video AI status |
GET |
/api/videos/{hash}/reports |
Get detailed reports |
GET |
/api/videos/{hash}/reports/summary |
Get aggregated summary |
POST |
/api/videos/batch |
Batch query videos |
This server maintains full API compatibility with the original TypeScript/Node.js implementation, allowing the AIBlocker Chrome extension to work without modifications.
Run tests:
python manage.py testCheck for issues:
python manage.py check