46 lines
959 B
Bash
46 lines
959 B
Bash
#!/bin/bash
|
|
|
|
## INIT
|
|
#mkdir -p ~/bin
|
|
#wget https://gitea.140477.xyz/pierrick/termux_url_opener/raw/branch/main/termux-url-opener -P ~/bin
|
|
#chmod +x ~/bin/termux-url-opener
|
|
|
|
|
|
# Fonction pour l'installation
|
|
install() {
|
|
echo "Lancement de l'installation..."
|
|
termux-setup-storage
|
|
pkg update
|
|
pkg upgrade
|
|
pkg install python3 ffmpeg wget
|
|
pip install yt-dlp
|
|
}
|
|
|
|
# Fonction pour la mise à jour
|
|
update() {
|
|
echo "Lancement de la mise à jour..."
|
|
pip install --upgrade yt-dlp
|
|
}
|
|
|
|
# Analyse des options avec getopts
|
|
while getopts "iu" option; do
|
|
case $option in
|
|
i)
|
|
install
|
|
update
|
|
exit 0
|
|
;;
|
|
u)
|
|
update
|
|
exit 0
|
|
;;
|
|
*)
|
|
echo "Option invalide. Usage: $0 [-i | -u]"
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
# Exécution par défaut si aucune option n'est fournie
|
|
yt-dlp -f "bestvideo[height<=360]+bestaudio/best" "$1"
|