Last active
November 13, 2019 01:42
-
-
Save cpylua/f7d1c6e5c22f5e0aa24349a8a20742c4 to your computer and use it in GitHub Desktop.
youtube-dl on termux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage: | |
# 1. Open a Termux session | |
# 2. Copy and run the below command in Termux | |
# source <(curl -s "https://gist.githubusercontent.com/cpylua/f7d1c6e5c22f5e0aa24349a8a20742c4/raw/setup-youtube-dl.sh?t=$(date +%s)") | |
pkg update && pkg upgrade && pkg install python ffmpeg | |
pip install --upgrade pip && pip install youtube-dl | |
# it will ask for storage permission | |
termux-setup-storage | |
# config youtube-dl | |
mkdir -p /data/data/com.termux/files/home/storage/shared/youtube-dl | |
mkdir -p ~/.config/youtube-dl | |
cat << EOF > ~/.config/youtube-dl/config | |
--no-mtime | |
--restrict-filenames | |
-o /data/data/com.termux/files/home/storage/shared/youtube-dl/%(title)s-%(id)s.%(ext)s | |
EOF | |
# create share handler | |
mkdir -p ~/bin | |
cat << "EOF" > ~/bin/termux-url-opener | |
youtube-dl $1 | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using
%(title)s
may causefilename too long
error when downloading some video.