A comprehensive command-line interface for interacting with pixeldrain.com, allowing you to upload, download, and manage files through the pixeldrain API.
- 📤 Upload files with real-time progress bar
- 📥 Download files with progress tracking
- 📊 Get file information and statistics
- 🔄 Reupload files (download + upload in one command)
- 🔑 Authentication support for pixeldrain accounts
- 🌐 Anonymous downloads when no API key is provided
- 🔗 URL parsing - automatically extracts file IDs from pixeldrain URLs
- ⚡ Error handling with detailed messages for rate limits, captchas, etc.
- Clone this repository:
git clone https://github.com/NohamR/pixeldrain-py.git
cd pixeldrain-py- Install dependencies:
pip install -r requirements.txt- (Optional) Set up your pixeldrain API key:
export PIXELDRAIN_API_KEY="your_api_key_here"Or create a .env file:
PIXELDRAIN_API_KEY=your_api_key_here
python pixeldrain.py upload /path/to/your/file.pdf# Using file ID
python pixeldrain.py download abc123def456
# Using full URL
python pixeldrain.py download https://pixeldrain.com/u/abc123def456
# Download to specific directory
python pixeldrain.py download abc123def456 --dir ~/Downloads
# Force download (bypass browser preview)
python pixeldrain.py download abc123def456 --forcepython pixeldrain.py info abc123def456python pixeldrain.py stats# Download and re-upload in one command
python pixeldrain.py reupload abc123def456Upload a file to pixeldrain.
Arguments:
file_path- Path to the file to upload
Example:
python pixeldrain.py upload document.pdfDownload a file from pixeldrain.
Arguments:
file_id- File ID or pixeldrain URL
Options:
-d, --dir- Download directory (default: /tmp)-f, --force- Force download with ?download parameter
Example:
python pixeldrain.py download abc123 --dir ~/Downloads --forceGet information about a file.
Arguments:
file_id- File ID or pixeldrain URL
Example:
python pixeldrain.py info abc123Display account statistics (requires API key).
Example:
python pixeldrain.py statsDownload and re-upload a file.
Arguments:
file_id- File ID or pixeldrain URL
Options:
-d, --dir- Temporary directory (default: /tmp)-f, --force- Force download
Example:
python pixeldrain.py reupload abc123 --dir /tmpTo upload files or access account features, you need a pixeldrain API key:
- Go to pixeldrain.com
- Create an account or log in
- Go to your account settings
- Generate an API key
- Set it as an environment variable or in a
.envfile
The CLI handles common pixeldrain errors gracefully:
- Rate limiting: Shows captcha URL when rate limited
- Virus detection: Provides instructions for manual verification
- File not found: Clear error messages for missing files
- Authentication: Warnings for missing API keys