A Python script to batch upload and publish images to DeviantArt Sta.sh with a real-time progress bar and automatic tag generation.
- OAuth2 Authentication: Securely obtain and store an access token.
- Batch Upload: Automatically find and upload all supported image files in the script directory.
- Real-Time Progress: Visualize upload progress for each file using
tqdmandrequests-toolbelt. - Auto-Generated Tags: Parse each filename to extract a clean title and split into individual tags (no spaces). Include custom tags.
- Automatic Publish: Publish uploaded items to your DeviantArt gallery folder.
- Error Handling: Gracefully handle upload or publish failures with clear console output and manual fallback instructions.
- Python 3.7 or higher
requeststqdmrequests-toolbelt
Install dependencies via pip:
pip install requests tqdm requests-toolbeltEdit the top of upload.py to set your credentials and preferences:
| Variable | Description |
|---|---|
CLIENT_ID |
Your DeviantArt OAuth2 Client ID |
CLIENT_SECRET |
Your DeviantArt OAuth2 Client Secret |
REDIRECT_URI |
OAuth2 redirect URI (whitelisted in your app) |
FOLDER_ID |
Gallery folder ID for publishing (or None) |
TAGS |
List of base tags to include for each upload |
ACCESS_TOKEN_FILE |
Path to store the OAuth access token |
IMAGE_EXTENSIONS |
Tuple of supported image file extensions |
- Authorize: On first run, the script will open your default browser. Grant the requested scopes (
stash,browse,publish). - Upload & Publish: The script locates all images in its directory, uploads each with a progress bar, then publishes to your DeviantArt gallery.
- Manual Fallback: If publishing fails (e.g., missing permission), a Sta.sh URL is printed for manual submission.
Run the script:
python upload.pyFilenames should follow the pattern:
<name>: Dash-separated segments.<count>: Number of images used in the mosaic.
The script will:
- Clean and capitalize the
<name>. - Split into individual tags (no spaces).
- Use
<count>in the description.
- Fork this repository.
- Create a feature branch:
git checkout -b feature/YourFeature - Commit your changes: `git commit -m "Add new feature"
- Push to the branch:
git push origin feature/YourFeature - Open a Pull Request.
MIT License. See LICENSE for details.