This project provides a passive tool that occasionally checks for new bookmarks added by the user, fetch those bookmarks, and download the bookmarked artworks.
- Clone the repository:
git clone https://github.com/swstl/pixiv-downloader.git cd pixiv-downloader - Install dependencies:
pip install -r requirements.txt
python main.py [OPTIONS]or run using nohup:
nohup python main.py [OPTIONS] > /dev/null 2>&1 &| Option | Type | Description |
|---|---|---|
--save_path |
string | Path to save downloaded artworks. (default: ./data) |
--log_path |
string | Path to save JSON logs. (default: ./data) |
--cookies_path |
string | Path to user cookies JSON file for Pixiv login. (default: ./user) |
--no_folder |
flag | Disables saving artworks in separate folders. |
--delay_min |
int | Minimum delay between bookmark checks (default: 60 seconds). |
--delay_max |
int | Maximum delay between bookmark checks (default: 120 seconds). |
--timeout |
int | Request timeout in seconds (default: 60 seconds). |
--max_threads |
int | Maximum concurrent download threads. (default: 5) |
python main.py --save_path ./downloads --cookies_path ./cookies.json --delay_min 60 --delay_max 120version: "3.8"
services:
pixiv:
image: swstl/pixiv-passive-downloader:latest
command: >
--save_path /app/data
--log_path /app/user
--cookies_path /app/user/cookies.json
--delay_min 60
--delay_max 120
--max_threads 5
volumes:
- ./data:/app/data
- .:/app/user
restart: unless-stopped File structure for this compose.yaml (must have):
└── <project name>
├── cookies.json
└── compose.yaml(cookies should be there before running the compose file)
Run the compose.yaml with:
docker compose up -dThis program uses cookies to fetch the bookmarks from the user (to log in as the user).
[
{
"name": "PHPSESSID",
"value": "your_session_id_here",
"domain": ".pixiv.net",
"path": "/",
"secure": true,
"httpOnly": true,
"expiry": 12111111111
},
{
"name": "device_token",
"value": "your_device_token_here",
"domain": ".pixiv.net",
"path": "/",
"secure": true,
"httpOnly": true,
"expiry": 12111111111
}
]Note: Cookies are essential for login (to fetch certain bookmarks). Use a browser extension like cookie-editor to export cookies.
- Login Issues: Ensure the cookies file is valid and not expired.
- No Internet Warning: Confirm that your network connection is stable.
- Failed Downloads: Retry with valid bookmarks or check for changed Pixiv page structures.
- Bookmark Mismatch: Delete existing logs and re-run the script.
MIT License. See LICENSE for details.
- Pixiv for providing the platform.
- Requests libraries for web automation and API handling.
- PIL to store frames as gif.
Disclaimer: This tool is intended for personal use.
- requests.exceptions.TooManyRedirects: Exceeded 30 redirects. (try updating your cookies)