thavel / synolopy Goto Github PK
View Code? Open in Web Editor NEWSynology Python API
License: MIT License
Synology Python API
License: MIT License
i tried the following code:
method = 'create'
params = {
'params':{
"url": "http://torrent.com/abc.torrent",
"destination": "video/TEMPERORY",
}}
nas.downloadstation.task.request(method, **params)
File "...\Anaconda3\lib\site-packages\synolopy\devices.py", line 20, in validate
raise SynologyException(API_ERROR[code])
SynologyException: Invalid parameter
you mention that, in general, the command is:
nas.application.service.request(method, [params])
I wonder if you can tell me how to construct the input parameter [params]
Hello. I'm really sorry for my previous issue #6 there was my mistake.
But now I get the practically the same error with the delete method.
I'm trying to remove task as nas.downloadstation.task.request('delete', id='dbid_86')
where the id
I get from the list
method as nas.downloadstation.task.request('list')
.
And as the results I get:
Traceback (most recent call last):
File "X:/tests/synology-ds-test.py", line 32, in <module>
print nas.downloadstation.task.request('delete', id='dbid_86')
File "C:\Python27\lib\site-packages\synolopy\cgi.py", line 34, in inner
return manager.validate(func(*args, **kwargs))
File "C:\Python27\lib\site-packages\synolopy\devices.py", line 20, in validate
raise SynologyException(API_ERROR[code])
synolopy.errors.SynologyException: Unknown error
UPD: pause
and resume
methods working fine.
From a discussion on a1ea1bd
synolopy is missing support for the VideoStation API among other, the main reason being that Synology did not publish a documentation (although they wrote very nice documentation for some other API).
I found a coffee script implementation https://github.com/JimRobs/syno/tree/master/src/syno Looks like they already reverse engineered VideoStation ( https://github.com/JimRobs/syno/blob/master/src/syno/VideoStation.coffee ) and VideoStationDTV ( https://github.com/JimRobs/syno/blob/master/src/syno/VideoStationDTV.coffee ) APIs. So it might just be about copy pasting (with proper authorship).
See also the related wiki page https://github.com/JimRobs/syno/wiki/Video-Station-API
Hello, i have an issue with synolopy using python3
You are using Queue but in python3 this module has been rename "queue"
it's could be useful to migrate from python2 to python3 and thus changing Queue in queue
Sorry not really a bug/issue, just wondering if quickconnect is supported ?
I'm trying to connect to my server via :
>>> from synolopy import NasApi
>>> nas = NasApi('https://myID.quickconnect.to/webapi/', 'myUser', 'myPass')
>>> nas.downloadstation.info.request('getinfo')
And I get
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/synolopy/cgi.py", line 34, in inner
return manager.validate(func(*args, **kwargs))
File "/usr/local/lib/python2.7/site-packages/synolopy/cgi.py", line 147, in request
session = manager.session(node) or manager.credentials(node)
File "/usr/local/lib/python2.7/site-packages/synolopy/devices.py", line 35, in credentials
cookie = _NasValidationManager.validate(resp)
File "/usr/local/lib/python2.7/site-packages/synolopy/devices.py", line 15, in validate
rsp = response.json()
File "/usr/local/lib/python2.7/site-packages/requests/models.py", line 808, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python2.7/site-packages/simplejson/__init__.py", line 516, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python2.7/site-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/local/lib/python2.7/site-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
because the response is not json probably. This is related to
https://forum.synology.com/enu/viewtopic.php?f=223&t=131754
Any tips, pointers are appreciated, thanks !
Hello. Could someone explain how can I use create
method with DownloadStation?
I'm trying to use something like API describes: api=SYNO.DownloadStation.Task&version=1&method=create&uri=ftps://192.0.0.1:21/test/test.zip
as
nas.downloadstation.task.request('create', {'url': 'magnet:link_here'})
but I get TypeError: request() takes exactly 2 arguments (3 given)
.
How can I fix it?
There is no dependency handling while installing the package. Therefore, requests
is missing.
A requirements.txt
file would be nice.
The documentation doesn't say that i have to add /webapi to my host url, but synolopy doesn't work until i do.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.