Youtube Playlist HTML Auto generation
This is an auto generator the html for http://rpkim.net/music.html
website page. Getting the playlist in my Youtube and generate the listing of music in my playlist.
Pre-required
- Google API Enabled (Youtube Data API)
jq
should be installedhttpie
should be installed- $GKEY environment variable should be setup
commands
-
get the playlist and id http https://www.googleapis.com/youtube/v3/playlists\?part\=id,snippet\&channelId\=UChzBpM82OyuJAzD6BP7YL1A\&key\=$GKEY | jq . | jq -r ".items[] | .id, .snippet.title"
-
get the data export PLAYLIST=PLv_pQy9nXvGUbbAhqjRaXJa3pnJ2rZQyx http GET https://www.googleapis.com/youtube/v3/playlistItems\?part\=snippet,contentDetails\&playlistId\=$PLAYLIST\&key\=$GKEY\&maxResults\=50 | jq . | jq .nextPageToken => CDIQAA export TOKEN=CDIQAA http GET https://www.googleapis.com/youtube/v3/playlistItems\?part\=snippet,contentDetails\&playlistId\=$PLAYLIST\&key\=$GKEY\&maxResults\=50 | jq . | jq -r ".items[] | .snippet.title" > p1 http GET https://www.googleapis.com/youtube/v3/playlistItems\?part\=snippet,contentDetails\&playlistId\=$PLAYLIST\&key\=$GKEY\&maxResults\=50&pageToken=$TOKEN | jq . | jq .nextPageToken http GET https://www.googleapis.com/youtube/v3/playlistItems\?part\=snippet,contentDetails\&playlistId\=$PLAYLIST\&key\=$GKEY\&maxResults\=50&pageToken=$TOKEN | jq . | jq -r ".items[] | .snippet.title" >> p1 awk '{ print NR, $0, "
" }' p1