|
Download PIXELDRAIN_API_KEY_GUIDE.md from 000x/sinhala-subtitle-hardcoder: direct link, hf CLI and curl.
- Browser
- Download file 5.52 kB
-
https://huggingface.co/spaces/000x/sinhala-subtitle-hardcoder/resolve/main/PIXELDRAIN_API_KEY_GUIDE.md
- Command line
-
hf download hf://spaces/000x/sinhala-subtitle-hardcoder/PIXELDRAIN_API_KEY_GUIDE.md
-
curl -L -o PIXELDRAIN_API_KEY_GUIDE.md https://huggingface.co/spaces/000x/sinhala-subtitle-hardcoder/resolve/main/PIXELDRAIN_API_KEY_GUIDE.md
5.52 kB
π PixelDrain API Key Setup Guide
Why Use API Key?
Without API Key (Anonymous Upload):
- β οΈ Files deleted after 7 days
- β οΈ Not linked to your account
- β οΈ Cannot manage or delete files
- β οΈ Limited to small files
With API Key (Authenticated Upload):
- β Permanent storage (until you delete)
- β Files appear in your PixelDrain account
- β Full file management (rename, delete, organize)
- β Higher upload limits
- β Better bandwidth
- β Track all your uploads
How to Get Your API Key
Step 1: Create PixelDrain Account
- Go to https://pixeldrain.com/register
- Sign up (free account is fine)
- Verify your email
Step 2: Generate API Key
- Login to PixelDrain
- Go to https://pixeldrain.com/user/api_keys
- Click "Create API Key"
- Give it a name (e.g., "Subtitle Hardcoder")
- Click "Create"
- Copy the API key (it looks like:
abc123def456...)
Step 3: Use the API Key
Option A: Enter in Web Form
- Paste your API key in the "PixelDrain API Key" field
- Process your videos
- Videos will upload to YOUR account
Option B: Set as Environment Variable (Recommended for Hugging Face)
- Go to your Hugging Face Space Settings
- Click "Repository secrets"
- Add new secret:
- Name:
PIXELDRAIN_API_KEY - Value: Your API key
- Name:
- Save
- Now all uploads will use your account automatically!
Using API Key in Different Ways
1. Web Interface
Just paste your API key in the form field:
π PixelDrain API Key: abc123def456...
2. Environment Variable (Hugging Face Spaces)
In Hugging Face Space:
- Settings β Repository secrets
- Add:
PIXELDRAIN_API_KEY= your key - Restart Space
- All uploads now authenticated automatically!
In Docker/Local:
export PIXELDRAIN_API_KEY="your_api_key_here"
python app.py
In Dockerfile:
ENV PIXELDRAIN_API_KEY="your_api_key_here"
3. Programmatically (Python)
processor = VideoSubtitleProcessor()
links, paths = processor.process_multiple_videos(
video_urls,
subtitle_path,
api_key="your_api_key_here"
)
Security Best Practices
β DO:
- Store API key in environment variables
- Use Hugging Face Repository secrets
- Keep API key private
- Regenerate if compromised
β DON'T:
- Commit API key to Git
- Share API key publicly
- Include in screenshots
- Hard-code in source files
Managing Your Uploads
Once uploaded with API key, manage your files at:
- View Files: https://pixeldrain.com/user/files
- Manage API Keys: https://pixeldrain.com/user/api_keys
- Account Settings: https://pixeldrain.com/user/account
Troubleshooting
"Upload failed" with API key
- Check: API key is correct (no extra spaces)
- Check: Account is active and verified
- Check: File size within account limits
- Try: Regenerate API key
API key not working
- Verify: Key copied correctly
- Verify: No line breaks or spaces
- Check: Account status at pixeldrain.com
- Test: Try anonymous upload first
Uploads not showing in account
- Check: API key is actually being used
- Check: Look for "π Authenticated Upload" message
- Wait: May take a few seconds to appear
- Refresh: PixelDrain files page
Example Workflows
For Personal Use (Private)
- Set
PIXELDRAIN_API_KEYin Hugging Face Space secrets - Make Space private
- All your uploads automatically saved to your account
- Manage files easily from PixelDrain
For Public Use (Shared Space)
- Don't set environment variable
- Users enter their own API keys
- Each user's files go to their own account
- Anonymous uploads for users without keys
For Team Use
- Create dedicated PixelDrain account
- Set API key in Space secrets
- All team uploads centralized
- Easy file management
API Key Format
PixelDrain API keys look like:
abc123def456ghi789jkl012mno345pqr678stu901
- Long alphanumeric string
- No spaces or special characters
- Case-sensitive
- Keep it secret!
Benefits Summary
| Feature | Anonymous | With API Key |
|---|---|---|
| Storage Duration | 7 days | Permanent |
| File Management | β No | β Yes |
| Account Integration | β No | β Yes |
| Upload Limits | Low | Higher |
| Bandwidth | Limited | Better |
| Organize Files | β No | β Yes |
| Delete Old Files | β No | β Yes |
Quick Setup Commands
Set in Hugging Face Space:
# In Space Settings β Repository secrets
PIXELDRAIN_API_KEY = your_api_key_here
Set in Local Terminal:
# Linux/Mac
export PIXELDRAIN_API_KEY="your_api_key_here"
# Windows CMD
set PIXELDRAIN_API_KEY=your_api_key_here
# Windows PowerShell
$env:PIXELDRAIN_API_KEY="your_api_key_here"
Check if API key is set:
# Linux/Mac/Windows PowerShell
echo $PIXELDRAIN_API_KEY
# Windows CMD
echo %PIXELDRAIN_API_KEY%
Need Help?
- PixelDrain Support: support@pixeldrain.com
- API Documentation: https://pixeldrain.com/api
- Account Issues: https://pixeldrain.com/contact
π Ready to Use!
- Get your API key from pixeldrain.com/user/api_keys
- Add it to the form OR set as environment variable
- Enjoy permanent storage and full file management!
Pro Tip: Set it as environment variable in Hugging Face Space secrets for automatic authenticated uploads every time!
Made with β€οΈ for the Sinhala-speaking community