IssyPutchy

Simple bash script for Tasker to download YouTube videos

May 16th, 2019
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.41 KB | None | 0 0
  1. #!/data/data/com.termux/files/bin/sh
  2.  
  3. downloader=youtube-dl
  4. url="$1"
  5. path=/sdcard/Video/YouTube
  6. title=$($downloader -e $url)
  7.  
  8.  
  9.  termux-setup-storage
  10.  mkdir -p $path
  11.  touch $path/.nomedia
  12.  
  13.    if $downloader -o $path/"$title".mp4 $url; then
  14.     am broadcast --user 0 -a tasker.runtask -e name "YTPass"
  15.     sleep 3
  16.    else
  17.     am broadcast --user 0 -a tasker.runtask -e name "YTFail"
  18.     sleep 3
  19.    fi
Add Comment
Please, Sign In to add comment