-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathyoutube_playlist_saver.sh
More file actions
63 lines (47 loc) · 1.98 KB
/
youtube_playlist_saver.sh
File metadata and controls
63 lines (47 loc) · 1.98 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
# YAYPS = Yet Another Youtube Playlist Saver
# EN : Writes every title from a given youtube playlist into a text file for backup purpose.
# FR : Recopie tous les titres d'une playlist Youtube donnée dans un fichier texte pour l'archiver.
#
# Copyright (C) 2017 Romain Bousson
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
topdepart="no"
run(){
read -p 'Nom du fichier de sortie ?' out
echo "Fichier de sortie : BACKUP_Youtube_playlist-$out.txt"
read -p "adresse de la playlist à recopier ?" playlist_url
echo "url de la playlist : $playlist_url"
fichier_de_sortie=BACKUP_Youtube_playlist-$out.csv
echo "Début de l'analyse..."
youtube-dl --get-title --get-id --no-warnings --no-mark-watched --ignore-errors $playlist_url | tee -i $fichier_de_sortie
# Réécriture du fichier sous la forme "Tire" - tabulation - "ID de la vidéo" :
paste - - < $fichier_de_sortie|tee -i $fichier_de_sortie
notify-send "YAYPS / Analyse de la playlist terminée !"
echo Done.
}
while [ $topdepart="no" ]; do
echo Répertoire de travail courant : `pwd`
read -p 'continuer ? (O ou ENTER=oui, N=non ou tapper le répertoire voulu si besoin) ' answer
case "$answer" in
oui | o | O | Oui | OUI |"")
topdepart="yes"
run
break;;
non | n | N | Non | NON )
echo "Ok bye bye."
break;;
* )
echo "Changement de répertoire..."
cd "$answer";;
esac
done
exit 0;