Skip to content

Commit

Permalink
feat: change to yt-dlp
Browse files Browse the repository at this point in the history
  • Loading branch information
OzakIOne committed Oct 8, 2021
1 parent afa3412 commit 1b70974
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
5 changes: 4 additions & 1 deletion .ytdl.conf
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
28 changes: 14 additions & 14 deletions share2youtubedl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 1b70974

Please sign in to comment.