Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.