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