19 lines
654 B
Plaintext
19 lines
654 B
Plaintext
|
#!/bin/bash
|
||
|
title=$(curl https://www.youtube.com/feeds/videos.xml?playlist_id=${get_data[id]} | grep title | head -n 1 | sed -s 's/ <title>//;s/<\/title>//')
|
||
|
meta[title]=$title
|
||
|
source templates/head.sh
|
||
|
|
||
|
if [[ ${get_data[id]} ]]; then
|
||
|
data=$(youtube-dl -j --flat-playlist https://www.youtube.com/playlist?list=${get_data[id]})
|
||
|
else
|
||
|
echo "Please specify either `id`"
|
||
|
return
|
||
|
fi
|
||
|
|
||
|
IFS=$'\n'
|
||
|
video_title=($(jq -r '.title' <<< $data))
|
||
|
video_id=($(jq -r '.id' <<< $data))
|
||
|
|
||
|
for (( i=0; i<${#video_id[@]}; i++ )); do
|
||
|
echo "<a href='watch.shs?v=${video_id[$i]}'><img src='http://i.ytimg.com/vi/${video_id[$i]}/mqdefault.jpg'><br>${video_title[$i]}</a><br>"
|
||
|
done
|