Skip to content

Commit

Permalink
gui: improve youtube-dl update-check, to close #19
Browse files Browse the repository at this point in the history
  • Loading branch information
Botspot committed Mar 8, 2022
1 parent ccad35f commit 002423e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gui
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ check() {
fi

#youtube-dl
if ! command -v youtube-dl >/dev/null || [ ! -z "$(youtube-dl -v 2>&1 | grep '2019\|2020')" ] || [ ! -z "$(youtube-dl -v 2>&1 | grep 'youtube-dl version 2021.01.08')" ] || [ "$(stat --printf="%s" $(command -v youtube-dl))" -ge 2000 ];then
if ! command -v youtube-dl >/dev/null || [ "$(date +%s -d "$(youtube-dl --version | tr '.' '/')")" -lt "$(date +%s -d "2021.12.17")" ];then
echo "Installing youtube-dl..."

if dpkg -l youtube-dl &>/dev/null ;then
sudo apt purge -y youtube-dl
fi

sudo rm -f /usr/bin/youtube-dl #in case youtube-dl is installed to /usr/bin, delete it so pip3 succeeds to uninstall youtube-dl below
sudo pip3 uninstall youtube_dl
command -v pip && sudo pip uninstall youtube_dl
sudo pip3 uninstall -y youtube_dl
command -v pip && sudo pip uninstall -y youtube_dl
sudo pip3 install youtube_dl
if [ -z "$(youtube-dl 2>&1)" ];then
error "youtube-dl should be installed now by pip3, but youtube-dl command not found!"
Expand Down

0 comments on commit 002423e

Please sign in to comment.