From 1b709749b654bf652e006bd27265ccbd398dccc6 Mon Sep 17 00:00:00 2001 From: ozakione <29860391+OzakIOne@users.noreply.github.com> Date: Fri, 8 Oct 2021 22:56:25 +0200 Subject: [PATCH] feat: change to yt-dlp --- .ytdl.conf | 5 ++++- README.md | 2 +- install.sh | 6 +++--- share2youtubedl.sh | 28 ++++++++++++++-------------- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.ytdl.conf b/.ytdl.conf index 4f108c8..a101663 100644 --- a/.ytdl.conf +++ b/.ytdl.conf @@ -1,2 +1,5 @@ --no-mtime --o /data/data/com.termux/files/home/storage/shared/Youtube-DL/%(title)s.%(ext)s +--embed-metadata +--restrict-filenames +-P "/data/data/com.termux/files/home/storage/shared/Youtube-DL/" +-o "%(title)s.%(ext)s" diff --git a/README.md b/README.md index 1711acf..83122ec 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Bash script to setup youtube-dl in termux 1. Download [termux](https://play.google.com/store/apps/details?id=com.termux&hl=fr&gl=US) 2. Open termux & copy paste this : - `curl -L https://raw.githubusercontent.com/OzakIOne/termux-youtube-dl/v1.0.1/install.sh | bash` + `curl -L https://raw.githubusercontent.com/OzakIOne/termux-youtube-dl/v1.0.2/install.sh | bash` ## How to use diff --git a/install.sh b/install.sh index 3c547f6..c29588d 100644 --- a/install.sh +++ b/install.sh @@ -20,13 +20,13 @@ termux-setup-storage sleep 2 apt-get update apt-get -y install python ffmpeg -pip install youtube-dl +pip install yt-dlp mkdir -p $YOUTUBEDL_OUTPUT_FOLDER mkdir -p $YOUTUBEDL_CONFIG_FOLDER mkdir -p $TERMUXURLOPENER_CONFIG_FOLDER # Download setup & config file -curl -L https://raw.githubusercontent.com/OzakIOne/termux-youtube-dl/v1.0.1/.ytdl.conf > "${YOUTUBEDL_CONFIG_FOLDER}/config" -curl -L https://raw.githubusercontent.com/OzakIOne/termux-youtube-dl/v1.0.1/share2youtubedl.sh > "${TERMUXURLOPENER_CONFIG_FOLDER}/termux-url-opener" +curl -L https://raw.githubusercontent.com/OzakIOne/termux-youtube-dl/v1.0.2/.ytdl.conf > "${YOUTUBEDL_CONFIG_FOLDER}/config" +curl -L https://raw.githubusercontent.com/OzakIOne/termux-youtube-dl/v1.0.2/share2youtubedl.sh > "${TERMUXURLOPENER_CONFIG_FOLDER}/termux-url-opener" echo -e "${BLUE}Congratulations!!! Your setup is complete.\n\n" read -p "When you are ready just press enter" diff --git a/share2youtubedl.sh b/share2youtubedl.sh index a666c69..1d667bd 100644 --- a/share2youtubedl.sh +++ b/share2youtubedl.sh @@ -2,20 +2,20 @@ clear if [[ "$1" =~ ^.*youtu.*$ ]] || [[ "$1" =~ ^.*youtube.*$ ]]; then - echo -e "Downloading video...\\n>URL: ${1}\\n" - youtube-dl -F "$1" - read -p "Choose your video quality (press enter for: 'best') : " video - read -p "Choose your audio quality (press enter for: 'best') : " audio - if [[ "$video" = "" ]]; then - video="best" - fi - if [[ "$audio" = "" ]]; then - audio="best" - fi - youtube-dl -f "$video"+"$audio" "$1" -elif [[ "$1" =~ ^.*nourlselected.*$ ]]; then - echo "There was an error" -else youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' "$1" + echo -e "Downloading video...\\n>URL: ${1}\\n" + yt-dlp -F "$1" + read -p "Choose your video quality (press enter for: 'best') : " video + read -p "Choose your audio quality (press enter for: 'best') : " audio + if [[ "$video" = "" ]]; then + video="best" + fi + if [[ "$audio" = "" ]]; then + audio="best" + fi + yt-dlp -f "$video"+"$audio" "$1" + elif [[ "$1" =~ ^.*nourlselected.*$ ]]; then + echo "There was an error" +else yt-dlp -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' "$1" fi read -p "Press enter to continue"