2013-10-19 22:22:06 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Example of script for using mpv with youtube-dl
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cookies_dir="$(mktemp -d /tmp/youtube-dl_mpv.XXXX)"
|
|
|
|
cookies_file="${cookies_dir}/cookies"
|
|
|
|
user_agent="$(youtube-dl --dump-user-agent)" # or set whatever you want
|
|
|
|
|
|
|
|
video_url="$(youtube-dl \
|
|
|
|
--user-agent="$user_agent" \
|
|
|
|
--cookies="$cookies_file" \
|
|
|
|
--get-url \
|
2014-08-29 18:20:29 +00:00
|
|
|
"$@")"
|
2013-10-19 22:22:06 +00:00
|
|
|
|
2014-08-30 16:29:48 +00:00
|
|
|
set -f
|
2014-08-30 16:30:21 +00:00
|
|
|
${MPV:-mpv} \
|
2013-10-19 22:22:06 +00:00
|
|
|
--cookies \
|
|
|
|
--cookies-file="$cookies_file" \
|
|
|
|
--user-agent="$user_agent" \
|
2014-08-29 18:20:29 +00:00
|
|
|
-- $video_url
|
2013-10-19 22:22:06 +00:00
|
|
|
|
|
|
|
rm -rf "$cookies_dir"
|