π A powerful and interactive script to simplify and automate bulk uploads to the Internet Archive. Features a beautiful terminal UI with colors, emojis, and an intuitive directory browser.
All dependencies are bundled - just run and upload! π¦
# All dependencies are bundled - just run!
python3 bulk-upload.pyThat's it! The script includes everything needed:
- π¦ Bundled dependencies in
vendor/folder - π¨ Interactive UI with colors and emojis
- π Directory browser with arrow key navigation
- π€ Identifier validation with auto-fix
- π Metadata management
- π Automatic IA sync
- π¨ Colorful terminal interface with emoji support
- π Interactive directory browser - navigate your filesystem with arrow keys
- π·οΈ Smart identifier management - saves and recalls your upload locations
- ποΈ Delete identifiers - remove saved identifiers (not IA files)
- π Live upload progress with file counters and transfer speeds
- β Verification with detailed reporting
- πΎ SQLite-based tracking for resumable uploads
- π€ Identifier validation - auto-suggests valid identifiers
- π Force upload option - re-upload files when needed
- π Metadata management - add title, description, tags, etc.
- π‘οΈ Path validation - validates directories before upload
- Automates the bulk upload process
- Uses your
iaconfiguration (same location asiaCLI) - Tracks uploaded files in a SQLite database to avoid re-uploading
- Creates standalone scripts for unattended uploads
- Verifies file integrity via MD5 hash comparison
- Graceful interrupt handling (Ctrl+C)
- Follows symbolic links (with loop protection)
- Validates Internet Archive identifier format
- Uploads metadata (title, description, creator, tags) with files
| Dependency | Bundled? | Required? | Notes |
|---|---|---|---|
| Python 3 | β | β Yes | Version 3.8 or newer required |
| internetarchive (Python lib) | β | β Yes | Bundled in vendor/ |
| questionary | β | β Yes | Bundled in vendor/ |
| tqdm | β | β Yes | Bundled in vendor/ |
| ia CLI | β | Only needed for ia configure |
Required (not bundled):
- Python 3.8+
iaCLI (for initial setup only)
Bundled in vendor/ (~11MB):
- All Python libraries needed to run the script
The vendor/ directory includes all Python dependencies (~11MB):
internetarchive- IA API clientquestionary+prompt_toolkit- Interactive menustqdm- Progress barsrequests+urllib3- HTTP client- Plus all sub-dependencies
No need to install Python packages! Just run the script.
Configure Internet Archive credentials (requires ia CLI):
# Install ia CLI if you don't have it
# Arch Linux:
sudo pacman -S python-internetarchive
# Debian/Ubuntu:
sudo apt install python3-internetarchive
# macOS (Homebrew):
brew install python-internetarchive
# Configure with your credentials
ia configureEnter your Internet Archive email and password when prompted.
Note: You only need ia for the initial ia configure step. After that, the script uses your saved credentials directly.
# That's it! All dependencies are bundled.
python3 bulk-upload.pyOr make it executable:
chmod +x bulk-upload.py
./bulk-upload.py# Provide identifier and directory as arguments
python3 bulk-upload.py my-collection /path/to/filesThe script shows a colorful menu with your saved identifiers:
π¦ Internet Archive Bulk Upload
============================================================
π Select an identifier:
π·οΈ my-first-collection
π /home/user/uploads/collection1
π·οΈ another-project
π /data/projects/project2
β Custom identifier
ποΈ Delete identifier
β Exit
- Use arrow keys to navigate
- Press Enter to select
- Choose Custom identifier to enter a new one
- Choose Delete identifier to remove a saved identifier
Select "Delete identifier" to remove a saved identifier:
β οΈ Select identifier to delete:
π·οΈ my-first-collection
π·οΈ another-project
β Cancel
β οΈ Delete 'my-first-collection' from saved identifiers?
(This will NOT delete files from Internet Archive) (y/N)
β
Deleted 'my-first-collection' from saved identifiers.
Note: This only removes the identifier from your local saved list. It does NOT delete files from Internet Archive - that must be done via the IA web interface.
When entering a custom identifier, the script validates it against Internet Archive rules:
Rules:
- Must be 5-101 characters long
- Must start with a letter or number
- Can only contain:
a-z,A-Z,0-9,_,.,- - No spaces allowed
Invalid identifier example:
β Identifier contains invalid characters
Your input: '64MB SD-Card'
π‘ Use suggested identifier '64MB_SD-Card' instead? (Y/n)
The script automatically suggests valid alternatives by replacing invalid characters!
After selecting an identifier, you'll be asked if you want to use the stored path:
β
π Use stored path: /home/user/uploads/collection1? (Y/n)
- Yes (default): Uses the stored path directly and proceeds to upload
- No: Opens the interactive directory browser
If you choose No, the interactive directory browser lets you navigate:
π π Browsing: /home/user
============================================================
π .. Parent directory
π Documents Directory
π Downloads Directory
π Pictures Directory
π file1.txt File (1.2 KB)
π file2.pdf File (3.4 MB)
...
β
SELECT THIS DIRECTORY
π Go to Home
β Cancel
Features:
- ποΈ Navigate with arrow keys
- π See file sizes at a glance
- π Quick jump to home directory
- β Select current directory for upload
Watch live progress during upload:
π Scanning local files...
Found 150 files (2.3 GB)
π€ 45 files to upload
π€ [1/45] Uploading 'folder/document.pdf'...
(1/45) Uploading folder/document.pdf ββββββββββββββββββββ 45.2% 1.2 MB/s
β
Upload successful
π€ [2/45] Uploading 'folder/image.jpg'...
...
After upload, the script verifies files:
π Verifying files on IA...
π [1/150] folder/document.pdf... β
OK
π [2/150] folder/image.jpg... β
OK
π [3/150] folder/missing.dat... β MISSING
============================================================
β οΈ Verification complete - 1 file(s) have issues:
β’ folder/missing.dat
After selecting identifier and directory, you can create a standalone script:
π Create a pre-configured script for quick future uploads? (y/N)
This creates <identifier>.py that runs with pre-set values - perfect for:
- β Automated cron jobs
- β Repeated uploads to the same collection
- β Sharing with team members
If you're unsure whether files were uploaded successfully, you can force a re-upload:
β οΈ Force upload all files (ignore upload log and re-upload everything)? (y/N)
When to use force upload:
- Not sure if files were uploaded correctly
- Want to re-upload files with better quality
- Recover from interrupted uploads
- Reset upload state for testing
What it does:
- Clears the upload log for the current identifier
- All files will be marked as "not uploaded"
- Script will re-upload everything
The script can store and upload metadata with your files:
π Add metadata (title, description, tags, etc.) for this upload? (Y/n)
============================================================
π Metadata for Internet Archive Upload
============================================================
βοΈ π Title: My Photo Collection
βοΈ π Description: Photos from my summer vacation
βοΈ π€ Creator/Author: John Doe
βοΈ π
Date (YYYY-MM-DD): 2026-03-31
βοΈ π·οΈ Subjects/Tags (semicolon-separated): photos;vacation;summer
βοΈ π Language (3-letter code, e.g., 'eng'): eng
Metadata fields:
- Title - Display name for your collection
- Description - Detailed description of the content
- Creator/Author - Who created the content
- Date - Publication/upload date
- Subjects/Tags - Keywords (semicolon-separated)
- Language - 3-letter ISO language code
On subsequent runs:
π Metadata already exists for this identifier. Edit it? (y/N)
Metadata is stored in ~/.config/internetarchive/metadata.json and reused for future uploads to the same identifier.
Internet-Archive-CLI-Bulk-Upload-Script/
βββ bulk-upload.py # Main interactive script (v3.3+)
βββ vendor/ # Bundled dependencies (~11MB)
βββ requirements.txt # Dependencies list
βββ README.md # This file
| File | Purpose |
|---|---|
bulk-upload.py |
Main interactive script |
vendor/ |
Bundled Python packages |
requirements.txt |
Dependencies list |
README.md |
Documentation |
These files are stored in the same location as the ia CLI configuration:
Config Directory: ~/.config/internetarchive/ (all platforms)
| File | Purpose | In Git? |
|---|---|---|
identifiers.json |
Saved identifier β path mappings | β No (user-specific) |
metadata.json |
Metadata templates per identifier | β No (user-specific) |
upload_log.db |
SQLite upload tracking database | β No (user-specific) |
config.ini |
IA credentials (created by ia configure) |
β No (user-specific) |
Note: Our script shares the same config directory as the ia CLI, so credentials and identifiers are shared between tools.
If vendor/ is missing, recreate it:
python3 -m pip install --target=vendor questionary internetarchive tqdmOr use the requirements list:
pip install -r requirements.txt- π Resumable uploads: If interrupted, just run again - it resumes where it left off
- π Large collections: The script handles thousands of files efficiently
- π Skip verification: Press Ctrl+C during verification if you trust the upload
- Use descriptive identifiers (e.g.,
project-name-2026) - The script saves identifierβpath mappings for quick reuse
- You can have multiple identifiers pointing to different directories
- Organize files in subdirectories - structure is preserved on IA
- The script follows symbolic links (with loop protection)
- Hidden files (starting with
.) are included
- MD5 Verification can be slow for large files - you can skip with Ctrl+C
- One upload at a time: IA processes uploads sequentially per identifier
- Internet connection: Stable connection recommended for large uploads
- Disk space: Ensure enough space for temporary files during upload
If you deleted the vendor/ directory or it's not working:
# Option 1: Re-download bundled libraries
python3 -m pip install --target=vendor questionary internetarchive tqdm
# Option 2: Install system-wide
pip install questionary internetarchive tqdm# Make script executable
chmod +x bulk-upload.py
# Or run with python explicitly
python3 bulk-upload.py- Just run the script again - it tracks uploaded files and resumes
- Check your internet connection
- Verify IA credentials with
ia configure
- The script has loop protection enabled
- If you have complex symlink structures, verify they're correct
# Re-install bundled libraries
python3 -m pip install --target=vendor questionary internetarchive tqdmContributions and feedback are welcome!
- π Report bugs via GitHub Issues
- π‘ Suggest new features
- π§ Submit PRs with improvements
- β Star the project to show support
For development, use a virtual environment:
# Clone the repository
git clone https://github.com/ockentap/Internet-Archive-CLI-Bulk-Upload-Script.git
cd Internet-Archive-CLI-Bulk-Upload-Script
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # or: source venv/bin/activate.fish (fish shell)
# Install dependencies
pip install -r requirements.txt
# Run the script (uses venv libraries instead of vendor/)
python bulk-upload.pyTo rebuild the vendor directory:
# Remove old vendor directory
rm -rf vendor/
# Create fresh vendor directory with all dependencies
python3 -m pip install --target=vendor questionary internetarchive tqdm- ποΈ Delete identifiers from saved list
- Select identifier to delete from menu
- Confirms deletion (does NOT delete from IA)
- Removes local tracking only
- β
Fixed directory selection flow
- Confirming stored path now skips directory browser
- Faster workflow for repeated uploads
- π Metadata management for IA uploads
- Interactive metadata collection (title, description, tags, etc.)
- Stored per-identifier in
~/.config/internetarchive/metadata.json - Asks to edit on subsequent runs (default: No)
- Automatically included with all uploads
- π€ Identifier validation with auto-suggestions
- Validates against IA format rules
- Suggests valid alternatives for invalid identifiers
- Clear error messages with examples
- π Force upload option to re-upload all files
- Clears upload log for current identifier
- Useful for recovering from failed uploads
- Prompts before clearing to prevent accidents
- β¨ New interactive UI with questionary library
- π¨ Colorful terminal interface with emoji support
- π Interactive directory browser with navigation
- π Enhanced progress tracking with statistics
- π Symlink loop protection
- πΎ Better error handling and user feedback
- Added ncurses-based UI (now deprecated)
- SQLite upload tracking
- MD5 verification
- Basic CLI upload functionality
- Identifier management
This script is provided "as is" without warranty of any kind. Use at your own risk.
If you find this script useful:
- β Star the project on GitHub
- π’ Share it with others
- π¬ Leave feedback or suggestions
Happy uploading! π