Cannot Import Re-Encoded File from qBittorrent, Due to File Extension

sonarr Package Version: 3.0.6.1342-ls126 by linuxserver.io
Mono Version: 5.20.1.34
qBittorrent Version: 4.3.8
Host OS: MacOS Monterey
Log File Message: 2021-12-30 02:57:04.3|Error|DownloadedEpisodesImportService|Import failed, path does not exist or is not accessible by Sonarr: /downloads/SeriesName.S01E02.1080p.HEVC.x265-MeGusta[eztv.re]/SeriesName.S01E02.1080p.HEVC.x265-MeGusta[eztv.re].mkv. Ensure the path exists and the user running Sonarr has the correct permissions to access this file/folder

Description of issue: My issue is the same as this post, and some others, however no post has a solution.

Using all Docker containers, I use qBittorrent to download torrents to a directory. Handbrake monitors that directory and automatically re-encodes the files, and saves the output to a second directory. Sonarr monitors that second directory for import.

In most cases, Sonarr finds and imports the re-encoded file, but sometimes it cannot find the file to import. Like others, I believe it occurs when the torrent downloads only a single file, rather than a folder with several files in it. When the torrent downloads only a single file and the file’s extension has changed due to the re-encode, sonarr cannot find it. In the log file error posted above, the correct file is the same file name but ends in .mp4 and not .mkv.

One suggested solution in the forum was to have qBittorrent store downloads into a folder, even if it’s a single file. I checked the option in qBittorrent to create a subfolder for new torrents which is working - you can see the parent folder in the error message. Is there any solution for this, or is the answer that there is no solution?

Have your post process occur AFTER the download is imported by sonarr with a custom script

Also why do you want double space used for all seeding torrents - for those you don’t convert - and slow, IO intensive copies for all imports?

See the docker guide in the servarr wiki or linked from LSIO’s own docs.

Have your post process occur AFTER the download is imported by sonarr with a custom script

Not my favorite solution… since the setup works with sonarr for most cases, it would be nice if there was a way to have sonarr identify files re-encoded by Handbrake consistently.

To re-encode after import using Handbrake, Handbrake will need to monitor the entire TV directory rather than just downloads. I’d also need 2 Handbrake containers - 1 to monitor the entire TV directory and another to monitor the entire Movie directory. Or re-structure my folders such that movies & tv are all under a single parent folder with nothing else in it. Also, not sure if it can be configured to store the re-encoded file in the same location as the original file.

On the other hand, it looks like custom scripts are capable of doing it, removing Handbrake completely, but I’ll need to look into it. I see Docker images for sonarr and radarr with sickbeard built into it via custom script. Perhaps this will work but I’ll need to see how exactly it re-encodes the file. One of the great things about Handbrake is how configurable the re-encoding is.

Overall, both are large solutions for an otherwise small problem. More of a workaround, and would be nice if sonarr could be configured to ignore the file extension in all scenarios, rather than just some.

Of note, I haven’t run into this issue with radarr. I’m not sure if it handles single-file torrents differently from sonarr, or if that scenario simply hasn’t happened yet on radarr. If radarr is able to handle the scenario but sonarr can’t, it would strengthen my belief that a small change in how sonarr looks for files could resolve this, and make both sonarr/radarr work more consistently during imports.

Why would handbrake need to monitor anything?

You just have sonarr call/trigger it on import.

And the there’s no way to be fix your issue as you’re breaking the logic.

The download path - and file to look for - comes directly from the download client when the client reports the download is completed

You’re removing the file that’s there before sonarr can import it this breaking the logic

It frankly sounds like your setup is just intentionally convoluted for no reason and you don’t fully understand what you’ve actually setup.

You totally nailed it. Maybe one day I’ll understand.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.