marcopeocchi / yt-dlp-web-ui

A terrible web ui and RPC server for yt-dlp. Designed to be self-hosted.
GNU General Public License v3.0
818 stars 84 forks source link

Setting a temporary path via custom args doesn't work #142

Open KarimGeiger opened 6 months ago

KarimGeiger commented 6 months ago

I wanted to be able to download files to /tmp during download, and have them moved once completed to /downloads/videos. yt-dlp supports this by supplying the --paths parameter with a type. For example, using --paths temp:/tmp.

Unfortunately, the --paths parameter is being ignored if -o is an absolute path (for legacy reasons), which appears to always be the case with yt-dlp-web-ui. Therefore, I cannot set a custom temp path parameter. I think a fix for this would be to simply use --paths for the absolute portion and -o only for the template.

Current:

/usr/bin/python3 /usr/bin/yt-dlp [...] -o /downloads/videos/%(title)s.%(ext)s

Proposed Change:

/usr/bin/python3 /usr/bin/yt-dlp [...] --paths /downloads/videos -o %(title)s.%(ext)s

This allows for adding optional path parameters of different types, for example:

/usr/bin/python3 /usr/bin/yt-dlp [...] --paths /downloads/videos -o %(title)s.%(ext)s --paths temp:/tmp