D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

[LUG] Online video stream playback problems: fixed


Rather than relying on your browser, its media playback plugin(s) and your internet connection all being on song together, try this. Takes longer to start but gives you smooth playback. Works for lots of sites, not just YouTube.

1. Use your package manager to install 'youtube-dl' and 'vlc'

2. Put this in a shell script in your PATH called something like ~/bin/ytdp:

#!/usr/bin/env bash

cd ~/Desktop
# ... or ~/Downloads or ~/tmp or just ~

# Precompute the downloaded video file's name
dled_video_file=`youtube-dl --get-filename "$1"`

# Do the download
youtube-dl "$1"

# Play the video
vlc --fullscreen --play-and-exit "$dled_video_file"

# Uncomment if you don't want to keep the download
# rm "$dled_video_file"


3. Copy your video's URL (eg http://youtube.com/?v=whatever) and pass it in via a terminal command line, or xdotool, or your application menu's "Run..." item. NB Surround ("escape") the URL with single quotes to prevent characters like '?' from being expanded.


Phil Hudson                  http://hudson-it.no-ip.biz
@UWascalWabbit                 PGP/GnuPG ID: 0x887DCA63
The Mailing List for the Devon & Cornwall LUG
FAQ: http://www.dcglug.org.uk/listfaq