]> Sergey Matveev's repositories - dotfiles.git/blobdiff - youtube-dl/bin/yt
Automatically prepend youtube URL
[dotfiles.git] / youtube-dl / bin / yt
index 7cd537244a2354fb062907ac77ae3b8dd07d5cfc..174f043e064c4e1132fda72c8113907be5a4e27c 100755 (executable)
@@ -1,5 +1,7 @@
 #!/usr/local/bin/zsh
 
-. /usr/local/bin/virtualenvwrapper.sh
-workon youtube
-yt-dlp --config-location ~/.youtube-dl.conf $@
+. ~/work/youtube-venv/bin/activate
+url=${@[${#@}]}
+args=(${@[1,${#@}-1]})
+[[ ${#url} -eq 11 ]] && url=https://www.youtube.com/watch?v=$url
+yt-dlp --config-location ~/.youtube-dl.conf ${=args} $url