remote-torrent-adder icon indicating copy to clipboard operation
remote-torrent-adder copied to clipboard

Synology Download station 3.8.16-3566

Open bigbuzzer opened this issue 3 years ago • 7 comments

After update of Synology Download station to version 3.8.16-3566 including https://www.synology.com/en-global/security/advisory/Synology_SA_21_11

Send to now gives the following error DownloadStation: Response to the POST request is {"error":{"code":101},"success":false}

bigbuzzer avatar Mar 27 '21 17:03 bigbuzzer

similarly to #227, i don't own a synology download station and thus unfortunately cannot investigate/run tests/fix this. pull requests are appreciated, if you can somehow get me access to one of these devices, i can mess around with it.

i don't remember how the present code came into existence, i assume it was a pull request or someone gave me access. in any case, this file needs fixing: https://github.com/bogenpirat/remote-torrent-adder/blob/master/webuiapis/SynologyWebUI.js

closing this for now, will re-open if anything related to it happens.

bogenpirat avatar Mar 27 '21 19:03 bogenpirat

Hi, SickChill had the same issues. Changes in the API called for putting the file in qoutes '"file"' and the destination is now required it would seem like.

https://github.com/SickChill/SickChill/issues/7062

{'api': 'SYNO.DownloadStation2.Task', 'version': '2', 'method': 'create', 'session': 'DownloadStation', 'url': 'magnet:?xt=urn:btih:F72B8AC6026&dn=The+Walking+Dead&tr=http://tracker/announce', 'type': 'url', 'create_list': 'false', 'destination': 'Media/Download'}

bigbuzzer avatar Apr 12 '21 20:04 bigbuzzer

uh... alright.

so you're saying:

  1. auth v3 as-is in 55fdb5d
  2. .torrent file upload: api=SYNO.DownloadStation2.Task and version=2 instead of SYNO.DownloadStation.Task and version=3
  3. file parameter is actually called "file" parameter
  4. magnet as-is in 55fdb5d

does that sound about right? i'm willing to implement this, just wanna clear up what exactly supposedly works.

PS: this is reopened in response to https://github.com/bogenpirat/remote-torrent-adder/pull/304

bogenpirat avatar Apr 12 '21 21:04 bogenpirat

Yes, and it looks like the destination (which is the Synology share path to store the downloaded file) also needs to be included.

bigbuzzer avatar Apr 12 '21 21:04 bigbuzzer

the destination (which is the Synology share path to store the downloaded file) also needs to be included.

so this is something the user has to enter individually, yes? no default values i can hardcode? if this is the case, i'd prefer to create an optional setting in the RTA server config.

bogenpirat avatar Apr 12 '21 21:04 bogenpirat

Yes, setting per NAS

bigbuzzer avatar Apr 12 '21 22:04 bigbuzzer

okay, give f838db5 (+fix) a go. zip.

  • hardcoded version=2 back into the v2 post body
  • changed the v3 post uri - the sickchill commit shows a different endpoint for SYNO.DownloadStation2.Task
  • added a destination path setting in RTA's server settings - required for v3(?)
  • changed the session parameter name for v3 - it was _sid in v2, from sickchill's code it seems to be session.

PS: this comment is killing me. i don't enjoy writing code like this at all - against a seemingly poorly-designed endpoint without any way of testing it. i really hope it works. if it doesn't, perhaps you can dick around a bit with it, or at least the error responses are readable.

bogenpirat avatar Apr 13 '21 00:04 bogenpirat