From a3eef223941b003329b910ef7ccd43b70621746f Mon Sep 17 00:00:00 2001 From: pierrick Date: Thu, 12 Jun 2025 20:53:13 +0200 Subject: [PATCH] update --- termux-url-opener | 50 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/termux-url-opener b/termux-url-opener index c6ab522..bf2e344 100644 --- a/termux-url-opener +++ b/termux-url-opener @@ -1,13 +1,45 @@ #!/bin/bash -## INSTALL -#termux-setup-storage -#pkg update -#pkg upgrade -#pkg install python3 ffmpeg wget -pip install --upgrade yt-dlp -#mkdir ~/bin -#wget https://...............termux-url-opener -P ~/bin +## 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 -yt-dlp -f "bestvideo[height<=360]+bestaudio/best" $1 + +# 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"