UpFileLive is a Python tool designed to interact with the upfile.live file-sharing service. It allows users to upload files and retrieve shareable and downloadable links using both synchronous and asynchronous methods. 中文描述
Install the library via pip:
pip install UpFileLiveThis library requires:
- Python 3.7 or later
- playwright, loguru
Install Playwright and dependencies:
pip install playwright loguru
python -m playwright installFrom UpFileLive import UpFileLive
# Initialize the UpFileLive object
file_uploader = UpFileLive("/path/to/your/file")# Upload a file and get the share link
file_uploader.sync_upfile()
print(f"Share Link: {file_uploader.get_share_link()}")import asyncio
async def async_upload():
await file_uploader.async_upfile()
print(f"Share Link: {file_uploader.get_share_link()}")
asyncio.run(async_upload())# Set the share link and retrieve the download link (If you have already run the upfile function, you do not need to set this option.)
# file_uploader.share_link = "<your_share_link>"
file_uploader.sync_download()
print(f"Download Link: {file_uploader.get_download_link()}")async def async_download():
# file_uploader.share_link = "<your_share_link>"
await file_uploader.async_download()
print(f"Download Link: {file_uploader.get_download_link()}")
asyncio.run(async_download())file_uploader.sync_upfile_download()
print(f"Share Link: {file_uploader.get_share_link()}")
print(f"Download Link: {file_uploader.get_download_link()}")async def async_upload_download():
await file_uploader.async_upfile_download()
print(f"Share Link: {file_uploader.get_share_link()}")
print(f"Download Link: {file_uploader.get_download_link()}")
asyncio.run(async_upload_download())This project is licensed under the Modified MIT License.