A local Django web application that connects to your Gmail via IMAP, filters for Bandcamp "New Release" emails, parses them for metadata (album art, artist/label, release link), and displays them in a chronologically ordered feed.
- Gmail IMAP Integration: Connects to Gmail to fetch Bandcamp notification emails from all folders
- Email Parsing: Extracts uploader (artist/label), release name, artwork URL, and Bandcamp links from email HTML using BeautifulSoup
- SQLite Caching: Stores parsed releases locally to avoid re-processing emails
- Two-Phase Sync: Prioritizes recent emails first, then processes historical backlog incrementally
- Real-time Progress: Server-Sent Events (SSE) provide live feedback during email sync
- Inline Audio Playback: Stream tracks directly in the browser via scraped Bandcamp MP3 URLs with auto-refreshing tokens
- Favourite Uploaders: Star artists/labels to filter your feed down to favourites
- Search & Filter: Filter releases by text search, release type, date range, favourites, and sort order
- Custom Domain Support: Handles both
*.bandcamp.comURLs and custom artist domains
- Backend: Django 5.2, Python 3.11+
- Email Processing: imap-tools (IMAP), BeautifulSoup4
- Bandcamp Scraping: Requests
- Frontend: Django Templates, Tailwind CSS (CDN), HTMX 1.9
- Database: SQLite
- Real-time Updates: Server-Sent Events (SSE)
- Python 3.11+
- A Gmail account with Bandcamp notification emails
- Gmail App Password (see setup below)
-
Clone and navigate to the project:
cd bandcamp-feed -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp env.example .env
Edit
.envand add your Gmail credentials:EMAIL_USER=your-email@gmail.com EMAIL_PASSWORD=your-app-password EMAIL_SYNC_LIMIT=500 -
Run database migrations:
python manage.py migrate
-
Start the development server:
python manage.py runserver
-
Open your browser: Navigate to http://127.0.0.1:8000
Gmail requires an App Password for IMAP access (your regular password won't work).
- Go to your Google Account
- Navigate to Security → 2-Step Verification
- Follow the prompts to enable 2FA if not already enabled
- Go to App Passwords
- Select Mail as the app
- Select Other and enter "Bandcamp Feed"
- Click Generate
- Copy the 16-character password (without spaces)
EMAIL_USER=your-email@gmail.com
EMAIL_PASSWORD=abcd efgh ijkl mnop
| Environment Variable | Description | Default |
|---|---|---|
EMAIL_USER |
Gmail address | Required |
EMAIL_PASSWORD |
Gmail App Password | Required |
EMAIL_SYNC_LIMIT |
Max emails to process per sync (0 = unlimited) | 500 |
- View Feed: The main page displays all cached Bandcamp releases in a paginated grid
- Sync: Click Sync Emails to fetch new releases from Gmail (progress shown in real-time)
- Search: Type in the search box to filter by uploader or release name
- Filter: Use the dropdowns to filter releases by date (last week, month, 3 months, or year), release type (album or track), or favourites only
- Sort: Order by newest, oldest, or uploader name (A-Z or Z-A)
- Play: Click a release card to stream its tracks directly in the browser
- Favourite: Star an uploader to add them to your favourites for quick filtering
- Browse: Click the Bandcamp link on a release card to open it on Bandcamp
bandcamp-feed/
├── bandcamp_feed/ # Django project package
│ ├── settings.py # Configuration with .env support
│ ├── urls.py # Root URL routing
│ └── wsgi.py
├── feed/ # Main application
│ ├── models.py # Release & FavouriteUploader models
│ ├── services.py # IMAP fetching, email parsing & stream scraping
│ ├── views.py # Views, SSE streaming & JSON endpoints
│ ├── urls.py # App URL routing
│ ├── admin.py # Django admin registration
│ ├── apps.py # App config
│ ├── migrations/ # Database migrations
│ ├── static/feed/ # Static assets
│ │ ├── css/main.css
│ │ └── js/
│ │ ├── player.js # Inline audio player
│ │ └── toast.js # Toast notifications
│ └── templates/feed/ # HTML templates
│ ├── base.html # Base layout with Tailwind config
│ ├── index.html # Main feed page
│ └── partials/ # HTMX partials
│ ├── releases.html # Release grid partial
│ └── favourite_btn.html
├── .env # Environment variables (not in git)
├── env.example # Template for .env
├── requirements.txt # Python dependencies
└── manage.py
- The
.envfile containing credentials is excluded from git via.gitignore - Use Gmail App Passwords instead of your main account password
- This application is designed for local/personal use only