#!/bin/bash # From http://blog.mpshouse.com/?p=855 # @ prompt, enter URL or just the video code from the URL # example: https://www.youtube.com/watch?v=gWiMZkntIbk or gWiMZkntIbk echo "youtube-dl helper" echo "=================" echo -n "video to download: " read video echo "getting video filename..." filename=$(youtube-dl --get-filename -o "%(title)s.%(ext)s" $video) echo "getting available video formats..." youtube-dl -F $video echo "file to download is '"$filename"'..." echo -n "video format: " read format echo "downloading video..." youtube-dl -v -f $format -o "%(title)s.%(ext)s" $video echo "download complete."