-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEseguimi.sh
More file actions
48 lines (34 loc) · 1.42 KB
/
Copy pathEseguimi.sh
File metadata and controls
48 lines (34 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
read -p "Vuoi scaricare anche il video? (S/N): " answer
echo "--------------------------"
# Normalizzo la risposta a maiuscolo
answer="${answer^^}"
if [[ "$answer" == "S" ]]; then
command='yt-dlp -verbose -f bestvideo+bestaudio/best --cookies cookies.txt --embed-metadata --embed-thumbnail -o "./%(title)s.%(ext)s"'
echo "--------------------------"
echo "Sia il video che l'audio verranno scaricati"
echo "--------------------------"
elif [[ "$answer" == "N" ]]; then
command='yt-dlp -f bestaudio --extract-audio --embed-metadata --embed-thumbnail --convert-thumbnails jpg --ppa "ffmpeg: -c:v mjpeg -vf crop='\''if(gt(ih\,iw)\,iw\,ih):if(gt(iw\,ih)\,ih\,iw)'\''" -o "./%(title)s.%(ext)s"'
echo "Solo l'audio verra' scaricato."
echo "--------------------------"
read -p "Vuoi uno specifico formato audio? (ES: flac, m4a, opus. Lascia vuoto per il formato originale): " format
echo "--------------------------"
if [[ -n "$format" ]]; then
command="$command --audio-format $format"
fi
else
echo "--------------------------"
echo "Rispondi Si' oppure no."
echo "--------------------------"
exit 1
fi
read -p "Inserisci il collegamento al video YouTube: " videolink
echo "--------------------------"
# Aggiungo il link al comando
command="$command \"$videolink\""
# Lancio yt-dlp
eval $command
echo "--------------------------"
read -p "Premi Invio per uscire"
exit 0