From 47236128f68e9497b6dbdfe6695f08065b7261b4 Mon Sep 17 00:00:00 2001 From: Kostanjevec Date: Fri, 3 Jun 2022 19:11:11 +0200 Subject: [PATCH] =?UTF-8?q?nova=20nc=20knji=C5=BEnica=20za=20pridobivanje?= =?UTF-8?q?=20urljev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- get_public_links.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 get_public_links.py diff --git a/get_public_links.py b/get_public_links.py new file mode 100644 index 0000000..9e9ab5d --- /dev/null +++ b/get_public_links.py @@ -0,0 +1,30 @@ +import nextcloud_client + +nc = nextcloud_client.Client('https://obzorje.kompot.si') + +nc.login('gia', 'gia0000!') + +# nc.put_file('testdir/remotefile.txt', 'localfile.txt') + + +seznam = nc.list("/GIA CLOUD") + +name = seznam[0].get_name() + +public_share = nc.share_file_with_link("/GIA CLOUD/"+name) +public_link= public_share.get_link()+"/download/"+name + +print(public_link) + +def test_file(): + return public_link + +""""" +options = { + #'webdav_login': 'gia', + #'webdav_password': 'gia0000!', + 'webdav_token': '2WmQL-G7Jbg-6t7sN-JBRSe-eBGy5', + 'webdav_hostname': 'https://obzorje.kompot.si/remote.php/dav/files/dab82616-284e-103c-9287-6de9b1978576/' + #'webdav_hostname': 'https://obzorje.kompot.si', + #'webdav_root': '/remote.php/dav/files/' +}"""