Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQ] Support for Synology Download Station #1356

Open
iblagoev opened this issue Jan 19, 2024 · 1 comment
Open

[FEATURE REQ] Support for Synology Download Station #1356

iblagoev opened this issue Jan 19, 2024 · 1 comment
Labels
Download client Feature request New features, improvements etc

Comments

@iblagoev
Copy link

Is your feature request related to a problem? Please describe.
Add support for Download Station.

Describe the solution you'd like
A way for Autobrr to send download events to Download Station.

Additional context
I've played around with their API and figured out the below endpoints in order to send a download event to DS.
Tested on DSM 7.2.1-69057 Update 3 and Download Station version 4.0.1-4709.

Link to an old doc for the DS API -> https://global.download.synology.com/download/Document/Software/DeveloperGuide/Package/DownloadStation/All/enu/Synology_Download_Station_Web_API.pdf

Based on the above doc we can get all the API endpoints by sending a GET request to /webapi/query.cgi?api=SYNO.API.Info:

curl -X GET "https://ip_or_fqdn_of_synology/webapi/query.cgi?api=SYNO.API.Info&version=1&method=query&query=ALL"

from there to authenticate the /webapi/auth.cgi?api=SYNO.API.Auth is used and version 7 (I guess for DSM 7 as anything below version 7 returns error 103 -> The requested method does not exist):

curl -X GET "https://ip_or_fqdn_of_synology/webapi/auth.cgi?api=SYNO.API.Auth&version=7&method=login&account=account_name&passwd=password&session=DownloadStation&format=sid

Output is:

{
    "data": {
        "account": "account_name",
        "device_id": "device_id",
        "ik_message": "",
        "is_portal_port": false,
        "sid": "oILR9wuTk7a0wEy3bR-WPAWxK2XiWQuHiU8gY1zkKOXjwFipEdjy5s_w0q03BLSgmfwh6OOVjUztLVYq94RgUV",
        "synotoken": "--------"
    },
    "success": true
}

From there we need to "keep/save" the sid as its used for auth on every other API endpoint.

I've tested against TL and to create a task the /webapi/DownloadStation/entry.cgi is used with the following parameters:

api = SYNO.DownloadStation2.Task
version = 2
type = url
url = url of torrent file
create_list = false (not sure of this, but it's a required parameter)
method = create
destination = destination folder
curl -X POST "https://ip_or_fqdn_of_synology/webapi/DownloadStation/entry.cgi?api=SYNO.DownloadStation2.Task&version=2&type=url&url=https://www.torrentleech.org/rss/download/id_of_torrent/rss_key/name_of.torrent&create_list=false&method=create&destination=dest_folder" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d _sid=oILR9wuTk7a0wEy3bR-WPAWxK2XiWQuHiU8gY1zkKOXjwFipEdjy5s_w0q03BLSgmfwh6OOVjUztLVYq94RgUV
@iblagoev iblagoev added the Feature request New features, improvements etc label Jan 19, 2024
@zze0s
Copy link
Collaborator

zze0s commented Feb 20, 2024

Hey! Thanks for the detailed feature request! We'll consider implementing this in future versions 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Download client Feature request New features, improvements etc
Projects
None yet
Development

No branches or pull requests

2 participants