youtube-dl: Update Scripts by wget & curl

youtube-dl: Update Scripts by wget & curl

 

#!/bin/sh
# YouTube-DL installation notes
# https://github.com/rg3/youtube-dl/blob/master/README.md#readme

function getByCurl(){
 sudo cd /usr/bin
 sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/bin/youtube-dl
 sudo chmod a+rx /usr/bin/youtube-dl
 youtube-dl --version
 read -p "Press ENTER to continue" paused
 
}

function getByWget(){
# Can use WGET alternatively
#sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
#sudo chmod a+rx /usr/local/bin/youtube-dl
 sudo cd /usr/bin
 sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/bin/youtube-dl
 sudo chmod a+rx /usr/bin/youtube-dl
 youtube-dl --version
 read -p "Press ENTER to continue" paused
 
}

function moveYtdl(){
    mv /usr/bin/youtube-dl /usr/bin/youtube-dl.bak
}

read -p "Updating youtube-dl, Press ENTER to continue" paused
read -p "moving youtube-dl, Press ENTER to continue" paused
moveYtdl
read -p "Updating youtube-dl, Press ENTER to continue" paused
getByWget
read -p "DONE...Press ENTER to continue" paused