Add files via upload

ad new script
This commit is contained in:
fenix-soft 2022-02-16 15:46:50 +01:00 committed by GitHub
parent 81c376e2ca
commit f8ca72383e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 407 additions and 0 deletions

80
R3_primapagina Normal file
View File

@ -0,0 +1,80 @@
#!/bin/bash
#
#
####################################################################################
# script che recupera l'ultimo podcast di https://www.raiplaysound.it/programmi/primapagina
#
# V:2.0 alpha_debug_mode 18 DICEMBRE 2021
#
# dipendenze: curl,jq,cat,wget
# uso: lancia lo script "R3_primapagina" per scaricare l'ultimo podcast inserito
# log: modifiche per cambio api e dominio rai
####################################################################################
# set global variable
primapaginaapi="https://www.raiplaysound.it/programmi/primapagina.json"
grbase="https://www.raiplaysound.it"
ag="Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/56.0"
# remove old jason data
rm ./data/primapagina.json
#rm ./data/Lprimapagina.json
# get jason data
curl -A "$ag" "$primapaginaapi" -o data/primapagina.json
echo " "
echo " "
echo "get data api... done!"
echo " "
# extract jason data of the last podcast
dataT=`cat ./data/primapagina.json | jq -r '."block" | ."cards" | .[0] | ."downloadable_audio" | ."title"'`
echo " "
echo "extract data... find.."
echo " "
echo " "
echo podcast_title: $dataT
echo " "
Lpodcast=`cat ./data/primapagina.json | jq -r '."block" | ."cards" | .[0] | ."downloadable_audio" | ."url"'`
echo " "
echo podcast_url: $Lpodcast
echo " "
# extract time and date onair podcast
ora=`cat ./data/primapagina.json | jq -r '."block" | ."cards" | .[0] | ."create_time"'`
Ora=`echo $ora | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'`
data=`cat ./data/primapagina.json | jq -r '."block" | ."cards" | .[0] | ."create_date"'`
Data=`echo $data | sed -e 's/\//\-/g'`
echo " "
echo log_podcast_creation: $Data $Ora
echo " "
echo " "
# download podcast
echo " download podcast.. opus_encode.."
echo " "
wget -d -c -U "$ag" "$Lpodcast" -O primapagina_"$Data"_"$Ora".mp3
# encode audio data... small file
#ffmpeg -n -i primapagina_"$Data"_"$Ora".mp3 -vn -acodec aac -ab 64k -ac 1 primapagina_"$Data"_"$Ora".m4a
ffmpeg -n -i primapagina_"$Data"_"$Ora".mp3 -acodec libopus -b:a 40k -ac 1 primapagina_"$Data"_"$Ora".opus
#ffmpeg -n -i primapagina_"$Data"_"$Ora".mp3 -vn -acodec libvorbis -aq 1 -ac 1 primapagina_"$Data"_"$Ora".ogg
rm primapagina_"$Data"_"$Ora".mp3

83
R3_scienza Normal file
View File

@ -0,0 +1,83 @@
#!/bin/bash
#
#
####################################################################################
# script che recupera l'ultimo podcast di https://www.raiplaysound.it/programmi/radio3scienza
#
# V:2.0 alpha_debug_mode 18 DICEMBRE 2021
#
# dipendenze: curl,jq,cat,wget
# uso: lancia R3_scienza è verrà scaricato l'ultimo episodio del podcast
# log: modifiche per cambio api e dominio rai
####################################################################################
# set global variable
R3_scienzaapi="https://www.raiplaysound.it/programmi/radio3scienza.json"
grbase="https://www.raiplaysound.it"
ag="Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/56.0"
# remove old jason data
rm ./data/R3_scienza.json
#rm ./data/LR3_scienza.json
# get jason data
curl -A "$ag" "$R3_scienzaapi" -o data/R3_scienza.json
echo " "
echo " "
echo "get data api... done!"
echo " "
# extract jason data of the last podcast
dataT=`cat ./data/R3_scienza.json | jq -r '."block" | ."cards" | .[0] | ."downloadable_audio" | ."title"'`
echo " "
echo "extract data... find.."
echo " "
echo " "
echo podcast_title: $dataT
echo " "
Lpodcast=`cat ./data/R3_scienza.json | jq -r '."block" | ."cards" | .[0] | ."downloadable_audio" | ."url"'`
echo " "
echo podcast_url: $Lpodcast
echo " "
# extract time and date onair podcast
ora=`cat ./data/R3_scienza.json | jq -r '."block" | ."cards" | .[0] | ."create_time"'`
Ora=`echo $ora | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'`
data=`cat ./data/R3_scienza.json | jq -r '."block" | ."cards" | .[0] | ."create_date"'`
Data=`echo $data | sed -e 's/\//\-/g'`
echo " "
echo log_podcast_creation: $Data $Ora
echo " "
echo " "
# download podcast
echo " download podcast.. opus_encode.."
echo " "
wget -d -c -U "$ag" "$Lpodcast" -O R3_scienza_"$Data"_"$Ora".mp3
# encode audio data... small file
#ffmpeg -n -i R3_scienza_"$Data"_"$Ora".mp3 -vn -acodec aac -ab 64k -ac 1 R3_scienza_"$Data"_"$Ora".m4a
#ffmpeg -n -i R3_scienza_"$Data"_"$Ora".mp3 -acodec libopus -b:a 48k -ac 1 R3_scienza_"$Data"_"$Ora".opus
#ffmpeg -n -i R3_scienza_"$Data"_"$Ora".mp3 -vn -acodec libmp3lame -ab 96k -ac 1 NR3_scienza_"$Data"_"$Ora".mp3
ffmpeg -n -i R3_scienza_"$Data"_"$Ora".mp3 -vn -acodec libvorbis -aq 2 -ac 1 R3_scienza_"$Data"_"$Ora".ogg
rm R3_scienza_"$Data"_"$Ora".mp3

82
green_zone Normal file
View File

@ -0,0 +1,82 @@
#!/bin/bash
#
#
####################################################################################
# script che recupera l'ultimo podcast di https://www.raiplaysound.it/programmi/greenzone
#
# V:2.0 alpha_debug_mode 18 DICEMBRE 2021
#
# dipendenze: curl,jq,cat,wget
# uso: lanciare ./green_zone oppure green_zone
# log: modifiche per cambio api e dominio rai
####################################################################################
# set global variable
greenzoneapi="https://www.raiplaysound.it/programmi/greenzone.json"
grbase="https://www.raiplaysound.it"
ag="Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/56.0"
# remove old jason data
rm ./data/greenzone.json
#rm ./data/Lgreenzone.json
# get jason data
curl -A "$ag" "$greenzoneapi" -o data/greenzone.json
echo " "
echo " "
echo "get data api... done!"
echo " "
# extract jason data of the last podcast
dataT=`cat ./data/greenzone.json | jq -r '."block" | ."cards" | .[0] | ."downloadable_audio" | ."title"'`
echo " "
echo "extract data... find.."
echo " "
echo " "
echo podcast_title: $dataT
echo " "
Lpodcast=`cat ./data/greenzone.json | jq -r '."block" | ."cards" | .[0] | ."downloadable_audio" | ."url"'`
echo " "
echo podcast_url: $Lpodcast
echo " "
# extract time and date onair podcast
ora=`cat ./data/greenzone.json | jq -r '."block" | ."cards" | .[0] | ."create_time"'`
Ora=`echo $ora | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'`
data=`cat ./data/greenzone.json | jq -r '."block" | ."cards" | .[0] | ."create_date"'`
Data=`echo $data | sed -e 's/\//\-/g'`
echo " "
echo log_podcast_creation: $Data $Ora
echo " "
echo " "
# download podcast
echo " download podcast.. opus_encode.."
echo " "
wget -d -c -U "$ag" "$Lpodcast" -O greenzone_"$Data"_"$Ora".mp3
# encode audio data... small file
#ffmpeg -n -i greenzone_"$Data"_"$Ora".mp3 -acodec libopus -b:a 56k -ac 1 greenzone_"$Data"_"$Ora".opus
ffmpeg -n -i greenzone_"$Data"_"$Ora".mp3 -vn -acodec libvorbis -aq 2 -ac 1 greenzone_"$Data"_"$Ora".ogg
rm greenzone_"$Data"_"$Ora".mp3

82
inviatospeciale Normal file
View File

@ -0,0 +1,82 @@
#!/bin/bash
#
#
####################################################################################
# script che recupera l'ultimo podcast di https://www.raiplaysound.it/programmi/inviatospeciale
#
# V:2.0 alpha_debug_mode 18 DICEMBRE 2021
#
# dipendenze: curl,jq,cat,wget
#
# log: modifiche per cambio api e dominio rai
####################################################################################
# set global variable
inviatospecialeapi="https://www.raiplaysound.it/programmi/inviatospeciale.json"
grbase="https://www.raiplaysound.it"
ag="Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/56.0"
# remove old jason data
rm ./data/inviatospeciale.json
#rm ./data/Linviatospeciale.json
# get jason data
curl -A "$ag" "$inviatospecialeapi" -o data/inviatospeciale.json
echo " "
echo " "
echo "get data api... done!"
echo " "
# extract jason data of the last podcast
dataT=`cat ./data/inviatospeciale.json | jq -r '."block" | ."cards" | .[0] | ."downloadable_audio" | ."title"'`
echo " "
echo "extract data... find.."
echo " "
echo " "
echo podcast_title: $dataT
echo " "
Lpodcast=`cat ./data/inviatospeciale.json | jq -r '."block" | ."cards" | .[0] | ."downloadable_audio" | ."url"'`
echo " "
echo podcast_url: $Lpodcast
echo " "
# extract time and date onair podcast
ora=`cat ./data/inviatospeciale.json | jq -r '."block" | ."cards" | .[0] | ."create_time"'`
Ora=`echo $ora | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'`
data=`cat ./data/inviatospeciale.json | jq -r '."block" | ."cards" | .[0] | ."create_date"'`
Data=`echo $data | sed -e 's/\//\-/g'`
echo " "
echo log_podcast_creation: $Data $Ora
echo " "
echo " "
# download podcast
echo " download podcast.. opus_encode.."
echo " "
wget -d -c -U "$ag" "$Lpodcast" -O inviatospeciale_"$Data"_"$Ora".mp3
# encode audio data... small file
#ffmpeg -n -i inviatospeciale_"$Data"_"$Ora".mp3 -vn -acodec aac -ab 72k -ac 1 inviatospeciale_"$Data"_"$Ora".m4a
#ffmpeg -n -i inviatospeciale_"$Data"_"$Ora".mp3 -acodec libopus -b:a 56k -ac 1 inviatospeciale_"$Data"_"$Ora".opus
ffmpeg -n -i inviatospeciale_"$Data"_"$Ora".mp3 -vn -acodec libvorbis -aq 2 -ac 1 inviatospeciale_"$Data"_"$Ora".ogg
rm inviatospeciale_"$Data"_"$Ora".mp3

80
italiasottoinchiesta Normal file
View File

@ -0,0 +1,80 @@
#!/bin/bash
#
#
####################################################################################
# script che recupera l'ultimo podcast di https://www.raiplaysound.it/programmi/italiasottoinchiesta
#
# V:2.0 alpha_debug_mode 18 DICEMBRE 2021
#
# dipendenze: curl,jq,cat,wget
#
# log: modifiche per cambio api e dominio rai
####################################################################################
# set global variable
italiasottoinchiestaapi="https://www.raiplaysound.it/programmi/italiasottoinchiesta.json"
grbase="https://www.raiplaysound.it"
ag="Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/56.0"
# remove old jason data
rm ./data/italiasottoinchiesta.json
#rm ./data/Litaliasottoinchiesta.json
# get jason data
curl -A "$ag" "$italiasottoinchiestaapi" -o data/italiasottoinchiesta.json
echo " "
echo " "
echo "get data api... done!"
echo " "
# extract jason data of the last podcast
dataT=`cat ./data/italiasottoinchiesta.json | jq -r '."block" | ."cards" | .[0] | ."downloadable_audio" | ."title"'`
echo " "
echo "extract data... find.."
echo " "
echo " "
echo podcast_title: $dataT
echo " "
Lpodcast=`cat ./data/italiasottoinchiesta.json | jq -r '."block" | ."cards" | .[0] | ."downloadable_audio" | ."url"'`
echo " "
echo podcast_url: $Lpodcast
echo " "
# extract time and date onair podcast
ora=`cat ./data/italiasottoinchiesta.json | jq -r '."block" | ."cards" | .[0] | ."create_time"'`
Ora=`echo $ora | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'`
data=`cat ./data/italiasottoinchiesta.json | jq -r '."block" | ."cards" | .[0] | ."create_date"'`
Data=`echo $data | sed -e 's/\//\-/g'`
echo " "
echo log_podcast_creation: $Data $Ora
echo " "
echo " "
# download podcast
echo " download podcast.. opus_encode.."
echo " "
wget -d -c -U "$ag" "$Lpodcast" -O italiasottoinchiesta_"$Data"_"$Ora".mp3
# encode audio data... small file
#ffmpeg -n -i italiasottoinchiesta_"$Data"_"$Ora".mp3 -vn -acodec aac -ab 64k -ac 1 italiasottoinchiesta_"$Data"_"$Ora".m4a
#ffmpeg -n -i italiasottoinchiesta_"$Data"_"$Ora".mp3 -acodec libopus -b:a 40k -ac 1 italiasottoinchiesta_"$Data"_"$Ora".opus
ffmpeg -n -i italiasottoinchiesta_"$Data"_"$Ora".mp3 -vn -acodec libvorbis -aq 2 -ac 1 italiasottoinchiesta_"$Data"_"$Ora".ogg
rm italiasottoinchiesta_"$Data"_"$Ora".mp3