2020-04-16 20:15:37 +02:00
|
|
|
[//]: # "Ctrl+K,V o Ctrl+Shift+V - Para ver vista previa en VSCode"
|
|
|
|
|
2020-04-16 20:26:08 +02:00
|
|
|
Tutorial to fast install [youtube-dl](https://github.com/ytdl-org/youtube-dl/) in android and configure it to download any url shared to it.
|
|
|
|
|
|
|
|
*Based on https://www.reddit.com/r/Piracy/comments/baufql/youtubedl_the_easy_way_on_android/*
|
2020-04-16 20:15:37 +02:00
|
|
|
|
2020-04-16 20:47:46 +02:00
|
|
|
1. [Install and configure youtube-dl](#Install-and-configure-youtube-dl)
|
|
|
|
2. [Extras](#Extras)
|
|
|
|
3. [All-In-One](#All-In-One)
|
2020-04-16 20:15:37 +02:00
|
|
|
|
2020-04-16 20:47:46 +02:00
|
|
|
# Install Termux
|
2020-04-16 20:15:37 +02:00
|
|
|
https://termux.com/
|
|
|
|
|
2020-04-16 21:22:49 +02:00
|
|
|
# Open Termux and run one of these:
|
2020-04-16 20:15:37 +02:00
|
|
|
|
2020-04-16 20:47:46 +02:00
|
|
|
## Install and configure youtube-dl
|
2020-04-16 20:15:37 +02:00
|
|
|
|
2020-04-16 20:47:46 +02:00
|
|
|
```bash
|
|
|
|
# Ask for storage permission
|
2020-04-16 20:15:37 +02:00
|
|
|
termux-setup-storage &&
|
2020-04-16 20:47:46 +02:00
|
|
|
# Install youtube-dl
|
2020-06-13 22:50:03 +02:00
|
|
|
apt update && apt upgrade && apt install python ffmpeg dialog && pip install youtube-dl &&
|
2020-06-13 22:55:52 +02:00
|
|
|
# Configure to download videos in `Downloads/{URL's provider (e.g. Youtube)}/{filename}`
|
2020-04-16 20:15:37 +02:00
|
|
|
mkdir -p ~/.config/youtube-dl &&
|
|
|
|
echo "# Default Output Directory and Pattern
|
2020-06-13 22:55:52 +02:00
|
|
|
-o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(title)s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config &&
|
2020-04-16 20:47:46 +02:00
|
|
|
# Configure to open shared URLs with `youtube-dl {url}`
|
2020-04-16 20:15:37 +02:00
|
|
|
mkdir ~/bin &&
|
2020-06-13 22:50:03 +02:00
|
|
|
echo '#!/bin/bash
|
|
|
|
URL=$1
|
|
|
|
HEIGHT=15
|
|
|
|
WIDTH=40
|
|
|
|
CHOICE_HEIGHT=4
|
|
|
|
|
|
|
|
CHOICE=$(dialog \
|
|
|
|
--menu "Que desea descargar?" \
|
|
|
|
$HEIGHT $WIDTH $CHOICE_HEIGHT \
|
|
|
|
Video "" \
|
|
|
|
Audio "" \
|
|
|
|
2>&1 >/dev/tty)
|
|
|
|
|
|
|
|
case $CHOICE in
|
|
|
|
Video)
|
|
|
|
youtube-dl $URL
|
|
|
|
;;
|
|
|
|
Audio)
|
|
|
|
youtube-dl -x $URL
|
|
|
|
;;
|
|
|
|
esac' > ~/bin/termux-url-opener &&
|
2020-04-16 20:20:47 +02:00
|
|
|
chmod +x ~/bin/termux-url-opener
|
2020-04-16 20:47:46 +02:00
|
|
|
```
|
2020-04-16 20:15:37 +02:00
|
|
|
|
2020-04-16 20:47:46 +02:00
|
|
|
## Extras
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# Add special keys to keyboard
|
2020-06-13 22:55:52 +02:00
|
|
|
# source: https://wiki.termux.com/wiki/Touch_Keyboard#Extra_Keys_Row(s)
|
2020-04-16 20:15:37 +02:00
|
|
|
mkdir ~/.termux
|
|
|
|
echo "extra-keys = [ \
|
|
|
|
['ESC', '/', '|', 'HOME', 'UP', 'END', 'PGUP', '-'], \
|
|
|
|
['TAB','CTRL', 'ALT', 'LEFT', 'DOWN', 'RIGHT', 'PGDN', '~'] \
|
|
|
|
]" > ~/.termux/termux.properties
|
2020-04-16 20:47:46 +02:00
|
|
|
# Install nano
|
2020-04-16 20:15:37 +02:00
|
|
|
apt install nano
|
2020-04-16 20:47:46 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## All-In-One
|
2020-04-16 20:15:37 +02:00
|
|
|
|
2020-04-16 20:47:46 +02:00
|
|
|
youtube-dl + extras
|
|
|
|
|
|
|
|
```bash
|
2020-04-16 20:15:37 +02:00
|
|
|
termux-setup-storage &&
|
2020-04-16 20:20:47 +02:00
|
|
|
apt update && apt upgrade && apt install nano python ffmpeg && pip install youtube-dl &&
|
2020-04-16 20:15:37 +02:00
|
|
|
mkdir -p ~/.config/youtube-dl &&
|
|
|
|
echo "# Default Output Directory and Pattern
|
|
|
|
-o /data/data/com.termux/files/home/storage/downloads/%(extractor_key)s/%(uploader)s/%(title)s-%(id)s.%(ext)s" > ~/.config/youtube-dl/config &&
|
|
|
|
mkdir ~/bin &&
|
|
|
|
echo "#!/bin/bash
|
|
|
|
url=$1
|
|
|
|
youtube-dl $url" > ~/bin/termux-url-opener &&
|
|
|
|
chmod +x ~/bin/termux-url-opener &&
|
|
|
|
mkdir ~/.termux &&
|
|
|
|
echo "extra-keys = [ \
|
|
|
|
['ESC', '/', '|', 'HOME', 'UP', 'END', 'PGUP', '-'], \
|
|
|
|
['TAB','CTRL', 'ALT', 'LEFT', 'DOWN', 'RIGHT', 'PGDN', '~'] \
|
2020-04-16 20:47:46 +02:00
|
|
|
]" > ~/.termux/termux.properties
|
|
|
|
```
|