« Youtube downloader : yt-dlp » : différence entre les versions
De www.yakakliker.org
Aucun résumé des modifications |
|||
| (3 versions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 213 : | Ligne 213 : | ||
* On obtient alors un exécutable sous la forme "'''''Script.sh.x'''''". | * On obtient alors un exécutable sous la forme "'''''Script.sh.x'''''". | ||
=== Liens === | |||
[https://github.com/Yakakliker37/Scripts/raw/refs/heads/main/youtube-zenity.sh youtube-zenity.sh] | |||
[https://github.com/Yakakliker37/Scripts/raw/refs/heads/main/youtube-zenity.sh.x youtube-zenity.sh.x] | |||
[https://github.com/Yakakliker37/Scripts/raw/refs/heads/main/youtube.sh youtube.sh] | |||
Dernière version du 18 août 2026 à 16:40
sudo apt update && sudo apt install quickjs nodejs
python3 -m pip install yt-dlp -U
curl -fsSL https://deno.land/install.sh | sudo DENO_INSTALL=/usr/local sh
yt-dlp --js-runtime node --cookies-from-browser chrome -x --audio-format m4a --no-playlist "URL"
yt-dlp --remote-components ejs:github --cookies-from-browser chrome -x --audio-format m4a --no-playlist "URL"
https://github.com/yt-dlp/yt-dlp/discussions/285
Petit script
#!/bin/bash
## Les variables
: ${VAR01=whiptail}
: ${url=}
############ Les variables
export selection="(◕_◕)"
export var25042301="(°_°)"
export var25070203="°(◕_◕)°"
export ver="PRY.260706"
export var24051101
var24051101=$(date +%y%m%d) # Variable date année-mois-jour
# Variables couleurs --- Pour faire sympa --- Oh la belle bleue !
export red="\033[31m" # Rouge
export turquoise="\033[36m" # Turquoise
export gras="\033[1m" # Gras
export rougegras="\033[1;31m" # Rouge Gras
export reset="\033[0m"
export alert="root=,red;window=,white;border=black,white;textbox=black,white;button=red,white"
export info="root=,blue;window=,white;border=black,white;textbox=black,white;button=red,white"
fct001(){
url=$(NEWT_COLORS="$info" whiptail --title "$ver" --inputbox "Entrez l'URL" 10 60 3>&1 1>&2 2>&3)
#yt-dlp -x --audio-format m4a $url
yt-dlp --js-runtime node --remote-components ejs:github --cookies-from-browser chrome -x --audio-format m4a "$url"
fct999
}
fct002(){
url=$(NEWT_COLORS="$info" whiptail --title "$ver" --inputbox "Entrez l'URL" 10 60 3>&1 1>&2 2>&3)
#yt-dlp --cookies-from-browser chrome -x --audio-format m4a $url --no-playlist
yt-dlp --js-runtime node --remote-components ejs:github --cookies-from-browser chrome -x --audio-format m4a --no-playlist "$url"
fct999
}
#####################################################
fct995() {
############# Sélection de l'action à exécuter ############################
var25062504=$(NEWT_COLORS="$info" whiptail --menu "$var25070203 : Que souhaitez vous faire ?" --title "$ver" 25 60 15 \
"fct001" " Télécharger une playlist" \
"fct002" " Télécharger une chanson" \
3>&1 1>&2 2>&3)
exitstatus=$?
if [ $exitstatus = 0 ]; then
$var25062504 # Lancement de la fonction choisie
else
fct999
fi
}
#########################################################
############# Fin du script ############################
fct999() {
echo "(◕_◕) : That's all folks !" # Information de fin d'exécution du script
}
#### The Ultimate Software ! ####
fct995
## That's all
Version Zenity
#!/bin/bash
## Les variables
: ${VAR01=zenity}
: ${url=}
############ Les variables
export selection="(◕_◕)"
export var25042301="(°_°)"
export var25070203="°(◕_◕)°"
export ver="PRY.260818"
export var24051101
var24051101=$(date +%y%m%d) # Variable date année-mois-jour
# Variables couleurs
export red="\033[31m"
export turquoise="\033[36m"
export gras="\033[1m"
export rougegras="\033[1;31m"
export reset="\033[0m"
fct001(){
url=$(zenity --entry \
--title="$ver" \
--text="Entrez l'URL de la playlist :" \
--width=450)
if [ $? -eq 0 ] && [ -n "$url" ]; then
(
echo "# Téléchargement en cours..."
yt-dlp --newline --progress --js-runtime node --remote-components ejs:github --cookies-from-browser chrome -x --audio-format m4a "$url"
) | zenity --progress \
--title="$ver" \
--text="Initialisation du téléchargement..." \
--pulsate \
--auto-close \
--width=400
fi
fct999
}
fct002(){
url=$(zenity --entry \
--title="$ver" \
--text="Entrez l'URL de la chanson :" \
--width=450)
if [ $? -eq 0 ] && [ -n "$url" ]; then
(
echo "# Téléchargement de la chanson en cours..."
yt-dlp --newline --progress --js-runtime node --remote-components ejs:github --cookies-from-browser chrome -x --audio-format m4a --no-playlist "$url"
) | zenity --progress \
--title="$ver" \
--text="Initialisation du téléchargement..." \
--pulsate \
--auto-close \
--width=400
fi
fct999
}
#####################################################
fct995() {
############# Sélection de l'action à exécuter ############################
var25062504=$(zenity --list \
--radiolist \
--title="$ver" \
--text="$var25070203 : Que souhaitez-vous faire ?" \
--column="Choix" --column="Code" --column="Action" \
--hide-column=2 \
TRUE "fct001" "Télécharger une playlist" \
FALSE "fct002" "Télécharger une chanson" \
--width=450 \
--height=220)
if [ $? -eq 0 ] && [ -n "$var25062504" ]; then
$var25062504 # Lancement de la fonction choisie
else
fct999
fi
}
#########################################################
############# Fin du script ############################
fct999() {
echo -e "${turquoise}(◕_◕) : That's all folks !${reset}"
}
#### The Ultimate Software ! ####
fct995
## That's all
- On compile le script avec shc
shc -r -f Script.sh
- On obtient alors un exécutable sous la forme "Script.sh.x".
Liens