commit 57b47ed55cfab993c20f8277e97eed61b38d4193 Author: fenix-soft Date: Tue Nov 10 14:44:22 2020 +0100 Add files via upload diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0950d97 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +Attribution-NonCommercial-ShareAlike 4.0 International +(CC BY-NC-SA 4.0) + +This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. +To view a copy of this license, visit: + +http://creativecommons.org/licenses/by-nc-sa/4.0/ + +or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. + +--- + + +Attribuzione - Non commerciale - Condividi allo stesso modo 4.0 Internazionale (CC BY-NC-SA 4.0) + +Quest'opera è stata rilasciata con licenza Creative Commons Attribuzione - Non commerciale - Condividi allo stesso modo 4.0 Internazionale. Per leggere una copia della licenza visita il sito web: + +http://creativecommons.org/licenses/by-nc-sa/4.0/ + +o spedisci una lettera a Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. + diff --git a/README.md b/README.md new file mode 100644 index 0000000..b7c454a --- /dev/null +++ b/README.md @@ -0,0 +1,89 @@ +# gr_podcast + +## Italian: Read Me version + +**gr_podcast** è una raccolta di script bash che consente all'utente, di recuperare in maniera agevole, gli ultimi episodi inseriti del podcast del radio giornale rai '**gr**' .. e all'occorenza una volta scaricati, ricodificarli in formato **opus** o "**aac**" (audio codec) per risparmiare spazio di archiviazione, vedi [note.md](note.md) + + + + +La raccolta prevede al momento, gli script per il: **gr1**, **gr2**, **gr3** + + +## dipendenze: + +curl + +[jq](https://stedolan.github.io/jq/) + +cat + +wget + +ffmpeg (usato per la codifica opus o aac) + +### uso: +impostare i permessi di esecuzione per ogni script (chmod +x "nome_script”), **aprire un terminale nella cartella di lavoro degli script** e avviare quello che vi interessa + +### esempio: +scaricare l'ultimo podcast del gr1, esegui + + ./gr1 + +se vuoi invece integrare lo script nel sistema, per poterlo lanciare in qualisiasi posizione il terminale si trovi, modifica il tuo file **.bashrc** e aggiungi un percorso per lo script directory personalizzato. + +####esempio modifica integrazione di file .bashrc + + export PATH = $ PATH: "path directory script" + +ora bash dovrebbe vedere lo script. In alcuni casi potrebbe essere necesssario riavviare la sessione.. o il sistema.. + +per eseguirlo dare per esempio + + gr1 + +buon ascolto! + +--- + +## English: Read Me version + +**gr_podcast** is a collection of bash scripts that allows the user to easily retrieve the latest episodes included in the podcast of the radio newspaper rai '**gr**' .. and if necessary, once downloaded, recode them in **opus** or "**aac**" format (audio codec) to save storage space, see [note.md](note.md) + +The collection currently includes scripts for: gr1, gr2, gr3 + +### dependency script: + +curl + +[jq](https://stedolan.github.io/jq/) + +cat + +wget + +ffmpeg (used for opus or aac encoding) + +### use: + +set the execution permissions for each script (chmod + x "script_name"), open a terminal in the script workbook and start the one you need + +example: + +download the latest gr1 podcast, run + + ./gr1 + +if you want to integrate the script into the system instead, to be able to run it wherever the terminal is, edit your .bashrc file and add a path to the custom script directory. + +### example change integration of .bashrc file + + export PATH = $ PATH: "path directory script" + +bash should now see the script. In some cases it may be necessary to restart the session .. or the system .. + +to execute it give for example + + gr1 + +good listening! \ No newline at end of file diff --git a/change_log.md b/change_log.md new file mode 100644 index 0000000..46343c2 --- /dev/null +++ b/change_log.md @@ -0,0 +1,2 @@ +# V1.0 +- initial relase \ No newline at end of file diff --git a/data/Lgr1.json b/data/Lgr1.json new file mode 100644 index 0000000..ff6b79b --- /dev/null +++ b/data/Lgr1.json @@ -0,0 +1,153 @@ + + + { + "author": "", + "channel": "Rai Radio 1", + "editor": "", + "bsp": "rplr_aod_radio1", + "adv": true, + "datePublished":"09/11/2020", + "timePublished":"13:00", + "parentPage": "Page-7713084b-738a-4594-9cef-2c13f8de81cf", + "parentBlock": "PublishingBlock-cc06a6b9-fc0c-468b-8010-72480ea8b8df", + "parentSet": "ContentSet-5182a05b-58f0-4dc2-b8d8-f84dfd1e4a41", + "stagione": "", + "episodio": "", + "generi": [], + "sottogeneri": [], + "correlati": "", + "caption": "", + "description": " ", + "isPartOf":{ + + + + "tipologia" : [ + {"nome": "Programma Radio", + "id" : "Category-27fea946-557f-4ee3-8a30-2a390e731de9"}], + + "channel":"Rai Radio 1", + + "editor" : "", + "social" : { + "sms" : "", + "telefono" : "", + "whatsapp" : "", + "email" : "" + }, + "orario" : "", + "generi" :[ + {"nome" : "Informazione", + "id" : "Category-b85c5541-2371-4690-8586-55c17f5d85af"} + ], + "correlati" : "Category:Programma%20Radio:Category-27fea946-557f-4ee3-8a30-2a390e731de9^Category:Informazione:Category-b85c5541-2371-4690-8586-55c17f5d85af^", + "sottogenere" : [], + "subtitle" : "", + "anno" : "", + "regia" : "", + "produzione" : "", + "country" : "", + + "durataFirstItem" : "", + + "interpreti" : "", + "conduttore" : "", + "numeroStagioni" : "", + "description" : "25 edizioni al giorno 24 ore su 24. Aggiornamenti continui, fili diretti sull'attualit\u00E0 e breaking news. Per essere sempre informati.", + "label":"", + + + "ID" : "ContentItem-49393892-fb23-4999-8fb7-640bf1a55250", + + "name" : "GR 1", + + "weblink" : "/programmi/gr1", + "PathID" : "/programmi/gr1/index.html?json", + "az" : true, + "images": { + "landscape" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2018/09/18/1537271328652_Gr1_2048x1152.jpg", + "portrait" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/10/26/1509000741137_GR_1152x2048.jpg", + "square" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/12/19/1513679074202_Gr1.jpg_2048.jpg", + "landscape43" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/10/26/1509000741138_GR_2048x1536.jpg", + "portrait43" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/10/26/1509000741138_GR_1536x2048.jpg", + "portrait_logo" : "", + "landscape_logo" : "" + }, + + "rights-management" : { + "Diritti" : { + "diretta":{ + }, + "offline":{ + }, + "VOD":{ + },"Zona Geografica":{ + } + } + } + , + + + "sito": "", + "bsp" : "rplr_aod_radio1", + "fmt" : "", + "keyw" : "", + "banner300x250" : "", + "bannerUnicoLoc": "", + + "dfp" : { + "label" : "" + + ,"name_escaped" : "GR1" + + ,"generi_escaped" : [ + {"nome" : "Informazione", + "id" : "Category-b85c5541-2371-4690-8586-55c17f5d85af"} + ] + + ,"tipologia_escaped" : [ + {"nome": "ProgrammaRadio", + "id" : "Category-27fea946-557f-4ee3-8a30-2a390e731de9"}] + + }, + + "adv": true, + "type" : "Programma Radio" + + }, + "audio": { + + "contentUrl": "http://mediapolisvod.rai.it/relinker/relinkerServlet.htm?cont=CxIwFcssSlash0nYjzSmspPpPlussUMxtjweeqqEEqualeeqqEEqual", + "duration": "", + "highlights": "", + "subtitles": "" + }, + "images": { + "landscape" : "", + "portrait": "", + "square": "", + "landscape43": "", + "portrait43": "" + }, + "ID": "ContentItem-544316aa-ecfc-45b0-82fa-4c3e36be4430", + "PathID": "/audio/2020/10/GR1-ore-13-del-09112020-544316aa-ecfc-45b0-82fa-4c3e36be4430.html?json", + "name": "GR1 ore 13 del 09/11/2020", + "subtitle": "", + + "availabilities":[{"start":"2020-11-09 13:00:00","end":"3000-01-01 23:29:59"}] + ,"regia": "", + "interpreti": "", + "type": "RaiTv Media Audio Item", + "weblink": "/audio/2020/10/GR1-ore-13-del-09112020-544316aa-ecfc-45b0-82fa-4c3e36be4430.html", + "rating": "0", + "scaricabile": "false", + "rights-management": { + "Diritti": { + "diretta": {}, + "offline": {}, + "VOD": {}, + "Zona Geografica": {} + } + } + } + diff --git a/data/Lgr2.json b/data/Lgr2.json new file mode 100644 index 0000000..f6b66cb --- /dev/null +++ b/data/Lgr2.json @@ -0,0 +1,139 @@ + + + { + "author": "", + "channel": "Rai Radio 2", + "editor": "", + "bsp": "rplr_aod_radio2", + "adv": true, + "datePublished":"09/11/2020", + "timePublished":"10:30", + "parentPage": "Page-89c03ef0-229b-4cbb-89f3-e3ce357be518", + "parentBlock": "PublishingBlock-ed08f07d-b6fc-49f3-921d-54f0914d866b", + "parentSet": "ContentSet-d733cab3-a77c-4d7b-9783-f74af627282d", + "stagione": "", + "episodio": "", + "generi": [], + "sottogeneri": [], + "correlati": "", + "caption": "", + "description": " ", + "isPartOf":{ + + + + "tipologia" : [], + + "channel":"Rai Radio 2", + + "editor" : "", + "social" : { + "sms" : "", + "telefono" : "", + "whatsapp" : "", + "email" : "" + }, + "orario" : "", + "generi" :[], + "correlati" : "", + "sottogenere" : [], + "subtitle" : " - ", + "anno" : "", + "regia" : "", + "produzione" : "", + "country" : "", + + "durataFirstItem" : "", + + "interpreti" : "", + "conduttore" : "", + "numeroStagioni" : "", + "description" : "", + "label":"", + + + "ID" : "ContentItem-f9347e13-7150-43ce-b91a-089f890f6d03", + + "name" : "GR 2", + + "weblink" : "/programmi/gr2", + "PathID" : "/programmi/gr2/index.html?json", + "az" : true, + "images": { + "landscape" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/12/19/1513691549801_gr2-ok169.png", + "portrait" : "", + "square" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/12/19/1513691544594_gr2-ok.png", + "landscape43" : "", + "portrait43" : "", + "portrait_logo" : "", + "landscape_logo" : "" + }, + + "rights-management" : { + "Diritti" : { + "diretta":{ + }, + "offline":{ + }, + "VOD":{ + },"Zona Geografica":{ + } + } + } + , + + + "sito": "", + "bsp" : "rplr_aod_radio2", + "fmt" : "", + "keyw" : "", + "banner300x250" : "", + "bannerUnicoLoc": "", + + "dfp" : { + "label" : "" + + ,"name_escaped" : "GR2" + + }, + + "adv": true, + "type" : "" + + }, + "audio": { + + "contentUrl": "http://mediapolisvod.rai.it/relinker/relinkerServlet.htm?cont=AbDedb2DEr78hCquMXDh5weeqqEEqualeeqqEEqual", + "duration": "", + "highlights": "", + "subtitles": "" + }, + "images": { + "landscape" : "", + "portrait": "", + "square": "", + "landscape43": "", + "portrait43": "" + }, + "ID": "ContentItem-5bedfea7-3ad2-406b-af96-75f4b40ed09f", + "PathID": "/audio/2020/10/GR-2-5bedfea7-3ad2-406b-af96-75f4b40ed09f.html?json", + "name": "GR 2", + "subtitle": "", + + "availabilities":[{"start":"2020-11-09 10:30:00","end":"2020-11-16 23:59:59"}] + ,"regia": "", + "interpreti": "", + "type": "RaiTv Media Audio Item", + "weblink": "/audio/2020/10/GR-2-5bedfea7-3ad2-406b-af96-75f4b40ed09f.html", + "rating": "0", + "scaricabile": "", + "rights-management": { + "Diritti": { + "diretta": {}, + "offline": {}, + "VOD": {}, + "Zona Geografica": {} + } + } + } + diff --git a/data/Lgr3.json b/data/Lgr3.json new file mode 100644 index 0000000..2ffa14d --- /dev/null +++ b/data/Lgr3.json @@ -0,0 +1,139 @@ + + + { + "author": "", + "channel": "Rai Radio 3", + "editor": "", + "bsp": "rplr_aod_radio3", + "adv": true, + "datePublished":"09/11/2020", + "timePublished":"13:45", + "parentPage": "Page-398e7cb2-58b2-421c-bf6b-1ef8bc9433ec", + "parentBlock": "PublishingBlock-ec905abe-d63e-4e89-a350-52b437670a39", + "parentSet": "ContentSet-2a84533c-0abd-4ec4-8e8b-78d484fe1888", + "stagione": "", + "episodio": "", + "generi": [], + "sottogeneri": [], + "correlati": "", + "caption": "", + "description": " ", + "isPartOf":{ + + + + "tipologia" : [], + + "channel":"Rai Radio 3", + + "editor" : "", + "social" : { + "sms" : "", + "telefono" : "", + "whatsapp" : "", + "email" : "" + }, + "orario" : "", + "generi" :[], + "correlati" : "", + "sottogenere" : [], + "subtitle" : " - ", + "anno" : "", + "regia" : "", + "produzione" : "", + "country" : "", + + "durataFirstItem" : "", + + "interpreti" : "", + "conduttore" : "", + "numeroStagioni" : "", + "description" : "A cura della redazione del Giornale Radio Rai", + "label":"", + + + "ID" : "ContentItem-0e20c0f7-d820-40f1-a489-2785557ffad2", + + "name" : "GR 3", + + "weblink" : "/programmi/gr3", + "PathID" : "/programmi/gr3/index.html?json", + "az" : true, + "images": { + "landscape" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/10/26/1509000741137_GR_2048x1152.jpg", + "portrait" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/10/26/1509000741137_GR_1152x2048.jpg", + "square" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/10/26/1509000741137_GR_2048x2048.jpg", + "landscape43" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/10/26/1509000741138_GR_2048x1536.jpg", + "portrait43" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/10/26/1509000741138_GR_1536x2048.jpg", + "portrait_logo" : "", + "landscape_logo" : "" + }, + + "rights-management" : { + "Diritti" : { + "diretta":{ + }, + "offline":{ + }, + "VOD":{ + },"Zona Geografica":{ + } + } + } + , + + + "sito": "", + "bsp" : "rplr_aod_radio3", + "fmt" : "", + "keyw" : "", + "banner300x250" : "", + "bannerUnicoLoc": "", + + "dfp" : { + "label" : "" + + ,"name_escaped" : "GR3" + + }, + + "adv": true, + "type" : "" + + }, + "audio": { + + "contentUrl": "http://mediapolisvod.rai.it/relinker/relinkerServlet.htm?cont=ExTBbiyJGpPpPlusst8dmj0Pd6sjAeeqqEEqualeeqqEEqual", + "duration": "", + "highlights": "", + "subtitles": "" + }, + "images": { + "landscape" : "", + "portrait": "", + "square": "", + "landscape43": "", + "portrait43": "" + }, + "ID": "ContentItem-e6484841-3f2a-4716-864b-fac256ad0582", + "PathID": "/audio/2020/10/GR-3-e6484841-3f2a-4716-864b-fac256ad0582.html?json", + "name": "GR 3", + "subtitle": "", + + "availabilities":[{"start":"2020-11-09 13:45:00","end":"2020-11-16 23:59:59"}] + ,"regia": "", + "interpreti": "", + "type": "RaiTv Media Audio Item", + "weblink": "/audio/2020/10/GR-3-e6484841-3f2a-4716-864b-fac256ad0582.html", + "rating": "0", + "scaricabile": "", + "rights-management": { + "Diritti": { + "diretta": {}, + "offline": {}, + "VOD": {}, + "Zona Geografica": {} + } + } + } + diff --git a/data/gr1.json b/data/gr1.json new file mode 100644 index 0000000..200bdd1 --- /dev/null +++ b/data/gr1.json @@ -0,0 +1,312 @@ + + { + "Name" : "GR 1", + "ID" : "Page-7713084b-738a-4594-9cef-2c13f8de81cf", + "pathID" : "/programmi/gr1/index.html?json", + "channel" : "Rai Radio 1", + + "pathFirstItem" : "/audio/2020/10/GR1-ore-13-del-09112020-544316aa-ecfc-45b0-82fa-4c3e36be4430.html?json", + + "durataFirstItem" : "", + + "infoProg": { + "categoriaProgramma": { + "id": "Category-95f615b5-52d8-4116-ae5d-de68f08d3b55", + "nome": "GR 1" + } + + , + + + + "tipologia" : [ + {"nome": "Programma Radio", + "id" : "Category-27fea946-557f-4ee3-8a30-2a390e731de9"}], + + "channel":"Rai Radio 1", + + "editor" : "", + "social" : { + "sms" : "", + "telefono" : "", + "whatsapp" : "", + "email" : "" + }, + "orario" : "", + "generi" :[ + {"nome" : "Informazione", + "id" : "Category-b85c5541-2371-4690-8586-55c17f5d85af"} + ], + "correlati" : "Category:Programma%20Radio:Category-27fea946-557f-4ee3-8a30-2a390e731de9^Category:Informazione:Category-b85c5541-2371-4690-8586-55c17f5d85af^", + "sottogenere" : [], + "subtitle" : "", + "anno" : "", + "regia" : "", + "produzione" : "", + "country" : "", + + "durataFirstItem" : "", + + "interpreti" : "", + "conduttore" : "", + "numeroStagioni" : "", + "description" : "25 edizioni al giorno 24 ore su 24. Aggiornamenti continui, fili diretti sull'attualit\u00E0 e breaking news. Per essere sempre informati.", + "label":"", + + + "ID" : "ContentItem-49393892-fb23-4999-8fb7-640bf1a55250", + + "name" : "GR 1", + + "weblink" : "/programmi/gr1", + "PathID" : "/programmi/gr1/index.html?json", + "az" : true, + "images": { + "landscape" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2018/09/18/1537271328652_Gr1_2048x1152.jpg", + "portrait" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/10/26/1509000741137_GR_1152x2048.jpg", + "square" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/12/19/1513679074202_Gr1.jpg_2048.jpg", + "landscape43" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/10/26/1509000741138_GR_2048x1536.jpg", + "portrait43" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/10/26/1509000741138_GR_1536x2048.jpg", + "portrait_logo" : "", + "landscape_logo" : "" + }, + + "rights-management" : { + "Diritti" : { + "diretta":{ + }, + "offline":{ + }, + "VOD":{ + },"Zona Geografica":{ + } + } + } + , + + + "sito": "", + "bsp" : "rplr_aod_radio1", + "fmt" : "", + "keyw" : "", + "banner300x250" : "", + "bannerUnicoLoc": "", + + "dfp" : { + "label" : "" + + ,"name_escaped" : "GR1" + + ,"generi_escaped" : [ + {"nome" : "Informazione", + "id" : "Category-b85c5541-2371-4690-8586-55c17f5d85af"} + ] + + ,"tipologia_escaped" : [ + {"nome": "ProgrammaRadio", + "id" : "Category-27fea946-557f-4ee3-8a30-2a390e731de9"}] + + }, + + "adv": true, + "type" : "Programma Radio" + + }, + "Blocks": [ + { + "Name" : "Puntate e Podcast", + "ID" : "PublishingBlock-cc06a6b9-fc0c-468b-8010-72480ea8b8df", + "type" : "PLR puntate Block", + "template" : "list", + + "Sets":[{ + "Name" : "Novembre 2020", + "ID" : "ContentSet-5182a05b-58f0-4dc2-b8d8-f84dfd1e4a41", + "url" : "/programmi/gr1/puntate/ContentSet-5182a05b-58f0-4dc2-b8d8-f84dfd1e4a41.html?json" + } + ] + + } + ,{ + "Name" : "GR 1", + "ID" : "PublishingBlock-fbe55df2-6055-46d4-abf5-e0515a9134b4", + "type" : "Rai Radio Testata Programma Block", + "template" : "list", + + "Sets":[] + + } + ,{ + "Name" : "Clip", + "ID" : "PublishingBlock-da015d9c-ad14-4a1c-97b6-7fc5c088f10f", + "type" : "Rai Radio Archivio Audio Block", + "template" : "list", + + "Sets":[{ + "Name" : "Clip", + "ID" : "ContentSet-4020084f-7f9f-4d2d-81ac-5ec81395a4f2", + "url" : "/programmi/gr1/puntate/ContentSet-4020084f-7f9f-4d2d-81ac-5ec81395a4f2.html?json" + } + ] + + } + ,{ + "Name" : "Raccolte", + "ID" : "PublishingBlock-18c87f31-7363-4083-86ca-b751221d885b", + "type" : "Rai Radio Playlist Block", + "template" : "list", + + "lanci" : [ + { + "name" : "GR 1 - Sergio Zavoli", + "type" : "Rai Radio Playlist Set", + "ID":"ContentItem-34ebd85d-1e3b-4733-9011-4547a8605b32", + "pathID" : "/playlist/ContentSet-b3ba2cab-1428-44c4-bf22-316c91a97b61.html?json", + "sub-type": "Rai Radio Playlist Set", + "description":"A 96 anni \u00E8 morto Sergio Zavoli, maestro del giornalismo italiano. Radiocronista, condirettore del telegiornale, direttore del Gr, presidente della Rai, \u00E8 stato autore di inchieste che hanno fatto la storia. Il ricordo di Radio 1", + "subtitle": "A 96 anni \u00E8 morto Sergio Zavoli, maestro del giornalismo italiano. Radiocronista, condirettore del telegiornale, direttore del Gr, presidente della Rai, \u00E8 stato autore di inchieste che hanno fatto la storia. Il ricordo di Radio 1", + "channel": "Rai Radio 1", + "title": "GR 1 - Sergio Zavoli", + "images": { + "landscape": "http://www.rai.it/resizegd/[RESOLUTION]/dl/img/2020/08/06/1596721372592_gr%201%20-%20sergio%20zavoli%202048x2048.png", + "portrait": "", + "square": "", + "landscape43": "", + "portrait43": "" + } + } + , + { + "name" : "GR 1 - Xylella", + "type" : "Rai Radio Playlist Set", + "ID":"ContentItem-a35046ed-8c8c-4a67-8340-17f4526c28b8", + "pathID" : "/playlist/ContentSet-c2fba081-4d1a-4207-af02-517c97f2003b.html?json", + "sub-type": "Rai Radio Playlist Set", + "description":"", + "subtitle": "Il viaggio del GR 1 nelle zone del Salento colpite dal batterio della Xylella fastidiosa. Di Simone Zazzera", + "channel": "Rai Radio 1", + "title": "GR 1 - Xylella", + "images": { + "landscape": "http://www.rai.it/resizegd/[RESOLUTION]/dl/img/2019/10/22/1571741371814_gr%201%20raccolta%20-%20xylella%202048x2048.jpg", + "portrait": "", + "square": "", + "landscape43": "", + "portrait43": "" + } + } + , + { + "name" : "GR 1 - Incidenti sul lavoro", + "type" : "Rai Radio Playlist Set", + "ID":"ContentItem-04269a53-2669-46bb-a006-9eb556799efd", + "pathID" : "/playlist/ContentSet-d6322747-5164-423e-89a0-9d12556fd0cd.html?json", + "sub-type": "Rai Radio Playlist Set", + "description":"", + "subtitle": "La raccolta delle testimonianze del GR 1. Di Fulvio Migliaccio", + "channel": "Rai Radio 1", + "title": "GR 1 - Incidenti sul lavoro", + "images": { + "landscape": "http://www.rai.it/resizegd/[RESOLUTION]/dl/img/2019/10/03/1570110560102_gr%201%20raccolta%20-%20incidenti%20sul%20lavoro%202048x2048.jpg", + "portrait": "", + "square": "", + "landscape43": "", + "portrait43": "" + } + } + , + { + "name" : "GR 1 - Mafia nigeriana", + "type" : "Rai Radio Playlist Set", + "ID":"ContentItem-58136370-4f23-4383-968d-67cabaf05d88", + "pathID" : "/playlist/ContentSet-4212e09b-80c0-43f1-a7db-2cc55446cf88.html?json", + "sub-type": "Rai Radio Playlist Set", + "description":"", + "subtitle": "L'inchiesta del GR 1 sulla mafia nigeriana. Di simone Zazzera", + "channel": "Rai Radio 1", + "title": "GR 1 - Mafia nigeriana", + "images": { + "landscape": "http://www.rai.it/resizegd/[RESOLUTION]/dl/img/2019/08/28/1566996012126_gr%201%20-%20mafia%20nigeriana%202048x2048.jpg", + "portrait": "", + "square": "", + "landscape43": "", + "portrait43": "" + } + } + , + { + "name" : "GR 1 - Cosa nostra all'estero", + "type" : "Rai Radio Playlist Set", + "ID":"ContentItem-9266b1c5-43c8-40e6-b447-9c50bc5bdde0", + "pathID" : "/playlist/ContentSet-f832b4b6-1c5a-4ef9-8097-d508eae5b546.html?json", + "sub-type": "Rai Radio Playlist Set", + "description":"", + "subtitle": "Il viaggio di Radio 1 nell'Europa delle mafie. Di Anna Milan", + "channel": "Rai Radio 1", + "title": "GR 1 - Cosa nostra all'estero", + "images": { + "landscape": "http://www.rai.it/resizegd/[RESOLUTION]/dl/img/2019/07/10/1562764715610_gr%201%20raccolta%20cosa%20nostra%20allestero%202048x2048.jpg", + "portrait": "", + "square": "", + "landscape43": "", + "portrait43": "" + } + } + , + { + "name" : "La 'ndrangheta in Europa", + "type" : "Rai Radio Playlist Set", + "ID":"ContentItem-5fe45d6e-8906-4cf6-8624-7c3b9ad33851", + "pathID" : "/playlist/ContentSet-abc214e1-ca86-4955-ba85-e5058ac96faf.html?json", + "sub-type": "Rai Radio Playlist Set", + "description":"", + "subtitle": "Il viaggio di Radio 1 sulle tracce della 'ndrangheta in Europa. Pi\u00F9 di 40 miliardi all'anno di fatturato, un'organizzazione criminale efficientissima e la capacit\u00E0 di muoversi sotto traccia.", + "channel": "Rai Radio 1", + "title": "La 'ndrangheta in Europa", + "images": { + "landscape": "http://www.rai.it/resizegd/[RESOLUTION]/dl/img/2019/02/11/1549890818591_gr%201%20raccolta%20ndrangheta%202048x2048.jpg", + "portrait": "", + "square": "", + "landscape43": "", + "portrait43": "" + } + } + , + { + "name" : "Verso le Europee 2019", + "type" : "Rai Radio Playlist Set", + "ID":"ContentItem-799fa3d8-47d2-4b70-a18a-aa0501a94b15", + "pathID" : "/playlist/ContentSet-870ce743-2b3a-445d-b02c-1917ef18b9fc.html?json", + "sub-type": "Rai Radio Playlist Set", + "description":"", + "subtitle": "Come si preparano alle Elezioni del 26 maggio gli Stati dell'Unione europea.", + "channel": "Rai Radio 1", + "title": "Verso le Europee 2019", + "images": { + "landscape": "http://www.rai.it/resizegd/[RESOLUTION]/dl/img/2019/02/21/1550761197314_gr1%20raccolta%20-%20verso%20le%20europee%202019%202048x2048.jpg", + "portrait": "", + "square": "", + "landscape43": "", + "portrait43": "" + } + } + ] + + } + ,{ + "Name" : "GR 1 - Video", + "ID" : "PublishingBlock-70401504-1035-4b08-b24a-b1f8cb716e1b", + "type" : "Rai Radio Archivio Video Block", + "template" : "list", + + "Sets":[{ + "Name" : "Video", + "ID" : "ContentSet-bbfade55-87a6-49cf-b6b7-be20143d3560", + "url" : "/programmi/gr1/archivio/Video-bbfade55-87a6-49cf-b6b7-be20143d3560.html?json" + } + ] + + } + + ] + } + \ No newline at end of file diff --git a/data/gr2.json b/data/gr2.json new file mode 100644 index 0000000..cb7c3f4 --- /dev/null +++ b/data/gr2.json @@ -0,0 +1,119 @@ + + { + "Name" : "GR 2", + "ID" : "Page-89c03ef0-229b-4cbb-89f3-e3ce357be518", + "pathID" : "/programmi/gr2/index.html?json", + "channel" : "Rai Radio 2", + + "pathFirstItem" : "/audio/2020/10/GR-2-5bedfea7-3ad2-406b-af96-75f4b40ed09f.html?json", + + "durataFirstItem" : "", + + "infoProg": { + "categoriaProgramma": { + "id": "Category-e1120ba0-b6c7-4fd1-9a42-8b6e42cd2495", + "nome": "GR 2" + } + + , + + + + "tipologia" : [], + + "channel":"Rai Radio 2", + + "editor" : "", + "social" : { + "sms" : "", + "telefono" : "", + "whatsapp" : "", + "email" : "" + }, + "orario" : "", + "generi" :[], + "correlati" : "", + "sottogenere" : [], + "subtitle" : " - ", + "anno" : "", + "regia" : "", + "produzione" : "", + "country" : "", + + "durataFirstItem" : "", + + "interpreti" : "", + "conduttore" : "", + "numeroStagioni" : "", + "description" : "", + "label":"", + + + "ID" : "ContentItem-f9347e13-7150-43ce-b91a-089f890f6d03", + + "name" : "GR 2", + + "weblink" : "/programmi/gr2", + "PathID" : "/programmi/gr2/index.html?json", + "az" : true, + "images": { + "landscape" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/12/19/1513691549801_gr2-ok169.png", + "portrait" : "", + "square" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/12/19/1513691544594_gr2-ok.png", + "landscape43" : "", + "portrait43" : "", + "portrait_logo" : "", + "landscape_logo" : "" + }, + + "rights-management" : { + "Diritti" : { + "diretta":{ + }, + "offline":{ + }, + "VOD":{ + },"Zona Geografica":{ + } + } + } + , + + + "sito": "", + "bsp" : "rplr_aod_radio2", + "fmt" : "", + "keyw" : "", + "banner300x250" : "", + "bannerUnicoLoc": "", + + "dfp" : { + "label" : "" + + ,"name_escaped" : "GR2" + + }, + + "adv": true, + "type" : "" + + }, + "Blocks": [ + { + "Name" : "Puntate e Podcast", + "ID" : "PublishingBlock-ed08f07d-b6fc-49f3-921d-54f0914d866b", + "type" : "PLR puntate Block", + "template" : "list", + + "Sets":[{ + "Name" : "GR 2 - Edizioni", + "ID" : "ContentSet-d733cab3-a77c-4d7b-9783-f74af627282d", + "url" : "/programmi/gr2/puntate/ContentSet-d733cab3-a77c-4d7b-9783-f74af627282d.html?json" + } + ] + + } + + ] + } + \ No newline at end of file diff --git a/data/gr3.json b/data/gr3.json new file mode 100644 index 0000000..8aaff55 --- /dev/null +++ b/data/gr3.json @@ -0,0 +1,119 @@ + + { + "Name" : "GR 3", + "ID" : "Page-398e7cb2-58b2-421c-bf6b-1ef8bc9433ec", + "pathID" : "/programmi/gr3/index.html?json", + "channel" : "Rai Radio 3", + + "pathFirstItem" : "/audio/2020/10/GR-3-e6484841-3f2a-4716-864b-fac256ad0582.html?json", + + "durataFirstItem" : "", + + "infoProg": { + "categoriaProgramma": { + "id": "Category-5bae7eff-f3f0-4d72-87d8-70d6a5f544bd", + "nome": "GR 3" + } + + , + + + + "tipologia" : [], + + "channel":"Rai Radio 3", + + "editor" : "", + "social" : { + "sms" : "", + "telefono" : "", + "whatsapp" : "", + "email" : "" + }, + "orario" : "", + "generi" :[], + "correlati" : "", + "sottogenere" : [], + "subtitle" : " - ", + "anno" : "", + "regia" : "", + "produzione" : "", + "country" : "", + + "durataFirstItem" : "", + + "interpreti" : "", + "conduttore" : "", + "numeroStagioni" : "", + "description" : "A cura della redazione del Giornale Radio Rai", + "label":"", + + + "ID" : "ContentItem-0e20c0f7-d820-40f1-a489-2785557ffad2", + + "name" : "GR 3", + + "weblink" : "/programmi/gr3", + "PathID" : "/programmi/gr3/index.html?json", + "az" : true, + "images": { + "landscape" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/10/26/1509000741137_GR_2048x1152.jpg", + "portrait" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/10/26/1509000741137_GR_1152x2048.jpg", + "square" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/10/26/1509000741137_GR_2048x2048.jpg", + "landscape43" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/10/26/1509000741138_GR_2048x1536.jpg", + "portrait43" : "https://www.raiplayradio.it/resizegd/[RESOLUTION]/dl/img/2017/10/26/1509000741138_GR_1536x2048.jpg", + "portrait_logo" : "", + "landscape_logo" : "" + }, + + "rights-management" : { + "Diritti" : { + "diretta":{ + }, + "offline":{ + }, + "VOD":{ + },"Zona Geografica":{ + } + } + } + , + + + "sito": "", + "bsp" : "rplr_aod_radio3", + "fmt" : "", + "keyw" : "", + "banner300x250" : "", + "bannerUnicoLoc": "", + + "dfp" : { + "label" : "" + + ,"name_escaped" : "GR3" + + }, + + "adv": true, + "type" : "" + + }, + "Blocks": [ + { + "Name" : "Puntate e Podcast", + "ID" : "PublishingBlock-ec905abe-d63e-4e89-a350-52b437670a39", + "type" : "PLR puntate Block", + "template" : "list", + + "Sets":[{ + "Name" : "GR 3 - Edizioni", + "ID" : "ContentSet-2a84533c-0abd-4ec4-8e8b-78d484fe1888", + "url" : "/programmi/gr3/puntate/ContentSet-2a84533c-0abd-4ec4-8e8b-78d484fe1888.html?json" + } + ] + + } + + ] + } + \ No newline at end of file diff --git a/gr1 b/gr1 new file mode 100644 index 0000000..cee64e8 --- /dev/null +++ b/gr1 @@ -0,0 +1,72 @@ +#!/bin/bash +# +# +#################################################################################### +# script che recupera l'ultimo podcast del gr1 +# +#v:1.0 Novembre 2020 +# +# dipendenze: curl,jq,cat,wget,ffmpeg +# +# +#################################################################################### + +# set global variable + +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 + + +# get jason data +curl -A "$ag" "$gr1api" -o data/gr1.json +echo " " +echo "get data api... done!" +echo " " + + +# extract jason data of the last podcast + +dataL=`cat ./data/gr1.json | jq -r ."pathFirstItem"` + +echo " " +echo log: $dataL +echo " " + +curl -A "$ag" "$grbase$dataL" -o data/Lgr1.json + +Lpodcast=`cat ./data/Lgr1.json | jq -r '.["audio"] | .contentUrl'` + +echo " " +echo log: $Lpodcast +echo " " + + +# extract time and date onair podcast + +ora=`cat ./data/Lgr1.json | jq -r ."timePublished"` +Ora=`echo $ora | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'` + +data=`cat ./data/Lgr1.json | jq -r ."datePublished"` +Data=`echo $data | sed -e 's/\//\-/g'` + +echo " " +echo log: $Data $Ora +echo " " +echo " " + + +# download podcast + +wget -d -c -U "$ag" "$Lpodcast" -O gr1_"$Data"_"$Ora".mp3 + +# encode audio data... small file + +#ffmpeg -i gr1_"$Data"_"$Ora".mp3 -vn -acodec aac -ab 80k gr1_"$Data"_"$Ora".m4a +ffmpeg -i gr1_"$Data"_"$Ora".mp3 -acodec libopus -b:a 64k gr1_"$Data"_"$Ora".opus +rm gr1_"$Data"_"$Ora".mp3 \ No newline at end of file diff --git a/gr2 b/gr2 new file mode 100644 index 0000000..8bbb784 --- /dev/null +++ b/gr2 @@ -0,0 +1,72 @@ +#!/bin/bash +# +# +#################################################################################### +# script che recupera l'ultimo podcast del gr2 +# +#v:1.0 Novembre 2020 +# +# dipendenze: curl,jq,cat,wget,ffmpeg +# +# +#################################################################################### + +# set global variable + +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 + + +# get jason data +curl -A "$ag" "$gr2api" -o data/gr2.json +echo " " +echo "get data api... done!" +echo " " + + +# extract jason data of the last podcast + +dataL=`cat ./data/gr2.json | jq -r ."pathFirstItem"` + +echo " " +echo log: $dataL +echo " " + +curl -A "$ag" "$grbase$dataL" -o data/Lgr2.json + +Lpodcast=`cat ./data/Lgr2.json | jq -r '.["audio"] | .contentUrl'` + +echo " " +echo log: $Lpodcast +echo " " + + +# extract time and date onair podcast + +ora=`cat ./data/Lgr2.json | jq -r ."timePublished"` +Ora=`echo $ora | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'` + +data=`cat ./data/Lgr2.json | jq -r ."datePublished"` +Data=`echo $data | sed -e 's/\//\-/g'` + +echo " " +echo log: $Data $Ora +echo " " +echo " " + + +# download podcast + +wget -d -c -U "$ag" "$Lpodcast" -O gr2_"$Data"_"$Ora".mp3 + +# encode audio data... small file + +#ffmpeg -i gr2_"$Data"_"$Ora".mp3 -vn -acodec aac -ab 80k gr2_"$Data"_"$Ora".m4a +ffmpeg -i gr2_"$Data"_"$Ora".mp3 -acodec libopus -b:a 64k gr2_"$Data"_"$Ora".opus +rm gr2_"$Data"_"$Ora".mp3 \ No newline at end of file diff --git a/gr3 b/gr3 new file mode 100644 index 0000000..b0d7f5a --- /dev/null +++ b/gr3 @@ -0,0 +1,72 @@ +#!/bin/bash +# +# +#################################################################################### +# script che recupera l'ultimo podcast del gr3 +# +#v:1.0 Novembre 2020 +# +# dipendenze: curl,jq,cat,wget,ffmpeg +# +# +#################################################################################### + +# set global variable + +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 + + +# get jason data +curl -A "$ag" "$gr3api" -o data/gr3.json +echo " " +echo "get data api... done!" +echo " " + + +# extract jason data of the last podcast + +dataL=`cat ./data/gr3.json | jq -r ."pathFirstItem"` + +echo " " +echo log: $dataL +echo " " + +curl -A "$ag" "$grbase$dataL" -o data/Lgr3.json + +Lpodcast=`cat ./data/Lgr3.json | jq -r '.["audio"] | .contentUrl'` + +echo " " +echo log: $Lpodcast +echo " " + + +# extract time and date onair podcast + +ora=`cat ./data/Lgr3.json | jq -r ."timePublished"` +Ora=`echo $ora | sed -e 's/\ /\n/g' | grep ":"| sed -e 's/\:/\_/g'` + +data=`cat ./data/Lgr3.json | jq -r ."datePublished"` +Data=`echo $data | sed -e 's/\//\-/g'` + +echo " " +echo log: $Data $Ora +echo " " +echo " " + + +# download podcast + +wget -d -c -U "$ag" "$Lpodcast" -O gr3_"$Data"_"$Ora".mp3 + +# encode audio data... small file + +#ffmpeg -i gr3_"$Data"_"$Ora".mp3 -vn -acodec aac -ab 80k gr3_"$Data"_"$Ora".m4a +ffmpeg -i gr3_"$Data"_"$Ora".mp3 -acodec libopus -b:a 64k gr3_"$Data"_"$Ora".opus +rm gr3_"$Data"_"$Ora".mp3 \ No newline at end of file diff --git a/note.md b/note.md new file mode 100644 index 0000000..cb9dfc5 --- /dev/null +++ b/note.md @@ -0,0 +1,28 @@ +## Italian Note version: + +Gli script sono nati principalmente per i seguenti motivi: + +- ero stufo di utilizzare app o sito ufficiale perchè pieni di traccianti + +- il podcast non utilizza il formato rss xml per la sua fruizione ma un formato proprietario, l'app! + +- sito e app fanno un uso pesante di javascript e chissà cos'altro.. sprecano le risorse del pc inutilmente, questo comporta che spesso il browser o l'app si blocchi. I controlli del player web non funzionano su tutti i sistemi.... potrei continuare all'infinito.. + +- troppa publicità, visto che è un servizio pubblico finanziato dal canone tv. Mi obbligano ad iscrivermi a facebook, per fruire dei contenuti... + +- dover "acquistare" pc gaming o un telefono "gaming "per poter ascolatare un podcast è stupido... da indiscrezioni di amici pare che l'hardware citato potrebbe essere insufficente a fruire dei servizi rai! + +- utilizzando un raspberry pi, cron, gli script citati e [syncthing](https://syncthing.net/) sincronizzo i podcast scaricati in automatico in tutti i miei dispositivi, risparmiando banda dati mobile quando sono fuori casa perchè l'audio è compresso. Posso ascoltare i podcast con un telefono vecchio di un decennio fa! + + +### alcune info tecniche + +i podcast sono mp3 stereo con campionamento a 48KhZ e bitrate a 256KBps (alta qualità, file grandi) mediamente per il gr1 dai 20 minuti in su, siamo intorno ai 45 MB o superiore come peso per singolo file... + + Ricodificandoli in opus ho file che pesano 12MB circa, qualità audio invariata, su rete mobile quando li sincronizo, risparmio 4 volte la banda dati che normalmente dovrei usare, e non è poco. + +Per chi volesse nello script è possibile codificare in aac basta commentare o deccommentare le ultime righe del codice. + +Si può disabilitare del tutto la codifica commentando con # le righe da 70 a 72 + + diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..9f8e9b6 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +1.0 \ No newline at end of file