Last active
January 11, 2020 01:42
-
-
Save furkanmustafa/38a8cabe2ef69d92acea to your computer and use it in GitHub Desktop.
Simple script to watch streaming videos with mpv and youtube-dl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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