diff options
Diffstat (limited to 'ansible/mio/bin')
-rwxr-xr-x | ansible/mio/bin/mio | 15 |
1 files changed, 15 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" |