Code Monkey home page Code Monkey logo

synolopy's People

Contributors

andy-5 avatar hashar avatar thavel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

synolopy's Issues

what is the format of the [params] ?

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]

Delete method

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.

Support VideoStation API and others

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

python3 not supported

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

Is quickconnect supported ?

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 !

Create method

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?

Missing dependency

There is no dependency handling while installing the package. Therefore, requests is missing.
A requirements.txt file would be nice.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.