homeserver/roles/mgrote_youtubedl/templates/youtubedl.service.j2
Michael Grote 3e8c34b46c
Some checks failed
ansible-lint / gitleaks (pull_request) Successful in 4s
ansible-lint / Ansible Lint (pull_request) Failing after 47s
ff
2024-09-27 18:56:36 +02:00

18 lines
788 B
Django/Jinja

{{ file_header | default () }}
[Unit]
Description=Save podcast and videos with youtubedl.
OnFailure=youtubedl_mail.service
[Service]
Type=oneshot
{% if ytdl_enable_podcast_download is sameas true %}
ExecStart=-{{ ytdl_bin_path }} --config-location "{{ ytdl_conf_dir }}/podcast.txt"
{% endif %}
{% if ytdl_enable_video_download is sameas true %}
ExecStart=-{{ ytdl_bin_path }} --config-location "{{ ytdl_conf_dir }}/youtube.txt"
{% endif %}
Restart=on-failure
RestartSec=10min
# ExecStart=-/bin/xy : der - sorgt dafür das der Exit-Code ignoriert wird und die Unit nicht failed, wird heir verwendet weil ytdlp bei HTTP404 austeigt; siehe https://github.com/yt-dlp/yt-dlp#usage-and-options + https://serverfault.com/questions/680033/reset-ingnore-non-zero-exit-code-with-fleet-systemd