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

[FR] Move files after download similar to Sonarr #139

Open
unixrubix opened this issue Mar 28, 2024 · 10 comments
Open

[FR] Move files after download similar to Sonarr #139

unixrubix opened this issue Mar 28, 2024 · 10 comments
Assignees
Labels
blocked parked upstream The issue comes from a dependency

Comments

@unixrubix
Copy link

To prevent Plex or other programs from trying to index or access a file during download, allow for downloading to a temporary /Downloads directory. This should prevent excess CPU cycles from multiple programs executing simultaneously.

Once done, then move file to the intended directory for organization. Plex will pick up the file for scanning once moved provided it is set to monitor folder changes.

This should help the program work in tandem with Sonarr for organization.

@onedr0p
Copy link
Contributor

onedr0p commented Mar 28, 2024

Would downloading the file with a temporary file extension (youtubevod.tmp) and then move it to the right file extension on complete work too? Plex and other media servers shouldn't pick up that tmp file extension.

@unixrubix
Copy link
Author

That could be a solution. I'm not sure about Plex's folder scanner operation, but it's worth exploring.

@kieraneglin
Copy link
Owner

Thank you for the report! I've put this on the list of things to look into (:

@kieraneglin
Copy link
Owner

So this actually would be a pretty easy change, but unfortunately I can't do this until this yt-dlp bug is fixed: yt-dlp/yt-dlp#9445.

I'll leave this open in the meantime and I've also attached a patch of roughly how it would need to be done. Hopefully they are able to fix it soon 🤞

move-after-download.patch

@ItsNoted
Copy link

ItsNoted commented Apr 21, 2024

So this actually would be a pretty easy change, but unfortunately I can't do this until this yt-dlp bug is fixed: yt-dlp/yt-dlp#9445.

Is this why thumbnails are kinda broken? Still having issues with thumbnails not displaying properly in Emby.

@kieraneglin
Copy link
Owner

@ItsNoted I can't say for sure, but that's my current hunch. I think Emby is being a little too aggressive in its thumbnail caching and it causes some weird behaviours if it picks up the thumbnail when it's in the middle of being converted

@kieraneglin
Copy link
Owner

Just for fun, I'm going to take a look at that bug myself and see if maybe I can get a PR in to fix it. No promises since yt-dlp is a HUGE and very complicated project, but I'll at least take a look. Wish me luck 🤞

@kieraneglin
Copy link
Owner

Working through this in yt-dlp/yt-dlp#9774. Hopefully it gets merged soon 🤞

@kieraneglin kieraneglin changed the title FR: Move files after download similar to Sonarr [FR] Move files after download similar to Sonarr May 13, 2024
@CPSibo
Copy link

CPSibo commented May 18, 2024

I'm testing if pinchflat can replace my homebrewed yt-dlp orchestration. My scripts use this "two directory" method and it's worked really well.

I'm actually interested in this feature for a different reason. My media storage is on a dedicated NAS but my dockers run on another machine. So doing a bunch of file operations (ffmpeg transcoding in particular) over the network is a lot slower than having a local temp directory and a remote final directory. Splitting the processing and final dirs is how all my other media dockers do things (sabnzbd, deluge, and my custom yt-dlp stuff).

Another benefit I've seen with it is that yt-dlp will sometimes always fail for certain videos part way through. Leaving the artifacts in the temp directory prevents plex from trying to eat something poisonous. With plex's sometimes problematic caching and sometimes fragile media processing, a broken file can be anywhere from annoying to really damaging.

@kieraneglin kieraneglin added the upstream The issue comes from a dependency label May 21, 2024
@Ogglord
Copy link

Ogglord commented May 31, 2024

For some reason my NAS doesnt like when I download or transcode from it. My NAS is super old. I also run all my dockers on a separate machine. Ideally I want to save it to a local temp directory on my docker host and once it is downloaded move it to my NAS. I'm subscribing to this issue then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked parked upstream The issue comes from a dependency
Projects
None yet
Development

No branches or pull requests

6 participants