mirror of
https://github.com/NohamR/pixeldrain-py.git
synced 2026-05-24 20:00:46 +00:00
b0197ae646f3bb35d4e7f79eae7551b3b3732bcd
Pixeldrain CLI
A comprehensive command-line interface for interacting with pixeldrain.com, allowing you to upload, download, and manage files through the pixeldrain API.
Features
- 📤 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.
Installation
- 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
Usage
Upload a file
python pixeldrain.py upload /path/to/your/file.pdf
Download a file
# 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 --force
Get file information
python pixeldrain.py info abc123def456
View account statistics
python pixeldrain.py stats
Reupload a file
# Download and re-upload in one command
python pixeldrain.py reupload abc123def456
Command Reference
upload
Upload a file to pixeldrain.
Arguments:
file_path- Path to the file to upload
Example:
python pixeldrain.py upload document.pdf
download
Download 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 --force
info
Get information about a file.
Arguments:
file_id- File ID or pixeldrain URL
Example:
python pixeldrain.py info abc123
stats
Display account statistics (requires API key).
Example:
python pixeldrain.py stats
reupload
Download 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 /tmp
API Key
To 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
Error Handling
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
Description
Languages
Python
100%