This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aad76a0
commit 3a67974
Showing
7 changed files
with
243 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,75 @@ | ||
<p align="center"> | ||
<img src="docs/images/uptobox_icon_24.png"> <a href="https://github.com/hyugogirubato/pyuptobox">pyuptobox</a> | ||
<br/> | ||
<sup><em>Python SDK to interact with Uptobox API.</em></sup> | ||
</p> | ||
|
||
<p align="center"> | ||
<a href="https://pypi.org/project/pyuptobox"> | ||
<img src="https://img.shields.io/badge/python-3.7%2B-informational" alt="Python version"> | ||
</a> | ||
<a href="https://deepsource.io/gh/hyugogirubato/pyuptobox"> | ||
<img src="https://deepsource.io/gh/hyugogirubato/pyuptobox.svg/?label=active+issues" alt="DeepSource"> | ||
</a> | ||
</p> | ||
<div align="center"> | ||
|
||
## Features | ||
<img src="https://github.com/hyugogirubato/pyuptobox/blob/main/docs/images/icon.png" width="10%"> | ||
|
||
- 🛡️ 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! | ||
# PyUptobox | ||
|
||
## Installation | ||
[![License](https://img.shields.io/github/license/hyugogirubato/pyuptobox)](https://github.com/hyugogirubato/pyuptobox/blob/main/LICENSE) | ||
[![Release](https://img.shields.io/github/release-date/hyugogirubato/pyuptobox)](https://github.com/hyugogirubato/pyuptobox/releases) | ||
[![Latest Version](https://img.shields.io/pypi/v/pyuptobox)](https://pypi.org/project/pyuptobox/) | ||
|
||
*Note: Requires [Python] 3.7.0 or newer with PIP installed.* | ||
</div> | ||
|
||
```shell | ||
$ python setup.py install | ||
``` | ||
PyUptobox is a Python client for the Uptobox API. It provides convenient methods for authentication, file management, | ||
and file download/upload operations with Uptobox, a popular file hosting service. | ||
|
||
You now have the `pyuptobox` package installed and a `pyuptobox` executable is now available. | ||
## Features | ||
|
||
- Authenticate with Uptobox using login credentials or token | ||
- Get user account information | ||
- Set various user settings (SSL download, direct download, etc.) | ||
- Manage files and folders (create, delete, move, rename) | ||
- Retrieve file information and download links | ||
- Upload files to Uptobox | ||
- Get streaming links and transcode files | ||
- and more... | ||
|
||
### From Source Code | ||
## Installation | ||
|
||
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. | ||
You can install PyUptobox using pip: | ||
|
||
1. `git clone https://github.com/hyugogirubato/pyuptobox` | ||
2. `cd pyuptobox` | ||
3. `python -m venv env` | ||
4. `source env/bin/activate` | ||
5. `python setup.py install` | ||
````shell | ||
pip install pyuptobox | ||
```` | ||
|
||
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 | ||
|
||
[Python]: <https://python.org> | ||
[Venv's]: <https://docs.python.org/3/tutorial/venv.html> | ||
[Venv's Docs]: <https://docs.python.org/3/library/venv.html> | ||
Here's an example of how to use the PyUptobox library: | ||
|
||
## Usage | ||
```python | ||
from pyuptobox.client import Client | ||
from pyuptobox.utils import get_code, get_size | ||
|
||
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: | ||
# Create client | ||
client = Client() | ||
|
||
- Searching for a file | ||
- Uploading a file | ||
- User information | ||
- and much more! | ||
# Login | ||
client.login(token="YOUR_USER_TOKEN") | ||
|
||
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. | ||
# Get file code | ||
file_code = get_code(value="https://uptobox.com/your-file-url") | ||
|
||
# Get file info | ||
info = client.get_files_info(file_codes=[file_code])[0] | ||
file_size = get_size(info["file_size"]) | ||
|
||
# Get file download link | ||
link = client.get_file_link(file_code=file_code)["dlLink"] | ||
|
||
print("File Name: {}".format(info["file_name"])) | ||
print("File Size: {}".format(file_size)) | ||
print("Download Link: {}".format(link)) | ||
|
||
```py | ||
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 | ||
For more information on how to use PyUptobox, please refer to the [documentation](https://docs.uptobox.com). | ||
|
||
## Disclaimer | ||
|
||
- Uptobox Icon © Uptobox. | ||
- The great community for their shared research and knowledge about Uptobox and its API. | ||
PyUptobox is an unofficial library and is not affiliated with or endorsed by Uptobox or Uptostream. The library is | ||
provided "as is" without any warranty, and the usage of this library is at your own risk. Make sure to comply with the | ||
terms and conditions of the Uptobox service while using this library. | ||
|
||
## License | ||
### License | ||
|
||
[GNU General Public License, Version 3.0](LICENSE) | ||
This project is licensed under the [GPL v3 License](https://github.com/hyugogirubato/pyuptobox/blob/main/LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from .client import Client | ||
from .client import Client, Direction, Order | ||
from .utils import * | ||
|
||
__version__ = "1.0.4" | ||
__version__ = "1.1.0" |
Oops, something went wrong.