Compare commits

..

No commits in common. "31b32f215153418c0f632f56147c00cf4031389f" and "9ac5ed04e8a96af3b34d51c4e7921506abe3a07b" have entirely different histories.

5 changed files with 54 additions and 70 deletions

View File

@ -1,7 +1,3 @@
# V2.0 alpha debug-mode
- fix script for use new api rai
- fix script for use new rai url, rewrite some code gr1,gr2,gr3
# V1.7
- add script grr: Umbria, Valle d'Aosta
- add italian map "regioni_italia.png" in data directory for future use.

36
gr1
View File

@ -4,69 +4,65 @@
####################################################################################
# script che recupera l'ultimo podcast del gr1
#
# V:2.0 alpha_debug_mode 18 DICEMBRE 2021
#v:1.0 Novembre 2020
#
# dipendenze: curl,jq,cat,wget,ffmpeg
#
# dipendenze: curl,jq,cat,wget
#
# log: modifiche per cambio api e dominio rai
####################################################################################
# set global variable
gr1api="https://www.raiplaysound.it/programmi/gr1.json"
grbase="https://www.raiplaysound.it"
gr1api="https://www.raiplayradio.it/programmi/gr1/?json"
grbase="https://www.raiplayradio.it"
ag="Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/56.0"
# remove old jason data
rm ./data/gr1.json
#rm ./data/Lgr1.json
rm ./data/Lgr1.json
# get jason data
curl -A "$ag" "$gr1api" -o data/gr1.json
echo " "
echo " "
echo "get data api... done!"
echo " "
# extract jason data of the last podcast
dataT=`cat ./data/gr1.json | jq -r '."block" | ."cards" | .[0] | ."downloadable_audio" | ."title"'`
dataL=`cat ./data/gr1.json | jq -r ."pathFirstItem"`
echo " "
echo "extract data... find.."
echo " "
echo " "
echo podcast_title: $dataT
echo log: $dataL
echo " "
curl -A "$ag" "$grbase$dataL" -o data/Lgr1.json
Lpodcast=`cat ./data/gr1.json | jq -r '."block" | ."cards" | .[0] | ."downloadable_audio" | ."url"'`
Lpodcast=`cat ./data/Lgr1.json | jq -r '.["audio"] | .contentUrl'`
echo " "
echo podcast_url: $Lpodcast
echo log: $Lpodcast
echo " "
# extract time and date onair podcast
ora=`cat ./data/gr1.json | jq -r '."block" | ."cards" | .[0] | ."create_time"'`
ora=`cat ./data/Lgr1.json | jq -r ."timePublished"`
Ora=`echo $ora | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'`
data=`cat ./data/gr1.json | jq -r '."block" | ."cards" | .[0] | ."create_date"'`
data=`cat ./data/Lgr1.json | jq -r ."datePublished"`
Data=`echo $data | sed -e 's/\//\-/g'`
echo " "
echo log_podcast_creation: $Data $Ora
echo log: $Data $Ora
echo " "
echo " "
# download podcast
echo " download podcast.. opus_encode.."
echo " "
wget -d -c -U "$ag" "$Lpodcast" -O gr1_"$Data"_"$Ora".mp3
# encode audio data... small file

36
gr2
View File

@ -4,69 +4,65 @@
####################################################################################
# script che recupera l'ultimo podcast del gr2
#
#V:2.0 alpha_debug_mode 18 DICEMBRE 2021
#v:1.0 Novembre 2020
#
# dipendenze: curl,jq,cat,wget,ffmpeg
#
# dipendenze: curl,jq,cat,wget
#
# log: cambio api rai e dominio
####################################################################################
# set global variable
gr2api="https://www.raiplaysound.it/programmi/gr2.json"
grbase="https://www.raiplaysound.it"
gr2api="https://www.raiplayradio.it/programmi/gr2/?json"
grbase="https://www.raiplayradio.it"
ag="Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/56.0"
# remove old jason data
rm ./data/gr2.json
#rm ./data/Lgr2.json
rm ./data/Lgr2.json
# get jason data
curl -A "$ag" "$gr2api" -o data/gr2.json
echo " "
echo " "
echo "get data api... done!"
echo " "
# extract jason data of the last podcast
dataT=`cat ./data/gr2.json | jq -r '."block" | ."cards" | .[0] | ."downloadable_audio" | ."title"'`
dataL=`cat ./data/gr2.json | jq -r ."pathFirstItem"`
echo " "
echo "extract data... find.."
echo " "
echo " "
echo podcast_title: $dataT
echo log: $dataL
echo " "
curl -A "$ag" "$grbase$dataL" -o data/Lgr2.json
Lpodcast=`cat ./data/gr2.json | jq -r '."block" | ."cards" | .[0] | ."downloadable_audio" | ."url"'`
Lpodcast=`cat ./data/Lgr2.json | jq -r '.["audio"] | .contentUrl'`
echo " "
echo podcast_url: $Lpodcast
echo log: $Lpodcast
echo " "
# extract time and date onair podcast
ora=`cat ./data/gr2.json | jq -r '."block" | ."cards" | .[0] | ."create_time"'`
ora=`cat ./data/Lgr2.json | jq -r ."timePublished"`
Ora=`echo $ora | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'`
data=`cat ./data/gr2.json | jq -r '."block" | ."cards" | .[0] | ."create_date"'`
data=`cat ./data/Lgr2.json | jq -r ."datePublished"`
Data=`echo $data | sed -e 's/\//\-/g'`
echo " "
echo log_podcast_creation: $Data $Ora
echo log: $Data $Ora
echo " "
echo " "
# download podcast
echo " download podcast.. opus_encode.."
echo " "
wget -d -c -U "$ag" "$Lpodcast" -O gr2_"$Data"_"$Ora".mp3
# encode audio data... small file

36
gr3
View File

@ -4,69 +4,65 @@
####################################################################################
# script che recupera l'ultimo podcast del gr3
#
#V:2.0 alpha_debug_mode 18 DICEMBRE 2021
#v:1.0 Novembre 2020
#
# dipendenze: curl,jq,cat,wget,ffmpeg
#
# dipendenze: curl,jq,cat,wget
#
# log: cambio api rai e dominio
####################################################################################
# set global variable
gr3api="https://www.raiplaysound.it/programmi/gr3.json"
grbase="https://www.raiplaysound.it"
gr3api="https://www.raiplayradio.it/programmi/gr3/?json"
grbase="https://www.raiplayradio.it"
ag="Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/56.0"
# remove old jason data
rm ./data/gr3.json
#rm ./data/Lgr3.json
rm ./data/Lgr3.json
# get jason data
curl -A "$ag" "$gr3api" -o data/gr3.json
echo " "
echo " "
echo "get data api... done!"
echo " "
# extract jason data of the last podcast
dataT=`cat ./data/gr3.json | jq -r '."block" | ."cards" | .[0] | ."downloadable_audio" | ."title"'`
dataL=`cat ./data/gr3.json | jq -r ."pathFirstItem"`
echo " "
echo "extract data... find.."
echo " "
echo " "
echo podcast_title: $dataT
echo log: $dataL
echo " "
curl -A "$ag" "$grbase$dataL" -o data/Lgr3.json
Lpodcast=`cat ./data/gr3.json | jq -r '."block" | ."cards" | .[0] | ."downloadable_audio" | ."url"'`
Lpodcast=`cat ./data/Lgr3.json | jq -r '.["audio"] | .contentUrl'`
echo " "
echo podcast_url: $Lpodcast
echo log: $Lpodcast
echo " "
# extract time and date onair podcast
ora=`cat ./data/gr3.json | jq -r '."block" | ."cards" | .[0] | ."create_time"'`
ora=`cat ./data/Lgr3.json | jq -r ."timePublished"`
Ora=`echo $ora | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'`
data=`cat ./data/gr3.json | jq -r '."block" | ."cards" | .[0] | ."create_date"'`
data=`cat ./data/Lgr3.json | jq -r ."datePublished"`
Data=`echo $data | sed -e 's/\//\-/g'`
echo " "
echo log_podcast_creation: $Data $Ora
echo log: $Data $Ora
echo " "
echo " "
# download podcast
echo " download podcast.. opus_encode.."
echo " "
wget -d -c -U "$ag" "$Lpodcast" -O gr3_"$Data"_"$Ora".mp3
# encode audio data... small file

View File

@ -1 +1 @@
V2.0
V1.7