A Python script to upload local files to Pixeldrain from CLI.
- Authentication: Uses Pixeldrain API Key for secure uploads.
- SNI Support: Custom SNI (Server Name Indication) hostname configuration to bypass SSL/TLS issues.
- Upload Progress: Displays real-time upload progress.
Make sure you have the following dependencies installed:
- Python 3.6+
- Required Python libraries:
requests
tqdm
urllib3
Install the dependencies using:
pip install -r requirements.txt
- Clone or download the script.
- Run the script from the command line with the required arguments.
python upload_script.py <file_name> <api_key> [--sni-hostname <hostname>]
file_name
: The name of the local file you want to upload.api_key
: Your Pixeldrain API key (obtainable from your Pixeldrain account). API key can be set as an environment variablePDUP_API_KEY
.--sni-hostname
(optional): The hostname to use for the SNI field. Default ispixeldrain.net
.
Upload a file named example.txt
using your Pixeldrain API key:
python upload_script.py example.txt YOUR_API_KEY
If you encounter SSL/TLS issues, specify an SNI hostname:
python upload_script.py example.txt YOUR_API_KEY --sni-hostname t.me
Uploading: 100%|███████████████████████████████████| 2.0M/2.0M [00:03<00:00, 630kB/s]
File uploaded successfully: https://pixeldrain.com/u/abc123def
-
SSL/TLS Issues:
- Try using a different SNI hostname (e.g.,
pixeldra.in
) with the--sni-hostname
option.
- Try using a different SNI hostname (e.g.,
-
Invalid API Key:
- Double-check your Pixeldrain API key and ensure it’s valid.
-
File Not Found:
- Ensure the file exists in the specified path.
This script is open-source and available under the MIT License. Contributions and feedback are welcome! 😊
Developed by Yeasira Desalegn.