Closed illiteratealliterator closed 3 years ago
Hello @illiteratealliterator! :)
The second request is a quick and easy fix and I agree it should be configurable. There is now a new ENV to specify port number. Let me know if there's any issues!
As for the first request, by using the --exec
argument I believe you can configure youtube-dl itself to accomplish this and that will be much better than what I ever could implement,
I think this would work but haven't tested it.
args.conf
change the line starting with --output
in such a way that youtube-dl downloads to /tmp/youtube-dl/ instead, example: --output "/tmp/youtube-dl/%(uploader)s/%(title)s.%(ext)s"
args.conf
add: --exec 'mv {} /downloads/ && rm -rf /tmp/youtube-dl/*'
In theory youtube-dl should now download to a temp folder and once done downloading and processing it would move the finished file to /downloads/ and then delete any leftover files just to be safe.
Let me know how it works out and if you need any help! :)
Awesome, thanks for adding the port config, I'll give that a go soon.
I've just tried updating args.conf like you suggested, and it almost works, but it looks like the args to mv include the download path.
I've configured a /scratch volume on the container, and then updated args.conf with:
--output "/scratch/tmp/%(uploader)s/%(title)s.%(ext)s"
--exec 'mv {} /downloads/{} && rm -rf /scratch/tmp/*'
When I test it, the files are downloaded correctly to the /scratch/tmp folder, but on completion I get this error:
mv: cannot move '/scratch/tmp/<Channel>/<Video>.mp4' to '/downloads//scratch/tmp/<Channel>/<Video>.mp4': No such file or directory
What's the purpose of the {}? Could this just use * instead? Thanks for your help!
The {}
is the path of the final finished file.
It sounds like it will work with one correction:
--exec 'mv {} /downloads/{} && rm -rf /scratch/tmp/*'
maybe should be
--exec 'mv {} /downloads/ && rm -rf /scratch/tmp/*'
Thanks Jeeaaasus, that fixed it, works great now!
I also tried the configurable port and the web UI works great too, nice one!
great, no worries! :)
I've just set this up and it seems to work great - thanks for creating it!
A couple of requests if you have time...
Would you be able to support a separate '/completed' folder, where completed videos would be moved to? This would be really awesome :)
Less importantly, would you be able to make the port for the web UI configurable? I'm running the container using another container's service (VPN, so I don't risk ip ban), and it conflicts with another service I run.