Jeeaaasus / youtube-dl

Automated yt-dlp Docker image
https://hub.docker.com/r/jeeaaasustest/youtube-dl/
MIT License
266 stars 34 forks source link

A couple of requests #44

Closed illiteratealliterator closed 3 years ago

illiteratealliterator commented 3 years ago

I've just set this up and it seems to work great - thanks for creating it!

A couple of requests if you have time...

  1. Would you be able to support a separate '/completed' folder, where completed videos would be moved to? This would be really awesome :)

  2. 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.

Jeeaaasus commented 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.

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! :)

illiteratealliterator commented 3 years ago

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!

Caedis commented 3 years ago

{} is used as a placeholder for the file.
Source

Jeeaaasus commented 3 years ago

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/*'

illiteratealliterator commented 3 years ago

Thanks Jeeaaasus, that fixed it, works great now!

I also tried the configurable port and the web UI works great too, nice one!

Jeeaaasus commented 3 years ago

great, no worries! :)