Skip to content

Instantly share code, notes, and snippets.

@i3p9
Created August 7, 2019 22:44
Show Gist options
  • Save i3p9/12896ee624b281d6140f52fce7fbfd85 to your computer and use it in GitHub Desktop.
Save i3p9/12896ee624b281d6140f52fce7fbfd85 to your computer and use it in GitHub Desktop.
Setup Youtube-dl env on Termux Android (Downloads via Share sheet on youtube app)
#!/bin/bash
echo $'\n'
echo '===Step 1 of 3: Asking for Storage Permission==='
sleep 2;
termux-setup-storage
sleep 2;
echo '===Step 1 of 3 Completed==='
sleep 1;
echo '===Step 2 of 3: Updating/Installing dependencies==='
echo '===Updating and installing python, curl, ffmpeg. atomicparsley and youtub-dl==='
echo '===This might take a while, depending on your internet connection...==='
sleep 3;
pkg up -y
pkg install python -y
pkg install ffmpeg -y
pkg install atomicparsley -y
pip install youtube-dl
echo $'\n'
sleep 1;
echo '===Step 2 Completed==='
echo '===Step 3 of 3: Creating YoutubeDL folder and linking it to Share Sheet==='
echo $'.\n.\n.\n'
mkdir /data/data/com.termux/files/home/storage/shared/Youtube
mkdir -p ~/.config/youtube-dl
cd ~/.config/youtube-dl
echo $'--no-mtime \n-o /data/data/com.termux/files/home/storage/shared/Youtube/%(title)s.%(ext)s \n-f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4" \n--embed-thumbnail \n--add-metadata' >config
mkdir ~/bin
cd ~/bin
echo $'youtube-dl $1' >termux-url-opener
echo '===All DONE.==='
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment