git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/ansible/mio/bin/mio
blob: 1362c8c265e78babd9be6c4eb4d3c4b5e960bd88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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"