Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ "$#" -lt 1 ] ; then
- echo "\t\tUsage: $0 \"YouTubeURL\"";
- exit 0;
- fi
- # This next line is for if you have hdmi audio out:
- #plparams="-o hdmi" # uncomment if you are using hdmi audio out.
- #python youtube-dl.py --format 38/37/46/22/35/34/18/6/5/17/13 -c -t $1 # this gives filename-id.mp4
- python youtube-dl.py --format 38/37/46/22/35/34/18/6/5/17/13 -c -o "%(stitle)s.%(ext)s" $1 # Cleaner filename.mp4
- # the reason I only allow for one argument (above) is because having more than one will confuse my fname (below).
- fname="`python youtube-dl.py --get-filename --format 38/37/46/22/35/34/18/6/5/17/13 -c -o "%(stitle)s.%(ext)s" $1`"
- #echo $fname # this just prints out the filename
- omxplayer $plparams "$fname"
- #rm "$fname" # uncomment this if you want it to delete the video once you have finished watching it.
- # Instead of using youtube-dl you could just use get_flash_videos:
- #get_flash_videos --play --player "omxplayer $plparams" $*
Add Comment
Please, Sign In to add comment