#!/usr/bin/env bash

function yt() {
  if [[ $IS_WSL == "1" ]]; then
    url=$(paste.exe)
    echo "Downloading $url"
    youtube-dl.exe "$url"
  else
    url=$(xsel -o)
    echo "Downloading $url"
    if [[ $(command -v "aria2c" &> /dev/null) ]]; then
      youtube-dl --external-downloader=aria2c "$url"
    else
      youtube-dl "$url"
    fi
  fi
}

#!/usr/bin/env bash

function yt() {
  if [[ $IS_WSL == "1" ]]; then
    url=$(win32yank.exe -o)
    echo "Downloading $url"
    youtube-dl.exe "$url"
  else
    url=$(xsel -o)
    echo "Downloading $url"
    youtube-dl "$url"
  fi
}

--- 
+++ 
@@ -2,12 +2,16 @@
 
 function yt() {
   if [[ $IS_WSL == "1" ]]; then
-    url=$(win32yank.exe -o)
+    url=$(paste.exe)
     echo "Downloading $url"
     youtube-dl.exe "$url"
   else
     url=$(xsel -o)
     echo "Downloading $url"
-    youtube-dl "$url"
+    if [[ $(command -v "aria2c" &> /dev/null) ]]; then
+      youtube-dl --external-downloader=aria2c "$url"
+    else
+      youtube-dl "$url"
+    fi
   fi
 }
Update youtube-dl script to support aria2c

To improve the download speeds and reliability support aria2c if it is
installed.  Also switch script to use the paste.exe file I distribute
onto windows machines.
