zbjdonald / synology-drive-api

Synology drive api python wrapper.
MIT License
61 stars 15 forks source link

Update files.py #2

Closed wjcroom closed 2 years ago

wjcroom commented 3 years ago

copy a new file with the name,if the name is exist, auto give a name (n) name. share a ffile to open . add edite. test code : def doso(source=source, dist=dist): myre = {"data": {"src": "", "error": ""}, "success": False} with SynologyDrive(NAS_USER, NAS_PASS, NAS_IP, https=False) as synd: synd.get_teamfolder_info() re = synd.copy(source, dist) if (re['success']): sre = synd.share_file(re['data']['file_id']) if (sre["success"]): myre['success'] = True print(myre) myre['data']['src'] = sre['data']["url"]

print(sre)

return myre
zbjdonald commented 2 years ago

Thanks for your contribution.