Delete yt-m3u

This commit is contained in:
Daniel Løvbrøtte Olsen 2018-09-27 14:19:20 +00:00 committed by Joakim Pettersvold
parent 59c840c31d
commit 178253d547
1 changed files with 0 additions and 29 deletions

29
yt-m3u
View File

@ -1,29 +0,0 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
function get_duration {
preconvert=$(youtube-dl --get-duration -- "$1" | perl -p -i -e 's/(\d\d?):(\d\d)/$1 minutes+$2 seconds/' 2> /dev/null)
convert=$(units "$preconvert")
stripped=$(echo "$convert" | grep -o '[0-9]*')
echo "$stripped"
}
function get_title {
result=$(youtube-dl --get-title -- "$1")
echo "$result"
}
function makeline {
duration=$(get_duration "$1")
title=$(get_title "$1")
echo "#EXTINF:$duration:$title"
}
videos=$(youtube-dl --get-id "$1")
videos=($videos)
for i in "${videos[@]}"; do
makeline "$i"
echo "ffmpeg2wav:youtube-dl:$i"
done