Advertisement
v1ral_ITS

bash wrapper script that prompts for the format [youtube-dl]

Aug 6th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.75 KB | None | 0 0
  1. ######################
  2. # START #  v1ral_ITS #
  3. ######################
  4.  
  5. A bash wrapper script that prompts for the format, which includes all available renditions, including audio-only, video-only.
  6.  
  7. Accepts both absolute youtube URLs and video IDs.
  8.  
  9. ############################################################################################################################
  10.  
  11. #!/usr/bin/env bash
  12. # Download youtube video with desired quality
  13.  
  14. # youtube-dl accepts both fully qualified URLs and video id's such as AQcQgfvfF1M
  15.  
  16. url="$*"
  17.  
  18. echo "Fetching available formats for $url..."
  19. youtube-dl -F "$url"
  20. read -p "Please enter the desired quality code: " FORMAT
  21.  
  22. echo "Streaming with quality $FORMAT..."
  23. mpv --cache=1024 $(youtube-dl -f $FORMAT -g "$url")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement