Kodi Community Forum

Full Version: Linux bash script to create strm files from a youtube playlist and take screenshots
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have now updated my previous effort to a new bash script that not only generates .stream files for the youtube add on it now also takes screenshots for kodi episode thumbnails. Just save the below code to a text file change permissions to run as an application.


read -p "Enter Youtube URL:" url
read -p "ScreenShot Time (1-60min): " time

youtube-dl -i -j --flat-playlist $url |
jq -r --tab '.title + "\t" + "plugin://plugin.video.youtube/play/?video_id=" + .id' |
awk '{f=$1".strm"; print $2 >f}' FS='\t' |
youtube-dl -f mp4 -g $url |
parallel -I %% ffmpeg -ss "00:$time:00.000" -i %% -vframes 1 -q:v 2 -y {#}.png
After playing around with linux cmd line I was at last able to achieve what I wanted

youtube-dl -i --playlist-reverse -j --flat-playlist 'https://www.youtube.com/channel/UCosWOTQyKE0tN1qE4Ah80Og' | jq -r --tab '.title + "\t" + "plugin://plugin.video.youtube/play/?video_id=" + .id' | awk '{f=$1".strm"; print $2 >f}' FS='\t'

This command line creates video name.strm files from a playlist