diff options
Diffstat (limited to 'ansible/mio')
-rwxr-xr-x | ansible/mio/bin/mio | 15 | ||||
-rw-r--r-- | ansible/mio/lib/mio.lst | 25 | ||||
-rw-r--r-- | ansible/mio/systemd/mio.service | 11 | ||||
-rw-r--r-- | ansible/mio/systemd/mio.timer | 10 |
4 files changed, 61 insertions, 0 deletions
diff --git a/ansible/mio/bin/mio b/ansible/mio/bin/mio new file mode 100755 index 0000000..1362c8c --- /dev/null +++ b/ansible/mio/bin/mio @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +YOUTUBE="https://www.youtube.com/watch?v=" +MYTGT="/tmp/mio" +MYMIOCOLL="/var/lib/mio/mio.lst" + +rm -vf "$MYTGT"* + +MYLINES="$(wc -l "$MYMIOCOLL"|awk '{print $1}')" +MYMIO="$(head -n "$((RANDOM%$MYLINES+1))" "$MYMIOCOLL"|tail -n1)" +unset MYLINES MYMIOCOLL +MYMIOTUBE="${YOUTUBE}${MYMIO}" +unset MYMIO +#echo "$MYMIOTUBE" +youtube-dl --write-description --write-info-json -o "/tmp/mio.%(ext)s" "$MYMIOTUBE" diff --git a/ansible/mio/lib/mio.lst b/ansible/mio/lib/mio.lst new file mode 100644 index 0000000..40dc3c6 --- /dev/null +++ b/ansible/mio/lib/mio.lst @@ -0,0 +1,25 @@ +lEJHOzT61I0 +B8p_7Crbsgg +z0CG-vEXeAU +aqQrzPicRks +YnDUcCIAcn4 +h9s_opMmWi8 +-GglKl6RBqk +6UeFcJzVgjk +aIhY_xflSS0 +Q27ksVybWbc +7O0JL1dAH40 +jsh7podkEko +4iZRCfRAGZk +9ugHfj9OT2k +z0CG-vEXeAU +2Pn-rr_oNTs +cNOGSa6YiIo +XRuwCLUK7P4 +vP08CJFgPcw +Xh95JisAGzg +is7LiAyw1_c +U-VIEJGTnTk +aeIpNfjDzPI +Jnu_-jg5Xnc +Ubtcib0Xk2E diff --git a/ansible/mio/systemd/mio.service b/ansible/mio/systemd/mio.service new file mode 100644 index 0000000..4cee4e9 --- /dev/null +++ b/ansible/mio/systemd/mio.service @@ -0,0 +1,11 @@ +[Unit] +Description=Alder Snake de Nävigän vum Eastsides Gewächs +After=network.target dbus.target +Wants=network-online.target + +[Service] +Type = oneshot +RemainAfterExit = no +ExecStart = /usr/local/bin/mio +User=mio +Group=mio diff --git a/ansible/mio/systemd/mio.timer b/ansible/mio/systemd/mio.timer new file mode 100644 index 0000000..66c8ae0 --- /dev/null +++ b/ansible/mio/systemd/mio.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Alder Snake de Nävigän vum Eastsides Gewächs +Wants=network-online.target + +[Timer] +OnCalendar=Mon,Tue,Wed,Thu,Fri 07..18:00:00 +RandomizedDelaySec=900 + +[Install] +WantedBy=timers.target |