First commit

This commit is contained in:
Iain Bradley
2025-10-07 12:55:34 +01:00
commit 4ca7f9667a
7 changed files with 501 additions and 0 deletions
+87
View File
@@ -0,0 +1,87 @@
# 2000 AD CBZ Downloader
Automatically downloads all CBZ files from your shop.2000ad.com account.
## Setup
1. **Create `.env` file with your credentials:**
```bash
cp .env.example .env
```
Then edit `.env` and add your email and password.
2. **Build the container:**
```bash
docker-compose build
```
## Usage
### Run once (download all new files):
```bash
docker-compose up
```
### Run in background:
```bash
docker-compose up -d
```
### View logs:
```bash
docker-compose logs -f
```
### Stop the container:
```bash
docker-compose down
```
## File Structure
```
.
├── docker-compose.yml
├── Dockerfile
├── requirements.txt
├── download_cbz.py
├── .env (your credentials - not committed to git)
├── .env.example (template)
└── downloads/
└── (your CBZ files will be downloaded here)
```
## Scheduled Downloads
To run automatically every day, edit `docker-compose.yml` and uncomment the `command` line:
```yaml
command: sh -c "while true; do python download_cbz.py && sleep 86400; done"
```
Then change `restart: "no"` to `restart: unless-stopped`.
This will:
- Run the downloader immediately
- Wait 24 hours (86400 seconds)
- Run again
- Repeat forever
## Troubleshooting
**If downloads fail:**
- Check your credentials in `.env`
- Run with logs visible: `docker-compose up` (without `-d`)
- Check that Firefox is working: The script will show login progress
**If you want to see the browser:**
- Edit `download_cbz.py` and change `headless=True` to `headless=False`
- Rebuild: `docker-compose build`
- You'll need X11 forwarding for this in Docker
## Security Note
The `.env` file contains your password. Make sure to:
- Add `.env` to `.gitignore` if using git
- Never commit credentials to version control
- Keep file permissions restricted: `chmod 600 .env`