From dd31b74a17437ab4268fbb7d358e304dadfe34fc Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sat, 12 Mar 2016 09:32:57 -0800 Subject: [PATCH] simple yt command and stuff --- home/streamcrap | 13 ++++++++++++- home/zshrc | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/home/streamcrap b/home/streamcrap index 804fd58..0b5ef03 100644 --- a/home/streamcrap +++ b/home/streamcrap @@ -46,7 +46,7 @@ watchstream1() { mpv $=REPLY "$url" else # bash syntax - mpv $=REPLY "$url" + mpv $REPLY "$url" fi } @@ -79,4 +79,15 @@ hitbox() { watchstream "http://hitbox.tv/$user" "$@" } +yt() { + local vid="$1" + # can't be bothered to use substrings since they differ across bash/zsh + if [[ "$(head -c4 <<< "$vid")" != "http" ]]; then + vid="https://www.youtube.com/watch?v=$vid" + fi + mpv --af=lavfi="[$_M_PROCESS]" \ + --audio-samplerate=44100 --audio-format=s16 \ + --ytdl-format=22,best "$vid" +} + _nn= diff --git a/home/zshrc b/home/zshrc index ab7c123..9090ab1 100644 --- a/home/zshrc +++ b/home/zshrc @@ -126,7 +126,7 @@ alias -g STFU="2>/dev/null" for x in ack cd cp ebuild gcc gist grep ln man mkdir mv rm alias $x="nocorrect $x" -for x in arith curl fc find ftp history let locate rsync scp sftp wget +for x in arith curl fc find ftp history let locate rsync scp sftp wget twitch hitbox yt alias $x="noglob $x" if [[ "$TERM" = xterm* ]]; then