A simple CLI file uploader for multiple file-hosting services, with optional clipboard copy.
Project description
lain-upload
A simple CLI file uploader for multiple file-hosting services, with optional clipboard copy.
Installation
Via PyPI (Recommended)
You have the option to choose between the standard version (lain-upload) or the desktop version (lain-upload[clipboard]), which adds clipboard support for auto-copying links.
[!NOTE] For brevity, the examples below use the desktop version.
With pip (Basic)
pip install "lain-upload[clipboard]"
With pipx (Isolated)
pipx install "lain-upload[clipboard]"
With uv (Best)
The most efficient way to install or run the uploader.
# Permanent isolated installation
uv tool install "lain-upload[clipboard]"
# Run once without installing
uvx --with "lain-upload[clipboard]" lain-upload <file1> <file2> <file3>
# Run in scripts or ad-hoc environments
uv run --with "lain-upload[clipboard]" lain-upload <file1> <file2> <file3>
From Source (Development)
# Clone the repository and navigate to it
git clone git@github.com:NecRaul/lain-upload.git
cd lain-upload
# Install environment and all development dependencies (mandatory and optional)
uv sync --dev
# Install pre-commit hook
uv run pre-commit install
# Optional: Run all linters and type checkers manually
uv run pre-commit run --all-files
# Run the local version
uv run lain-upload <file1> <file2> <file3>
# Run tests
uv run pytest tests
Usage
Simply provide the path to the file or files you wish to upload.
# Upload a single file (default host: catbox)
lain-upload kuroneko.png
# Upload multiple files from different directories
lain-upload /path/to/kuroneko.png /path/to/another/directory/shironeko.png yamineko.png ../kamineko.png
# Select a specific host
lain-upload --host uguu kuroneko.png
# Use host authentication when supported
lain-upload --host mixdrop --auth necraul@kuroneko.dev:generated_api_key kuroneko.png
# Set temporary file expiration when supported (e.g. 1h, 12h, 24h, 72h, etc.)
lain-upload --host litterbox --expire-after 24h kuroneko.png
# Enable longer generated filenames when supported
lain-upload --host 0x0 --long-filenames -- kuroneko.png shironeko.png
# Display help and version
lain-upload -h
lain-upload -v
Supported Hosts
- catbox - Support for user authentication with userhashes.
- litterbox - Support for custom expiration time and longer upload filenames.
- pomf - No extra options (deprecated).
- uguu - No extra options.
- fileditch - No extra options.
- 0x0 - Support for custom expiration time and longer upload filenames.
- gofile - Support for user authentication with bearer API tokens.
- pixeldrain - Support for user authentication with API keys (Required).
- buzzheavier - No extra options.
- mixdrop - Support for user authentication with mail and API keys (Required).
Dependencies
- requests: send the API request for uploading.
- requests-toolbelt: enable memory-efficient streaming and progress tracking for large uploads.
Optional
- pyperclip: copy the uploaded files' URLs to the clipboard.
How it works
Supported services expose upload endpoints via multipart POST requests.
This tool automates uploads and adds safety checks and quality-of-life features.
The Manual Way
curl -F "file=@kuroneko.png" https://example-upload-service.tld/upload-endpoint
The lain-upload way
- Batch Processing: Upload multiple files in a single command execution, saving time over individual manual requests.
- Validation: Checks file constraints before uploading (service-specific rules are enforced per host).
- API Request: Sends multipart
POSTrequests viarequestsandrequests-toolbelt, with streaming support for large files. - Normalization: Parses server responses into clean, shareable URLs.
- Clipboard (Optional): If
pyperclipis installed, the result is instantly copied to your clipboard.
Special thanks
- To 7666 of https://lain.la/ for running the pomf service that inspired this project.
- To r/a/dio anons for feedback and suggestions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lain_upload-1.20.tar.gz.
File metadata
- Download URL: lain_upload-1.20.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4efaa54cb8eb6657f57988fcd5c9d44d52ca6226d8e349888fc902dc71689be2
|
|
| MD5 |
6e16c68fb59bdd52c5d33bace693a46a
|
|
| BLAKE2b-256 |
d49aacfe3587e89e317b997caaab91d4878102afc50a6e9ab3a773ff413eb52d
|
File details
Details for the file lain_upload-1.20-py3-none-any.whl.
File metadata
- Download URL: lain_upload-1.20-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d69653e37125ba4b4aab55f06151710c2b60c8fc15de4d1ba7abdec49bd0c1e3
|
|
| MD5 |
c747eb76e652553ab2d810964dc4d1b3
|
|
| BLAKE2b-256 |
868e366f49bdcb0d9e6d1fbaf9acbe51fea8d3c39df61f43766c9a723b54db64
|