youtubedl: remove podcast download (#636)

Reviewed-on: #636
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Co-committed-by: Michael Grote <michael.grote@posteo.de>
This commit is contained in:
Michael Grote 2023-12-22 12:26:15 +01:00 committed by mg
parent 8d507e1470
commit 6157fa5d48
4 changed files with 47 additions and 11 deletions

View file

@ -24,11 +24,11 @@ ytdl_video_urls:
- https://www.youtube.com/playlist?list=PLs4hTtftqnlAkiQNdWn6bbKUr-P1wuSm0 # jimmy kimmel mean tweets - https://www.youtube.com/playlist?list=PLs4hTtftqnlAkiQNdWn6bbKUr-P1wuSm0 # jimmy kimmel mean tweets
- https://www.youtube.com/tomstantonengineering - https://www.youtube.com/tomstantonengineering
- https://www.youtube.com/@liamcarps #englandvideos ironisch - https://www.youtube.com/@liamcarps #englandvideos ironisch
ytdl_podcast_urls:
- https://sternengeschichten.podigee.io/feed/aac # Sternengeschichten
- https://feeds.br.de/radiowissen/feed.xml # BR2 RadioWissen
ytdl_video_output: "/shares_videos/Youtube/%(uploader)s/%(title)s-%(id)s.%(ext)s" # Videos werden jetzt IMMEr nach "Uploader/Name.ext" geschrieben ytdl_video_output: "/shares_videos/Youtube/%(uploader)s/%(title)s-%(id)s.%(ext)s" # Videos werden jetzt IMMER nach "Uploader/Name.ext" geschrieben
ytdl_enable_video_download: true
ytdl_enable_podcast_download: false
ytdl_podcast_output: "/shares_music/Podcasts/%(playlist)s/%(id)s.%(ext)s" ytdl_podcast_output: "/shares_music/Podcasts/%(playlist)s/%(id)s.%(ext)s"
ytdl_video_log_output: "/shares_videos/Youtube/archive-youtube.log" ytdl_video_log_output: "/shares_videos/Youtube/archive-youtube.log"

View file

@ -35,3 +35,6 @@ ytdl_youtube_password: "{{ lookup('keepass', 'youtubedl_youtube_login', 'passwor
ytdl_conf_dir: "/etc/youtubedl" #ohne / am ende ytdl_conf_dir: "/etc/youtubedl" #ohne / am ende
ytdl_download_limit: "10000K" ytdl_download_limit: "10000K"
ytdl_active: false # damit werden die systemd-Units nicht angelegt ytdl_active: false # damit werden die systemd-Units nicht angelegt
ytdl_enable_video_download: true
ytdl_enable_podcast_download: false

View file

@ -24,19 +24,29 @@
group: root group: root
mode: "0755" mode: "0755"
- name: template youtubedl config - name: template youtubedl video config
become: true become: true
ansible.builtin.template: ansible.builtin.template:
src: "{{ item }}" src: youtube.txt
dest: "{{ ytdl_conf_dir }}/{{ item }}" dest: "{{ ytdl_conf_dir }}/youtube.txt"
owner: root owner: root
group: root group: root
mode: "0644" mode: "0644"
notify: notify:
- systemctl daemon-reload - systemctl daemon-reload
loop: when: ytdl_enable_video_download
- podcast.txt
- youtube.txt - name: template youtubedl podcast config
become: true
ansible.builtin.template:
src: podcast.txt
dest: "{{ ytdl_conf_dir }}/podcast.txt"
owner: root
group: root
mode: "0644"
notify:
- systemctl daemon-reload
when: ytdl_enable_podcast_download
- name: template systemd services - name: template systemd services
become: true become: true
@ -84,3 +94,22 @@
notify: notify:
- systemctl daemon-reload - systemctl daemon-reload
when: ytdl_active when: ytdl_active
- name: ensure youtubedl video config is absent
become: true
ansible.builtin.file:
state: absent
path: "{{ ytdl_conf_dir }}/youtube.txt"
notify:
- systemctl daemon-reload
when: not ytdl_enable_video_download
- name: ensure youtubedl podcast config is absent
become: true
ansible.builtin.file:
state: absent
path: "{{ ytdl_conf_dir }}/podcast.txt"
notify:
- systemctl daemon-reload
when: not ytdl_enable_podcast_download
...

View file

@ -6,8 +6,12 @@ OnFailure=youtubedl_mail.service
[Service] [Service]
Type=oneshot Type=oneshot
{% if ytdl_enable_podcast_download is sameas true %}
ExecStart=-{{ ytdl_bin_path }} --config-location "{{ ytdl_conf_dir }}/podcast.txt" 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" ExecStart=-{{ ytdl_bin_path }} --config-location "{{ ytdl_conf_dir }}/youtube.txt"
{% endif %}
Restart=on-failure Restart=on-failure
RestartSec=10min RestartSec=10min