v1ral_ITS

terminal download shell script

Oct 3rd, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.93 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Script Function
  4. url () {
  5.     printf '\033[033mURL: \033[m'
  6.     echo $*
  7. }
  8.  
  9. #//+ ITS_ function to easily check the,
  10. #// operating systems presense of any needed package.
  11.  
  12. #/#/ Define any tools needed here seperated only by a "\:space:"\
  13. needed_tool=' youtube-dl aria2c '
  14.  
  15. #//* Begin System Tool Search
  16. require_tools ()
  17. {
  18.     local NOT_AVAIL=""
  19.     for TOOL in $needed_tool; do
  20.         if [ "`which $TOOL 2> /dev/null`" == "" ]; then NOT_AVAIL="$NOT_AVAIL $TOOL"; fi
  21.     done
  22.     if [[ "$NOT_AVAIL" != "" ]]; then
  23.         echo "ERROR: The following required tool(s) cannot be found: $NOT_AVAIL"
  24.         exit 3
  25.     fi
  26. }
  27.  
  28. # Check file system tools before we start
  29. require_tools
  30.  
  31. # Script Variables
  32. FILE=`echo "youtube-dl -c -i --yes-playlist --ignore-config --external-downloader aria2c"`
  33. FILE_1=`echo $FILE > /tmp/termdl`
  34. FILE_DL=`cat /tmp/termdl`
  35.  
  36. # Start
  37. # echo -e "Copy Paste Videos/URL:"
  38. url
  39. read URL
  40. $FILE_DL "$URL"
  41.  
  42. # Finish and exit
  43. exit
Add Comment
Please, Sign In to add comment