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

Most recent release broke Synology Downloadstation integration #9460

Open
Tailslide opened this issue Apr 20, 2021 · 22 comments
Open

Most recent release broke Synology Downloadstation integration #9460

Tailslide opened this issue Apr 20, 2021 · 22 comments

Comments

@Tailslide
Copy link
Contributor

Tailslide commented Apr 20, 2021

Describe the bug
Since applying the latest release, downloads are stuck on snatched and look like this in DownloadStation.

To Reproduce
Steps to reproduce the behavior:

  1. Initiate a download either through daily search or manual search
  2. Check downloadstation

Expected behavior
Download works

Screenshots
image

Medusa (please complete the following information):

  • OS: Synology 6.2.4-25556
  • Branch: master
  • Commit: 0286e89
  • Python version: 3.7.10
  • Database version: 44.18

Debug logs (at least 50 lines):
2021-04-20 14:18:18 INFO SNATCHQUEUE-SNATCH-328634 :: [0286e89] Downloading [filename] with 191 seeders and 7 leechers and size 2.12 GB from [search provider], through a SearchType.MANUAL_SEARCH search
2021-04-20 14:18:18 INFO SNATCHQUEUE-SNATCH-328634 :: [0286e89] Beginning to snatch release: [filename]

Additional context
I'm wondering if this fix here doesn't work with sites that require a login.
#9366

@p0psicles
Copy link
Contributor

Pls use the issue template.

@Tailslide
Copy link
Contributor Author

Tailslide commented Apr 21, 2021

I can confirm that commenting out the two line change from #9366 makes this stop for me.
(However the previous issue of the latest download station not working is still there then)

@Tailslide
Copy link
Contributor Author

Not sure why this got closed but I fixed the issue by updating downloadstation.py to use the new Version 2 of the DownloadStation API.

I can do a PR for it if you want.

@p0psicles p0psicles reopened this Apr 21, 2021
@p0psicles
Copy link
Contributor

If you could do a PR, that would be much appreciated. But maybe a good idea to consult with @BenjV

@BenjV
Copy link
Contributor

BenjV commented Apr 21, 2021

The two lines form #9366 will use the url (if available) to the torrent instead of the torrent file because the latest version of downloadstation broke the old API for downloading via torrent files.
Are you using a private torrent provider who needs a username/password?
Then downloadstation would not be able to to access that provider, because it does not have the possibility to login there.

I am working on a overhaul of the downloadstation client of medusa, that will use the "SYNO.DownloadStation2.Task" and that will fix the problem with downloading via the torrent file, but I will see if I can fix just this problem earlier.

@Tailslide
Copy link
Contributor Author

@BenjV I have a working version of downloadstation.py using "SYNO.DownloadStation2.Task". I can submit this change if you want and you can review it or you can do you own if you want.

@BenjV
Copy link
Contributor

BenjV commented Apr 21, 2021

I have already a working version which uses the "SYNO.DownloadStation2.Task", I am making some more changes, like checking the download location to be a correct and available share and only logging in again when the cookie is expired and not on every action.
I will do some testing and then submit the PR, probably tomorrow.

@Tailslide
Copy link
Contributor Author

@BenjV Sounds good thank you! The previous release of medusa had a workaround where I could still get up and running by installing the old downloadstation. I'm not sure there is a workaround for this release.

@BenjV
Copy link
Contributor

BenjV commented Apr 22, 2021

@Tailslide
You did not answer my question whether you are using a private torrent provider which needs login.
If so and your "login.php" error stems from that, then this error would also occur when a private torrent provider would use magnet link instead of torrents.
So my question is did the problem occurred when using a private torrent provider and so does that provider use magnet links or only torrent files?

@Tailslide
Copy link
Contributor Author

@BenjV The issue I saw was with a private tracker and a torrent file. As you said, sending the torrent url to the download station doesn't work since it can't authenticate. I just took the original code and converted it to the V2 api and seems to be running with no issues. Looks like no one else is complaining so far and my problem has a temporary fix so maybe you don't need to rush any changes out.

@BenjV
Copy link
Contributor

BenjV commented Apr 22, 2021

I'll take my time, but I was already busy to cleanup and upgrade the downloadstation client of Medusa.

@andersjohansson3
Copy link

I'm now experiencing this issue as well w private trackers. Is there a workaround or do I need to wait for a fix to be applied? I'm running Medusa in a docker container so I guess that limits workaround possibilites some...

@Tailslide
Copy link
Contributor Author

@andersjohansson3 You can revert back to the previous version of Medusa
https://github.com/pymedusa/Medusa/releases/tag/v0.5.10

And the older version of downloadstation
https://archive.synology.com/download/Package/DownloadStation/3.8.15-3563

@BenjV
Copy link
Contributor

BenjV commented May 3, 2021

There is no workaround.

There is a new api available for DownloadStation, but Synology has not yet released documentation for it.
So I am busy with trial and error methode to find how how it can be used.
So either revert back to the old version of Download Station or be patient.

@BenjV
Copy link
Contributor

BenjV commented May 18, 2021

@p0psicles
It took some time because l had no time to spend on this, but now I have created a pull request to support the new Download Station API.
I had to rewrite downloadstation.py and change generic.py
I also did some clean-up and removed some unnecessary code for things like exception handling that already was done elsewhere.

@p0psicles
Copy link
Contributor

The changes have been merged develop.
@Tailslide could you also verify this is fixed now?

@Tailslide
Copy link
Contributor Author

@p0psicles Sorry I can't. I switched to a new NAS and set it up with docker containers, not using download station anymore.

@podzit
Copy link

podzit commented Jul 7, 2021

With the last release of Medusa on Synology, Torrents are sent to Download Station that's OK but they have status "Waiting" and don't start :(
If I add manually the same torrent In DS, the download start immediately...

There's no info about that in Medusa log:
2021-07-07 18:51:52 INFO SNATCHQUEUE-SNATCH-321239 :: [db102f3] Torrent added as task ['dbid_1904'] to DownloadStation
2021-07-07 18:51:49 INFO SNATCHQUEUE-SNATCH-321239 :: [db102f3] Adding "The.Handmaids.Tale.S04E01.FRENCH.WEBRip.x264-FRATERNiTY" torrent to DownloadStation
2021-07-07 18:51:45 INFO SNATCHQUEUE-SNATCH-321239 :: [db102f3] Downloading The.Handmaids.Tale.S04E01.FRENCH.WEBRip.x264-FRATERNiTY with 29 seeders and 1 leechers and size 247.19 MB from Xthor, through a SearchType.MANUAL_SEARCH search
2021-07-07 18:51:45 INFO SNATCHQUEUE-SNATCH-321239 :: [db102f3] Beginning to snatch release: The.Handmaids.Tale.S04E01.FRENCH.WEBRip.x264-FRATERNiTY

@podzit
Copy link

podzit commented Jul 7, 2021

I have discover in setup/ torrent search an error when I try to test connection with DownloadStation:
2021-07-07 19:23:18 WARNING Thread-1 :: [db102f3] Could not get the list of shares from DownloadStation: The logged in session does not have permission
2021-07-07 19:23:18 INFO Thread-1 :: [db102f3] DownloadStation checking if "DL" is a valid share

But the user in the setup is the administrator of the NAS...
Is there an issue with API authentication ?

@BenjV
Copy link
Contributor

BenjV commented Jul 7, 2021

The Synology webapi to current versions of Download Station only function if you set admin as the user.
Any other user result in this problem.

Also other usernames who have admin privs don't function.
This is a pure Synology problem and cannot be fixed in medusa

@MatthK
Copy link

MatthK commented Jan 10, 2023

seansfkelley/nas-download-manager#177 (comment)

I know it's an old thread, but I still have this problem. And it seems there is now at least some documentation from Synology. Is there a way to get this updated?

@BenjV
Copy link
Contributor

BenjV commented Jan 11, 2023

As I wrote on that post:

You can use any account as long as it has application privileges to DownLoadStation and you have configured the download location in DownloadStation for that user.
If you fail to do that the download will be added but never starts.

So you have to create a user in your Nas and give that user permission to use DownloadStation (control panel, application privileges, select downloadsStation and Edit).
That user/password should be configured within medusa on the Torrents Search tab for DownloaddStation.

And the "system Internal User" sc-medusa must have read/write privs on the share where DownloadStation puts the downloaded video's

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants