Giter Club home page Giter Club logo

synology's Introduction

Synology PHP

This is a PHP Library that consume Synology APIs

  • SYNO.Api :

    • connect
    • disconnect
    • getAvailableApi
  • SYNO.DownloadStation :

    • connect
    • disconnect
    • getInfo
    • getConfig
    • setConfig
    • getScheduleConfig
    • setScheduleConfig
    • getTaskList
    • getTaskInfo
    • addTask
    • deleteTask
    • pauseTask
    • resumeTask
    • getStatistics
    • getRssList
    • refreshRss
    • getRssFeedList
  • SYNO.AudioStation:

    • connect
    • disconnect
    • getInfo
    • getObjects
    • getObjectInfo
    • getObjectCover
    • searchSong
  • SYNO.FileStation:

    • connect
    • disconnect
    • getInfo
    • getShares
    • getObjectInfo
    • getList
    • search
    • download
    • createFolder
  • SYNO.VideoStation:

    • connect
    • disconnect
    • getInfo
    • getObjects
    • searchObject
    • listObjects

Usage for Synology Api:

$synology = new Synology_Api('192.168.10.5', 5000, 'http', 1);
//$synology->activateDebug();
$synology->connect('admin', 'xxxx');
print_r($synology->getAvailableApi());

Usage for AudioStation:

$synology = new Synology_AudioStation_Api('192.168.10.5', 5000, 'http', 1);
$synology->connect('admin', 'xxxx');
print_r($synology->getInfo());

synology's People

Contributors

cschalenborgh avatar cweiske avatar lucienimmink avatar m4tthumphrey avatar pbxg33k avatar zzarbi 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

synology's Issues

Added support for BT Search

First of all, thanks for the great work!

I've taken the liberty to add some code on my fork to support the Search functionality of the DSM Download Station.
My changes can be seen on my "features/btsearch" branch

Some limitation do apply unfortunately.
It looks like search tasks are bound to the session so once you log-out or otherwise destroy the session, you will not be able to get the results anymore.

A small snippet from a test run
ss 2014-09-13 at 01 45 28

Help request

Using the wrapped stream endpoint lets a user get the audio content by calling $synology->stream('music_xxx');
This is returned as byte-range if the browser supports it (if the API call is done directly from a browser ofc). Best is to relay ALL response headers from the API but I don't know how to do that and more importantly where it should go; in the AudioStation API wrapper or the demo code.
Any help with this issue is really appreciated!

Class "Synology\Api" not found

Hello,

I try to execute the code in WAMP for testing.
I can't use it, I have always a class problem... I try to include php file, trying namespace, use etc.... Nothing works...

How can I load the namespace ?

Thank you

FileStation: Split out additional data into separate arrays

Hi,

I am trying to acces the data in the 'additional' => $additional' array. In order to filter my list of files only to certain creation dates (crtime) (e.g. I only want to show the files created on 5 December 2014). According to the API docs this should be possible, when printing a raw print_r($synology->getList('/recordings')); with additional on true - it is shown in the raw dump.

However it is not directly accessible as an object. Doing something like $file->additional['crtime]'. Does not render any results. I am not sure if this is a bug, or whether its because this still needs to be fully implemented.

From the API docs, time is broken down like:

"time": { 
 "atime": 1371630215, 
 "crtime": 1352168821, 
 "ctime": 1368769689, 
 "mtime": 1368769689 
 } 

This value is part of the additional parameter.

I have been trying to work around it, but thats far les elegant. Essentially you would want to only load the files, with a certain creation date (or a range). Rather than loading all the files, and iterating over them. To give you an idea I have about 5000 files I have to iterate over. It looks like you can do this with file type, owner, etc. Just not with these additional values.

Problem with method download & Filestation API

Hi,

Thanks for your excellent work ! I want to use your class for a private implementation and I have a problem with your example, I guess explain that
It's my code for Filestation API :
echo $synology->download($path2); Where $path2 is the link for the file.
Unfortunally this action dosen't work.
I'm trying to copy/paste your header but I hve got an error when I launch my code.

Can you help me for discover an issue ?

Thank's by advance

Example for DSM

Hi,

I am trying to use this, but its a little hard. Since the demo is quite limited, wondering if you have any examples for retrieving things like the directory and files with some timestamps. Right now this library seems limited to primary the Download Manager it would be nice if it could do more generic stuff.

Cannot connect to Synology

Hello zzarbi,

I have tried implementing your API to work on it but it doesn't seem to be working. When I run the PHP, it shows:
Connect Session: AudioStation User: admin Requested Url: https://XXX.synology.me:5001/webapi/auth.cgi?account=admin&passwd=XXX&session=AudioStation&format=sid&api=SYNO.API.Auth&version=2&method=login Response code: 0 Result:

I replaced my personal information with XXX, there is nothing on Result:, but when I go to this URL on a different browser tab, it works, connects fine, it even gives me an ID.

How can I solve this?

Thank you

Problem on login with new DSM 5.1

Hello, thanks for you code!!!
I have written a small php application that worked great.
Now with the new DSM 5.1 does not make me do more access!!
The following is a sample debug of login:

Connect Session: DSM
User: admin
Requested Url GET: https://1.1.1.1:4444/webapi/auth.cgi?account=username&passwd=plaipassword&session=DSM&format=sid&api=SYNO.API.Auth&version=2&method=login
Response code: 0
Result:
Errore di connessione: Connection Error

you're experiencing some problems with the new version 5.1 of dsm ??
Best Regards
Gabriele

Surveillance Station API -> SetCameraSchedule

Hello !

First of all : thank you for this library :-)

I use Surveillance Station in my house and I tried to implement some methods, ex :

const API_SERVICE_NAME = 'SurveillanceStation';

public function getCameraSchedule($camId)
{
    $params['cameraId'] = $camId;
    return $this->_request('Notification.Schedule', 'entry.cgi', 'GetCameraSchedule', $params);
}

public function setCameraSchedule($params)
{
    return $this->_request('Notification.Schedule', 'entry.cgi', 'SetCameraSchedule', $params, null, 'post');
}

The getCameraSchedule() method works just fine.

But the setCameraSchedule() doesn't work when I call it with this code :

$params['eventType'] = 5;
$params['cameraId'] = 4;
$params['schedule'] = '[{"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}, {"schedule": "1"}]';
print_r($synology->setCameraSchedule($params));

I'm using a DS1513+ with Surveillance Station v7.1-4058.

Do you have any idea on how to implement this method ?

Is this problem beacause of the JSON format needed for "schedule" parameter ?

Thanks !

Throw error codes instead of exceptions

Hi,

It would be nice if the system can provide me with error codes instead of exceptions.

I currently cannot provide a error_log for $synology->connect and instead the script "hangs" for ages. There seems to be no timeout on the curl initiation.

Regards,

Bojhan

Connect timeout

Currently it keeps trying to connect even when the server isn't reachable. Should the API $synology->connect have some kind of timeout measure?

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.