pyuptobox
Python SDK to interact with Uptobox API.
Features
-
🛡️ Methode de connexion multiple -
📦 Direct use of the service, without restrictions -
🛠️ Easy implementation in other programs -
🧩 Plug-and-play installation via setup.py -
❤️ Forever FOSS!
Installation
Note: Requires Python 3.7.0 or newer with PIP installed.
$ python setup.py install
You now have the pyuptobox
package installed and a pyuptobox
executable is now available.
From Source Code
The following steps are instructions on download, preparing, and running the code under a Venv environment.
You can skip steps 3-5 with a simple pip install .
call instead, but you miss out on a wide array of benefits.
git clone https://github.com/hyugogirubato/pyuptobox
cd pyuptobox
python -m venv env
source env/bin/activate
python setup.py install
As seen in Step 5, running the pyuptobox
executable is somewhat different to a normal PIP installation.
See Venv's Docs on various ways of making calls under the virtual-environment.
Usage
The following is a minimal example of using pyuptobox in a script. It gets the download link of a file. There's various stuff not shown in this specific example like:
- Searching for a file
- Uploading a file
- User information
- and much more!
Just take a look around the Client code to see what stuff does. Everything is documented quite well.
There's also various functions in utils.py
that showcases a lot of features.
from pyuptobox.client import Client
from pyuptobox import utils
# Demo: https://uptobox.eu/5w4rff6r17oz
if __name__ == "__main__":
# create client
client = Client()
file_code = utils.get_code(value="https://uptobox.eu/5w4rff6r17oz")
# login
data = client.login(token="USER_TOKEN")
# get file info
info = client.get_file_info(file_codes=[file_code])
# get file download link
link = client.get_file_link(file_code=file_code)
print("I: Subscription: {}".format("PREMIUM" if data["premium"] == 1 else "FREE"))
print("I: Name: {}".format(info["file_name"]))
print("I: Size: {}".format(info["file_size"]))
print("I: Link: {}".format(link))
Credit
- Uptobox Icon © Uptobox.
- The great community for their shared research and knowledge about Uptobox and its API.