karim0209

Termux-url-opener kk

Jun 8th, 2018
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.67 KB | None | 0 0
  1. #!/data/data/com.termux/files/usr/bin/bash
  2.  
  3. echo "For audio only      press 1"
  4. echo "For video 360p      press 2"
  5. echo "For video 480p      press 3"
  6. echo "For video 720p(MHD) press 4"
  7. echo "For video 1080p(HD) press 5"
  8. echo "For video 1440p(QHD)press 6"
  9. echo "For video 2160p(4K) press 7"
  10. echo "For video format    press 8"
  11.  
  12. command='-no-mtime -o /data/data/com.termux/files/home/storage/shared/Youtube/%(title)s.%(ext)s -i'
  13. read option
  14.  
  15. if [ "$option" -eq "1" ]
  16. then
  17.     echo "$command -f 140 --embed-thumbnail" > ~/.config/youtube-dl/config
  18.     youtube-dl $1
  19.  
  20. elif [ "$option" -eq "2" ]
  21. then
  22.     echo "$command -f \"best[height<=360][ext=mp4]\"" > ~/.config/youtube-dl/config
  23.     youtube-dl $1
  24.  
  25. elif [ "$option" -eq "3" ]
  26. then
  27.     echo "$command -f \"best[height<=480][ext=mp4]\"" > ~/.config/youtube-dl/config
  28.     youtube-dl $1
  29.  
  30. elif [ "$option" -eq "4" ]
  31. then
  32.     echo "$command -f \"best[height<=720][ext=mp4]\"" > ~/.config/youtube-dl/config
  33.     youtube-dl $1
  34.  
  35. elif [ "$option" -eq "5" ]
  36. then
  37.     echo "$command -f \"best[height<=1080][ext=mp4]\"" > ~/.config/youtube-dl/config
  38.     youtube-dl $1
  39.  
  40. elif [ "$option" -eq "6" ]
  41. then
  42.     echo "$command -f \"best[height<=1440][ext=mp4]\"" > ~/.config/youtube-dl/config
  43.     youtube-dl $1
  44.  
  45. elif [ "$option" -eq "7" ]
  46. then
  47.     echo "$command -f \"best[height<=2160][ext=mp4]\"" > ~/.config/youtube-dl/config
  48.     youtube-dl $1
  49.  
  50. elif [ "$option" -eq "8" ]
  51. then
  52.     echo -e "available video formats \n"
  53.     echo "$command -F" > ~/.config/youtube-dl/config
  54.     youtube-dl $1
  55.     echo -e "Enter video format \n"
  56.     read num
  57.     echo "$command -f '$num'" > ~/.config/youtube-dl/config
  58.     youtube-dl $1
  59. fi
Add Comment
Please, Sign In to add comment