mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-25 03:29:58 -07:00
17 lines
522 B
Python
17 lines
522 B
Python
import nextcloud_client
|
|
import os
|
|
|
|
if __name__ == "__main__":
|
|
client = nextcloud_client.Client(os.environ["NC_HOST"])
|
|
client.login(os.environ["NC_USER"], os.environ["NC_PASS"])
|
|
file = os.environ["NC_FILE"]
|
|
path = os.environ["NC_PATH"] + file
|
|
try:
|
|
client.delete(path)
|
|
except Exception:
|
|
pass
|
|
client.put_file(path, file)
|
|
share_link = client.share_file_with_link(path).get_link()
|
|
download_link = share_link.rstrip("/") + "/download/" + file
|
|
print(download_link, end="")
|