N4S4 / synology-api

A Python wrapper around Synology API
MIT License
368 stars 138 forks source link

always only return You are now logged in! nothting else ! #105

Closed changchichung closed 1 year ago

changchichung commented 1 year ago

install

chc@h03:~/git/sftpbox$ pip3 install git+https://github.com/N4S4/synology-api
Defaulting to user installation because normal site-packages is not writeable
Collecting git+https://github.com/N4S4/synology-api
  Cloning https://github.com/N4S4/synology-api to /tmp/pip-req-build-rfkevfpr
  Running command git clone --filter=blob:none --quiet https://github.com/N4S4/synology-api /tmp/pip-req-build-rfkevfpr
  Resolved https://github.com/N4S4/synology-api to commit fabed66871c660f01440bc64efb97d86a437a798
  Preparing metadata (setup.py) ... done
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from synology-api==0.4.4) (2.22.0)

python file

chc@h03:~/git/sftpbox$ cat 1.py
#!/bin/env python3.8
#   Version: v1.0.1
#   Filename: 1.py
#   Author: {{ author }}
#   Description: ---
#   HostName: {{ hostname }}
#   Create: 2022-10-12 17:36:26
from synology_api import filestation, downloadstation

# Initiate the classes DownloadStation & FileStation with (ip_address, port, username, password)
# it will log in automatically 

fl = filestation.FileStation('192.168.11.161', '5000', 'myaccount', 'mypassword', secure=False, cert_verify=False, dsm_version=6, debug=True, otp_code=None)

fl.get_list_share()

run the python

chc@h03:~/git/sftpbox$ python 1.py
You are now logged in!
chc@h03:~/git/sftpbox$

any suggestions ?

N4S4 commented 1 year ago

ok so try

print(fl.get_list_share())

it should work

changchichung commented 1 year ago

yes , it works , thanks !