31 lines
758 B
Python
31 lines
758 B
Python
|
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/'
|
||
|
}"""
|