Skip to content

Instantly share code, notes, and snippets.

@furkanmustafa
Last active January 11, 2020 01:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save furkanmustafa/38a8cabe2ef69d92acea to your computer and use it in GitHub Desktop.
Save furkanmustafa/38a8cabe2ef69d92acea to your computer and use it in GitHub Desktop.
Simple script to watch streaming videos with mpv and youtube-dl
#!/bin/sh -e
#
# Public domain
# Author: roman [] tsisyk.com
# Modified By: furkan [] s2n.io 2014.10.19, added cache parameter and deleting cookie file
#
# Usage: ./me url [youtube-dl parameters]
#
TMPDIR=/tmp
COOKIE_FILE=$TMPDIR/youtube-dl-cookies.txt
# CACHE_SIZE is in KBs
CACHE_SIZE=2048
VIDEO_URL=$(youtube-dl -g --cookies ${COOKIE_FILE} $*)
mpv -cache ${CACHE_SIZE} -cookies -cookies-file ${COOKIE_FILE} ${VIDEO_URL}
rm ${COOKIE_FILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment