rdt-client: Alldebrid puts files in silly places sometimes, causing rdt-client to be unable to find them

What version are you using? docker 2541993a2fe6

What OS are you running? NixOS

Are you using Docker or as a service? Docker

Which debrid provider are you using? Alldebrid

Which downloader are you using? Symlink

Please attach a log file here with the log setting set to debug See below for excerpts where relevant

Edit: [Note] AD changed how single file torrents are stored in the webDAV drive on 2025-01-07T12:30:00Z ish - many comments about single-file torrents are no longer true

Variables in <> referenced below are from the data.magnets field in a response from a /api/v4/magnet/status request.

Alldebrid is doing some weird stuff with their webdav. I’ve identified a few cases where rdt-client won’t pick up the files. Below are the cases I’ve identified

  • Single file torrent whose name does not end in a file extension, but the file inside does: The file is available at /mnt-path/magnets/<filename> (notably, not links[0].filename).
  • Torrents containing a subdirectory. Say there was a file in this subdirectory, then it would be available at /mnt-path/magnets/<filename>/<links[I].files[0].n]>/<links[0].files[0].e[0].n>.

As an example of the first case: say <filename> = "A" and <links[0]> = {"filename": "B.mkv", "files": [{"n": "B.mkv"}]} Then the file is at /mnt-path/magnets/A (no extension). Yes this is really an mkv file despite having no extension. . The logs for the files checked are as follows

[DBG] Searching /mnt/rclone/magnets for B.mkv (attempt #3)...
[DBG] Searching /mnt/rclone/magnets/A/B.mkv...
[DBG] Searching /mnt/rclone/magnets/B.mkv/B.mkv...
[DBG] Searching /mnt/rclone/magnets/B/B.mkv...
[DBG] Searching /mnt/rclone/magnets/B.mkv...

For the second case, say <filename> = "A", and there are files C.mkv and D.mkv in the subdirectory B. Then the files are at /mnt-path/magnets/A/B/C.mkv and /mnt-path/magnets/A/B/D.mkv. The logs for the files checked are the same as above.

The data.magnets in the response from /api/v4/magnet/status looks something like

{
  "filename": "A",
  "links": [
    {
      "filename": "C.mkv",
      "files": [{
        "n": "B",
        "e": [{
          "n": "C.mkv"
        }]
      }]
    },
   {
      "filename": "D.mkv",
      "files": [{
        "n": "B",
        "e": [{
          "n": "D.mkv"
        }]
      }]
    }
  ]
}

which, when constructed as above , does produce the correct filename. This construction also works for torrents which do not contain subdirectories, just that <links[0].files[0]> is { "n": "B.mkv"}, with no e, so the correct filename is /mnt-path/magnets/<filename>/<links[I].files[0].n]>. However, this construction fails for single file torrents, in a similar way to the current setup: most single file torrents are named the same as the file they contain, so it’s fine most of the time, but if the filename is not the same as links[0].n, the construction fails. . For single file torrents, /mnt-path/magnets/<filename> is always the correct path.

Effectively, I think the logic is that if there is one file in the torrent (even if it is in a subdirectory), it appears at /mnt-path/magnets/<filename>, and if there is more than one file, each file’s path is /mnt-path/magnets/<filename>/<all the "n"s of its parent>/<its "n">

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 60 (31 by maintainers)

Most upvoted comments

It must’ve closed this automatically when I merged the PR.

@Sculas is this something you could have a look at?

I’ve fixed the symlink search by adding the searchPath to the directories to search in (8fe277fa5265379affe95e819df8c43969c79d56). I’ve also added the optimization for Alldebrid downloads (38a3bc1537be3c76367017d4f787c54e3e6149ff). @rogerfar The PR (#652) should be ready to merge now if it works for @Cucumberrbob.

Yeah, I was about to mention that in the PR, but we may want to wait with my PR until we know it’s fixed. Otherwise, we push out a release now that works around a part of the bug, but then tomorrow it’s fixed for example, and we have to fix it again to remove the workaround. My PR as it is now should work just fine afaik, given that the WebDAV bug is fixed in Alldebrid. Actually, there might still be some behavior that might be incorrect which we discovered today. I’ll take another look over it all once it’s fixed though.

@bob1321 are you able to test with this file? Maybe this is something on my end instead

Not working