Jeeaaasus / youtube-dl

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

Channels auto download not work #88

Closed mm10079 closed 1 year ago

mm10079 commented 1 year ago

The URL is set in the Channels.txt, but automatic downloading is not enabled.

System: Truenas Scale 22.12.3.2 Docker environment:

Jeeaaasus commented 1 year ago

Welcome @mm10079, Could you please post what the logs say the first 5 minutes after creating your container? :) Also please use environment variable youtubedl_debug=true.

mm10079 commented 1 year ago

image image

Jeeaaasus commented 1 year ago

Hmm, you might be the first one to try the image on Truenas Scale. (I really like the idea and really need to try it out)

Could you try the following: Firstly it seems it's maybe the webserver that is breaking, try youtubedl_webui=false also have you specified a non-default youtubedl_webuiport?

Found some things online indicating that you need to increase your host operating systems fs.inotify: sysctl -a | grep fs.inotify.max_user_

By running: sysctl -w fs.inotify.max_user_watches=100000 sysctl -w fs.inotify.max_user_instances=100000

mm10079 commented 1 year ago

Closing youtubedl_webui did not resolve the issue. The youtubedl_webuiport is not using the default port. Thank you for providing the method to extend the log. After inspecting the log, I have configured the /app folder to be persistent as a host path. The "urls.temp" file only exists initially and disappears after the system executes an action once. even when granting it 777 permissions, an authorization error still occurs. (Use ChatGPT translator) image

Jeeaaasus commented 1 year ago

If you have configured the /app folder to be a bind to your host system, the permission failure does makes sense, the user inside the container is called abc and this user doesn't exist outside.

You don't want to make the /app folder persistent, the data in there is totally ephemeral, the only folders you should care about is /config (all your configuration is saved here) and /downloads but at the same time I don't know why I put that temporary file in there instead of /tmp ..

Remove the bind you have defined on /app

mm10079 commented 1 year ago

After removing the host path for the /app folder, the same error message persists. image image

Jeeaaasus commented 1 year ago

That's really weird.. The container should have no issues writing there but OK.

Seems like you must define both PUID and PGID to overcome the permission issues. This error really really really shouldn't happen if you use the environment variables: PUID=0 and PGID=0

And if that works you should try to find out what ID your standard user in Truenas Scale is, in Linux it's usually 1000 but this might not be the case with Truenas Scale. You typically do not want to use 0 (root user) because then yt-dlp has full root permission and that exposes you to a higher security risk in case of a vulnerability. Try PUID=1000 and PGID=1000 and if that doesn't work try to figure out your normal users ID in your host operating system.

mm10079 commented 1 year ago

It's work!! Finally, we've identified the source of the problem. Thank you so much for your help. I overlooked the issue because the Docker I usually use has default PUID and PGID settings. image

Jeeaaasus commented 1 year ago

Great to hear, happy to help.