#1 Le 09/02/2021, à 23:30
- alex2423
[SED] Parser de manière recursive
Hello la compagnie,
Cela faisait que je n'étais pas passé ici
Voilà, j'ai récupéré un petit script bash qui a pour but de récupérer les url des podcasts des radios dans des fichiers XML. Sed est utilisé pour parser les url des radios, malheureusement je m'apercois que les podcasts ne sont pas toujours tous récupérées sur certaines radios. . Je pense qu'il manque la réccursivité
J'ai repris le morceau de code intéressant du script avec sed. Le pattern me semble cohérent mais je pense qu'il manque une option pour traiter de manière globale ou un truc dans le genre.
pi@raspberrypi:~/mpd $ echo 'ddd url = "url1" url = "url2" klqjsdklqj' | sed -n 's/.*url *= *"\([^"]*\)".*/\1/p'
url2
pi@raspberrypi:~/mpd $
Je pensais qu'il suffirait de mettre "g" à la fin (et supprimer par la même occasion le "p" (et option -n de sed)
pi@raspberrypi:~/mpd $ echo 'ddd url = "url1" url = "url2" klqjsdklqj' | sed 's/.*url *= *"\([^"]*\)".*/\1/g'
url2
Le résultat attendu est :
url1
url2
Hors ligne
#2 Le 10/02/2021, à 00:44
- Watael
Re : [SED] Parser de manière recursive
le XML ne se traite pas avec sed, mais avec un parser de ... xml
tel que xmlstarlet, xmllint, xalan..., ou un langage qui possède une bibliothèque pour le faire aussi proprement.
quelle est l'adresse de la liste des podcasts ?
Connected \o/
Welcome to sHell. · eval is evil.
Hors ligne
#3 Le 10/02/2021, à 09:13
- alex2423
Re : [SED] Parser de manière recursive
Salut Watel,
Il s'agit par exemple de celui là : https://www.rtl.fr/podcast/le-journal-rtl.xml
Et donc
wget -q https://www.rtl.fr/podcast/le-journal-rtl.xml -O - | tr '\r' '\n' | tr \' \" | sed -n 's/.*url *= *"\([^"]*\)".*/\1/p'
J'avais justement prévu à terme de remodifier le code en Python et de parser avec la bibliothèque Beautifull Soup. Débutant dans ce langage et je me suis dit pourquoi pas essayer de le traduire en Python, cela me fera un bon exercice, mais cela me demande pas mal d'effort d'autant plus que je n'ai pas pratiqué depuis plusieurs mois, j'ai un peu oublié .
Dans un premier temps, j'ai voulu au plus vite et modifier le sed. Alors je suis d'accord que ce n'est pas très adapté mais cela fonctionne pas trop mal, hormis pour cette radio.
Hors ligne
#4 Le 10/02/2021, à 10:48
- MicP
Re : [SED] Parser de manière recursive
Bonjour
C'est la première fois que j'utilise la commande xmllint
alors je pense qu'il doit y avoir moyen de se passer de sed
mais en attendant … :
wget -qO- https://www.rtl.fr/podcast/le-journal-rtl.xml | xmllint --xpath /rss/channel/item/enclosure/@url - | sed 's/^ url="\(.*\)"/\1/'
Dernière modification par MicP (Le 10/02/2021, à 15:10)
Hors ligne
#5 Le 10/02/2021, à 17:28
- Watael
Re : [SED] Parser de manière recursive
xmlstarlet sel -t -v '/rss/channel/item/enclosure/@url' -n fichier.xml
[spoiler]je n'ai pas trouvé ça tout seul[/spoiler]
Dernière modification par Watael (Le 10/02/2021, à 17:36)
Connected \o/
Welcome to sHell. · eval is evil.
Hors ligne
#6 Le 10/02/2021, à 17:41
- alex2423
Re : [SED] Parser de manière recursive
Je viens de regarder sur un podcast de France Inter et à ma grande surprise, le chemin pour accéder à l'url est /rss/channel/item/enclosure/@url
Et pourtant avec le sed, cela fonctionne.
wget -q http://radiofrance-podcast.net/podcast09/rss_14934.xml -O - | tr '\r' '\n' | tr \' \" | sed -n 's/.*url *= *"\([^"]*\)".*/\1/p'
Pour installer xmllint, il semblerait qu'il n'y ait malheureusement pas de version précompilé et à déposer dans /usr/bin comme pour youtube-dl. Il faut compiler soit même.
J'ai donc télécharger cette version : http://xmlsoft.org/sources/libxml2-2.9.7-rc1.tar.gz
Puis j'ai fait un ./configure puis un make :
$ make
make all-recursive
make[1]: Entering directory '/home/pi/xml/libxml2-2.9.7'
Making all in include
make[2]: Entering directory '/home/pi/xml/libxml2-2.9.7/include'
Making all in libxml
make[3]: Entering directory '/home/pi/xml/libxml2-2.9.7/include/libxml'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/pi/xml/libxml2-2.9.7/include/libxml'
make[3]: Entering directory '/home/pi/xml/libxml2-2.9.7/include'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/pi/xml/libxml2-2.9.7/include'
make[2]: Leaving directory '/home/pi/xml/libxml2-2.9.7/include'
Making all in .
make[2]: Entering directory '/home/pi/xml/libxml2-2.9.7'
CC SAX.lo
CC entities.lo
entities.c: In function ‘xmlCopyEntitiesTable__internal_alias’:
entities.c:952:31: warning: cast between incompatible function types from ‘xmlEntity * (*)(xmlEntity *)’ {aka ‘struct _xmlEntity * (*)(struct _xmlEntity *)’} to ‘void * (*)(void *, xmlChar *)’ {aka ‘void * (*)(void *, unsigned char *)’} [-Wcast-function-type]
return(xmlHashCopy(table, (xmlHashCopier) xmlCopyEntity));
^
entities.c: In function ‘xmlDumpEntitiesTable__internal_alias’:
entities.c:1106:24: warning: cast between incompatible function types from ‘void (*)(xmlEntity *, xmlBuffer *)’ {aka ‘void (*)(struct _xmlEntity *, struct _xmlBuffer *)’} to ‘void (*)(void *, void *, xmlChar *)’ {aka ‘void (*)(void *, void *, unsigned char *)’} [-Wcast-function-type]
xmlHashScan(table, (xmlHashScanner)xmlDumpEntityDeclScan, buf);
^
CC encoding.lo
encoding.c: In function ‘UTF16LEToUTF8’:
encoding.c:497:26: warning: cast increases required alignment of target type [-Wcast-align]
unsigned short* in = (unsigned short*) inb;
^
encoding.c: In function ‘UTF8ToUTF16LE’:
encoding.c:579:27: warning: cast increases required alignment of target type [-Wcast-align]
unsigned short* out = (unsigned short*) outb;
^
encoding.c: In function ‘UTF16BEToUTF8’:
encoding.c:735:26: warning: cast increases required alignment of target type [-Wcast-align]
unsigned short* in = (unsigned short*) inb;
^
encoding.c: In function ‘UTF8ToUTF16BE’:
encoding.c:821:27: warning: cast increases required alignment of target type [-Wcast-align]
unsigned short* out = (unsigned short*) outb;
^
CC error.lo
error.c: In function ‘__xmlRaiseError’:
error.c:634:26: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
else if ((channel == (xmlGenericErrorFunc) fprintf) ||
^
CC parserInternals.lo
parserInternals.c: In function ‘xmlFreeParserCtxt__internal_alias’:
parserInternals.c:1798:40: warning: cast between incompatible function types from ‘xmlFreeFunc’ {aka ‘void (*)(void *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
xmlHashFree(ctxt->attsDefault, (xmlHashDeallocator) xmlFree);
^
CC parser.lo
parser.c: In function ‘xmlGROW’:
parser.c:2089:68: warning: cast between incompatible function types from ‘int (*)(void)’ to ‘int (*)(void *, char *, int)’ [-Wcast-function-type]
((ctxt->input->buf) && (ctxt->input->buf->readcallback != (xmlInputReadCallback) xmlNop)) &&
^
parser.c: In function ‘xmlCtxtReset__internal_alias’:
parser.c:14878:40: warning: cast between incompatible function types from ‘xmlFreeFunc’ {aka ‘void (*)(void *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
xmlHashFree(ctxt->attsDefault, (xmlHashDeallocator) xmlFree);
^
parser.c: In function ‘xmlParseReference__internal_alias’:
parser.c:7039:44: warning: ‘%d’ directive output may be truncated writing between 3 and 10 bytes into a region of size 9 [-Wformat-truncation=]
snprintf((char *)out, sizeof(out), "#%d", value);
^~
parser.c:7039:42: note: directive argument in the range [256, 2147483647]
snprintf((char *)out, sizeof(out), "#%d", value);
^~~~~
parser.c:7039:7: note: ‘snprintf’ output between 5 and 12 bytes into a destination of size 10
snprintf((char *)out, sizeof(out), "#%d", value);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
parser.c:7037:47: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
snprintf((char *)out, sizeof(out), "#x%X", value);
^
parser.c:7037:7: note: ‘snprintf’ output between 6 and 11 bytes into a destination of size 10
snprintf((char *)out, sizeof(out), "#x%X", value);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC tree.lo
CC hash.lo
hash.c: In function ‘xmlHashScan3__internal_alias’:
hash.c:916:9: warning: cast between incompatible function types from ‘xmlHashScanner’ {aka ‘void (*)(void *, void *, unsigned char *)’} to ‘void (*)(void *, void *, const xmlChar *, const xmlChar *, const xmlChar *)’ {aka ‘void (*)(void *, void *, const unsigned char *, const unsigned char *, const unsigned char *)’} [-Wcast-function-type]
(xmlHashScannerFull) f, data);
^
CC list.lo
CC xmlIO.lo
xmlIO.c: In function ‘xmlParserInputBufferCreateMem__internal_alias’:
xmlIO.c:2935:22: warning: cast between incompatible function types from ‘int (*)(void)’ to ‘int (*)(void *, char *, int)’ [-Wcast-function-type]
ret->readcallback = (xmlInputReadCallback) xmlNop;
^
CC xmlmemory.lo
CC uri.lo
CC valid.lo
valid.c: In function ‘xmlFreeElementTable__internal_alias’:
valid.c:1608:24: warning: cast between incompatible function types from ‘void (*)(xmlElement *)’ {aka ‘void (*)(struct _xmlElement *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
xmlHashFree(table, (xmlHashDeallocator) xmlFreeElement);
^
valid.c: In function ‘xmlCopyElementTable__internal_alias’:
valid.c:1657:31: warning: cast between incompatible function types from ‘xmlElement * (*)(xmlElement *)’ {aka ‘struct _xmlElement * (*)(struct _xmlElement *)’} to ‘void * (*)(void *, xmlChar *)’ {aka ‘void * (*)(void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashCopier) xmlCopyElement));
^
valid.c: In function ‘xmlDumpElementTable__internal_alias’:
valid.c:1746:24: warning: cast between incompatible function types from ‘void (*)(xmlElement *, xmlBuffer *)’ {aka ‘void (*)(struct _xmlElement *, struct _xmlBuffer *)’} to ‘void (*)(void *, void *, xmlChar *)’ {aka ‘void (*)(void *, void *, unsigned char *)’} [-Wcast-function-type]
xmlHashScan(table, (xmlHashScanner) xmlDumpElementDeclScan, buf);
^
valid.c: In function ‘xmlFreeAttributeTable__internal_alias’:
valid.c:2154:24: warning: cast between incompatible function types from ‘void (*)(xmlAttribute *)’ {aka ‘void (*)(struct _xmlAttribute *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
xmlHashFree(table, (xmlHashDeallocator) xmlFreeAttribute);
^
valid.c: In function ‘xmlCopyAttributeTable__internal_alias’:
valid.c:2202:9: warning: cast between incompatible function types from ‘xmlAttribute * (*)(xmlAttribute *)’ {aka ‘struct _xmlAttribute * (*)(struct _xmlAttribute *)’} to ‘void * (*)(void *, xmlChar *)’ {aka ‘void * (*)(void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashCopier) xmlCopyAttribute));
^
valid.c: In function ‘xmlDumpAttributeTable__internal_alias’:
valid.c:2312:24: warning: cast between incompatible function types from ‘void (*)(xmlAttribute *, xmlBuffer *)’ {aka ‘void (*)(struct _xmlAttribute *, struct _xmlBuffer *)’} to ‘void (*)(void *, void *, xmlChar *)’ {aka ‘void (*)(void *, void *, unsigned char *)’} [-Wcast-function-type]
xmlHashScan(table, (xmlHashScanner) xmlDumpAttributeDeclScan, buf);
^
valid.c: In function ‘xmlFreeNotationTable__internal_alias’:
valid.c:2426:24: warning: cast between incompatible function types from ‘void (*)(xmlNotation *)’ {aka ‘void (*)(struct _xmlNotation *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
xmlHashFree(table, (xmlHashDeallocator) xmlFreeNotation);
^
valid.c: In function ‘xmlCopyNotationTable__internal_alias’:
valid.c:2473:9: warning: cast between incompatible function types from ‘xmlNotation * (*)(xmlNotation *)’ {aka ‘struct _xmlNotation * (*)(struct _xmlNotation *)’} to ‘void * (*)(void *, xmlChar *)’ {aka ‘void * (*)(void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashCopier) xmlCopyNotation));
^
valid.c: In function ‘xmlDumpNotationTable__internal_alias’:
valid.c:2528:24: warning: cast between incompatible function types from ‘void (*)(xmlNotation *, xmlBuffer *)’ {aka ‘void (*)(struct _xmlNotation *, struct _xmlBuffer *)’} to ‘void (*)(void *, void *, xmlChar *)’ {aka ‘void (*)(void *, void *, unsigned char *)’} [-Wcast-function-type]
xmlHashScan(table, (xmlHashScanner) xmlDumpNotationDeclScan, buf);
^
valid.c: In function ‘xmlFreeIDTable__internal_alias’:
valid.c:2664:24: warning: cast between incompatible function types from ‘void (*)(xmlID *)’ {aka ‘void (*)(struct _xmlID *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
xmlHashFree(table, (xmlHashDeallocator) xmlFreeID);
^
valid.c: In function ‘xmlRemoveID__internal_alias’:
valid.c:2764:35: warning: cast between incompatible function types from ‘void (*)(xmlID *)’ {aka ‘void (*)(struct _xmlID *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
xmlHashRemoveEntry(table, ID, (xmlHashDeallocator) xmlFreeID);
^
valid.c: In function ‘xmlFreeRefTable__internal_alias’:
valid.c:3005:24: warning: cast between incompatible function types from ‘void (*)(xmlList *)’ {aka ‘void (*)(struct _xmlList *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
xmlHashFree(table, (xmlHashDeallocator) xmlFreeRefList);
^
valid.c: In function ‘xmlRemoveRef__internal_alias’:
valid.c:3102:45: warning: cast between incompatible function types from ‘void (*)(xmlList *)’ {aka ‘void (*)(struct _xmlList *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
xmlHashUpdateEntry(table, ID, NULL, (xmlHashDeallocator)
^
CC xlink.lo
CC HTMLparser.lo
HTMLparser.c: In function ‘htmlCtxtReset__internal_alias’:
HTMLparser.c:6677:40: warning: cast between incompatible function types from ‘xmlFreeFunc’ {aka ‘void (*)(void *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
xmlHashFree(ctxt->attsDefault, (xmlHashDeallocator) xmlFree);
^
CC HTMLtree.lo
CC debugXML.lo
debugXML.c: In function ‘xmlCtxtDumpEntities’:
debugXML.c:1292:28: warning: cast between incompatible function types from ‘void (*)(xmlEntity *, xmlDebugCtxt *)’ {aka ‘void (*)(struct _xmlEntity *, struct _xmlDebugCtxt *)’} to ‘void (*)(void *, void *, xmlChar *)’ {aka ‘void (*)(void *, void *, unsigned char *)’} [-Wcast-function-type]
xmlHashScan(table, (xmlHashScanner) xmlCtxtDumpEntityCallback,
^
debugXML.c:1302:28: warning: cast between incompatible function types from ‘void (*)(xmlEntity *, xmlDebugCtxt *)’ {aka ‘void (*)(struct _xmlEntity *, struct _xmlDebugCtxt *)’} to ‘void (*)(void *, void *, xmlChar *)’ {aka ‘void (*)(void *, void *, unsigned char *)’} [-Wcast-function-type]
xmlHashScan(table, (xmlHashScanner) xmlCtxtDumpEntityCallback,
^
debugXML.c: In function ‘xmlShellRNGValidate’:
debugXML.c:2366:6: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
(xmlRelaxNGValidityErrorFunc) fprintf,
^
debugXML.c:2367:6: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
(xmlRelaxNGValidityWarningFunc) fprintf,
^
debugXML.c:2378:6: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
(xmlRelaxNGValidityErrorFunc) fprintf,
^
debugXML.c:2379:6: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
(xmlRelaxNGValidityWarningFunc) fprintf,
^
debugXML.c: In function ‘xmlShellValidate__internal_alias’:
debugXML.c:2650:19: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
vctxt.error = (xmlValidityErrorFunc) fprintf;
^
debugXML.c:2651:21: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
vctxt.warning = (xmlValidityWarningFunc) fprintf;
^
CC xpath.lo
xpath.c: In function ‘xmlXPathDistinctSorted__internal_alias’:
xpath.c:4585:23: warning: cast between incompatible function types from ‘xmlFreeFunc’ {aka ‘void (*)(void *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
xmlHashFree(hash, (xmlHashDeallocator) xmlFree);
^
In file included from ./include/libxml/parser.h:18,
from ./include/libxml/globals.h:18,
from ./include/libxml/threads.h:35,
from ./include/libxml/xmlmemory.h:218,
from ./include/libxml/tree.h:1307,
from ./include/libxml/c14n.h:27,
from elfgcchack.h:17,
from libxml.h:106,
from xpath.c:23:
xpath.c: In function ‘xmlXPathRegisterFuncNS__internal_alias’:
xpath.c:4897:73: warning: ISO C forbids passing argument 4 of ‘xmlHashAddEntry2__internal_alias’ between function pointer and ‘void *’ [-Wpedantic]
return(xmlHashAddEntry2(ctxt->funcHash, name, ns_uri, XML_CAST_FPTR(f)));
^
./include/libxml/hash.h:56:29: note: in definition of macro ‘XML_CAST_FPTR’
#define XML_CAST_FPTR(fptr) fptr
^~~~
In file included from libxml.h:106,
from xpath.c:23:
elfgcchack.h:4269:36: note: expected ‘void *’ but argument is of type ‘xmlXPathFunction’ {aka ‘void (*)(struct _xmlXPathParserContext *, int)’}
extern __typeof (xmlHashAddEntry2) xmlHashAddEntry2__internal_alias __attribute((visibility("hidden")));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xpath.c: In function ‘xmlXPathFunctionLookupNS__internal_alias’:
xpath.c:4978:24: warning: ISO C forbids assignment between function pointer and ‘void *’ [-Wpedantic]
XML_CAST_FPTR(ret) = xmlHashLookup2(ctxt->funcHash, name, ns_uri);
^
xpath.c: In function ‘xmlXPathRegisterVariableNS__internal_alias’:
xpath.c:5047:29: warning: cast between incompatible function types from ‘void (*)(xmlXPathObject *)’ {aka ‘void (*)(struct _xmlXPathObject *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashDeallocator)xmlXPathFreeObject));
^
xpath.c:5050:11: warning: cast between incompatible function types from ‘void (*)(xmlXPathObject *)’ {aka ‘void (*)(struct _xmlXPathObject *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashDeallocator)xmlXPathFreeObject));
^
xpath.c: In function ‘xmlXPathRegisteredVariablesCleanup__internal_alias’:
xpath.c:5140:32: warning: cast between incompatible function types from ‘void (*)(xmlXPathObject *)’ {aka ‘void (*)(struct _xmlXPathObject *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
xmlHashFree(ctxt->varHash, (xmlHashDeallocator)xmlXPathFreeObject);
^
xpath.c: In function ‘xmlXPathRegisterNs__internal_alias’:
xpath.c:5171:28: warning: cast between incompatible function types from ‘xmlFreeFunc’ {aka ‘void (*)(void *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashDeallocator)xmlFree));
^
xpath.c:5173:10: warning: cast between incompatible function types from ‘xmlFreeFunc’ {aka ‘void (*)(void *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashDeallocator)xmlFree));
^
xpath.c: In function ‘xmlXPathRegisteredNsCleanup__internal_alias’:
xpath.c:5222:31: warning: cast between incompatible function types from ‘xmlFreeFunc’ {aka ‘void (*)(void *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
xmlHashFree(ctxt->nsHash, (xmlHashDeallocator)xmlFree);
^
In file included from xpath.c:483:
At top level:
trionan.c:218:1: warning: ‘trio_is_negative’ defined but not used [-Wunused-function]
trio_is_negative
^~~~~~~~~~~~~~~~
trionan.c:194:1: warning: ‘trio_is_special_quantity’ defined but not used [-Wunused-function]
trio_is_special_quantity
^~~~~~~~~~~~~~~~~~~~~~~~
CC xpointer.lo
CC xinclude.lo
CC nanohttp.lo
CC nanoftp.lo
CC catalog.lo
catalog.c: In function ‘xmlFreeCatalog__internal_alias’:
catalog.c:444:3: warning: cast between incompatible function types from ‘void (*)(xmlCatalogEntry *)’ {aka ‘void (*)(struct _xmlCatalogEntry *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashDeallocator) xmlFreeCatalogEntry);
^
catalog.c: In function ‘xmlCatalogConvertEntry’:
catalog.c:760:18: warning: cast between incompatible function types from ‘void (*)(xmlCatalogEntry *)’ {aka ‘void (*)(struct _xmlCatalogEntry *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashDeallocator) xmlFreeCatalogEntry);
^
catalog.c: In function ‘xmlConvertSGMLCatalog__internal_alias’:
catalog.c:801:3: warning: cast between incompatible function types from ‘void (*)(xmlCatalogEntry *, xmlCatalog *)’ {aka ‘void (*)(struct _xmlCatalogEntry *, struct _xmlCatalog *)’} to ‘void (*)(void *, void *, xmlChar *)’ {aka ‘void (*)(void *, void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashScanner) xmlCatalogConvertEntry,
^
catalog.c: In function ‘xmlACatalogDump__internal_alias’:
catalog.c:2941:7: warning: cast between incompatible function types from ‘void (*)(xmlCatalogEntry *, FILE *)’ {aka ‘void (*)(struct _xmlCatalogEntry *, struct _IO_FILE *)’} to ‘void (*)(void *, void *, xmlChar *)’ {aka ‘void (*)(void *, void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashScanner) xmlCatalogDumpEntry, out);
^
catalog.c: In function ‘xmlACatalogRemove__internal_alias’:
catalog.c:3006:3: warning: cast between incompatible function types from ‘void (*)(xmlCatalogEntry *)’ {aka ‘void (*)(struct _xmlCatalogEntry *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashDeallocator) xmlFreeCatalogEntry);
^
catalog.c: In function ‘xmlCatalogCleanup__internal_alias’:
catalog.c:3288:7: warning: cast between incompatible function types from ‘void (*)(xmlCatalogEntry *)’ {aka ‘void (*)(struct _xmlCatalogEntry *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashDeallocator)xmlFreeCatalogHashEntryList);
^
CC globals.lo
CC threads.lo
CC c14n.lo
CC xmlstring.lo
CC buf.lo
CC xmlregexp.lo
CC xmlschemas.lo
xmlschemas.c: In function ‘xmlSchemaFree__internal_alias’:
xmlschemas.c:4163:7: warning: cast between incompatible function types from ‘void (*)(xmlSchemaBucket *)’ {aka ‘void (*)(struct _xmlSchemaBucket *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashDeallocator) xmlSchemaBucketFree);
^
xmlschemas.c: In function ‘xmlSchemaDump__internal_alias’:
xmlschemas.c:4546:35: warning: cast between incompatible function types from ‘void (*)(xmlSchemaType *, FILE *)’ {aka ‘void (*)(struct _xmlSchemaType *, struct _IO_FILE *)’} to ‘void (*)(void *, void *, xmlChar *)’ {aka ‘void (*)(void *, void *, unsigned char *)’} [-Wcast-function-type]
xmlHashScan(schema->typeDecl, (xmlHashScanner) xmlSchemaTypeDump,
^
xmlschemas.c: In function ‘xmlSchemaConstructionCtxtFree’:
xmlschemas.c:9922:6: warning: cast between incompatible function types from ‘void (*)(xmlSchemaSubstGroup *)’ {aka ‘void (*)(struct _xmlSchemaSubstGroup *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashDeallocator) xmlSchemaSubstGroupFree);
^
xmlschemas.c: In function ‘xmlSchemaFixupComponents’:
xmlschemas.c:21297:6: warning: cast between incompatible function types from ‘void (*)(xmlSchemaSubstGroup *)’ {aka ‘void (*)(struct _xmlSchemaSubstGroup *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashDeallocator) xmlSchemaSubstGroupFree);
^
xmlschemas.c: In function ‘xmlSchemaAugmentImportedIDC’:
xmlschemas.c:22044:6: warning: cast between incompatible function types from ‘void (*)(xmlSchemaIDC *, xmlSchemaValidCtxt *)’ {aka ‘void (*)(struct _xmlSchemaIDC *, struct _xmlSchemaValidCtxt *)’} to ‘void (*)(void *, void *, xmlChar *)’ {aka ‘void (*)(void *, void *, unsigned char *)’} [-Wcast-function-type]
(xmlHashScanner) xmlSchemaAugmentIDC, vctxt);
^
CC xmlschemastypes.lo
xmlschemastypes.c: In function ‘xmlSchemaCleanupTypes__internal_alias’:
xmlschemastypes.c:649:37: warning: cast between incompatible function types from ‘void (*)(xmlSchemaType *)’ {aka ‘void (*)(struct _xmlSchemaType *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
xmlHashFree(xmlSchemaTypesBank, (xmlHashDeallocator) xmlSchemaFreeType);
^
CC xmlunicode.lo
CC xmlreader.lo
xmlreader.c: In function ‘xmlTextReaderFreeIDTable’:
xmlreader.c:502:24: warning: cast between incompatible function types from ‘void (*)(xmlID *)’ {aka ‘void (*)(struct _xmlID *)’} to ‘void (*)(void *, xmlChar *)’ {aka ‘void (*)(void *, unsigned char *)’} [-Wcast-function-type]
xmlHashFree(table, (xmlHashDeallocator) xmlFreeID);
^
CC relaxng.lo
CC dict.lo
CC SAX2.lo
CC xmlwriter.lo
CC legacy.lo
CC chvalid.lo
CC pattern.lo
CC xmlsave.lo
CC xmlmodule.lo
CC schematron.lo
CC xzlib.lo
CCLD libxml2.la
ar: `u' modifier ignored since `D' is the default (see `U')
CC testdso.lo
CCLD testdso.la
ar: `u' modifier ignored since `D' is the default (see `U')
CC xmllint.o
xmllint.c: In function ‘testSAX’:
xmllint.c:1655:3: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
(xmlSchemaValidityErrorFunc) fprintf,
^
xmllint.c:1656:3: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
(xmlSchemaValidityWarningFunc) fprintf,
^
xmllint.c: In function ‘parseAndPrintFile’:
xmllint.c:2307:6: warning: cast between incompatible function types from ‘void (*)(FILE *)’ {aka ‘void (*)(struct _IO_FILE *)’} to ‘int (*)(void *)’ [-Wcast-function-type]
(xmlInputCloseCallback) myClose, f,
^
xmllint.c:2312:6: warning: cast between incompatible function types from ‘void (*)(FILE *)’ {aka ‘void (*)(struct _IO_FILE *)’} to ‘int (*)(void *)’ [-Wcast-function-type]
(xmlInputCloseCallback) myClose, f,
^
xmllint.c:2765:22: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
cvp->error = (xmlValidityErrorFunc) fprintf;
^
xmllint.c:2766:22: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
cvp->warning = (xmlValidityWarningFunc) fprintf;
^
xmllint.c:2801:18: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
cvp->error = (xmlValidityErrorFunc) fprintf;
^
xmllint.c:2802:18: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
cvp->warning = (xmlValidityWarningFunc) fprintf;
^
xmllint.c:2865:3: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
(xmlRelaxNGValidityErrorFunc) fprintf,
^
xmllint.c:2866:3: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
(xmlRelaxNGValidityWarningFunc) fprintf,
^
xmllint.c:2893:3: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
(xmlSchemaValidityErrorFunc) fprintf,
^
xmllint.c:2894:3: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
(xmlSchemaValidityWarningFunc) fprintf,
^
xmllint.c: In function ‘main’:
xmllint.c:3590:3: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
(xmlRelaxNGValidityErrorFunc) fprintf,
^
xmllint.c:3591:3: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
(xmlRelaxNGValidityWarningFunc) fprintf,
^
xmllint.c:3616:3: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
(xmlSchemaValidityErrorFunc) fprintf,
^
xmllint.c:3617:3: warning: cast between incompatible function types from ‘int (*)(FILE * restrict, const char * restrict, ...)’ {aka ‘int (*)(struct _IO_FILE * restrict, const char * restrict, ...)’} to ‘void (*)(void *, const char *, ...)’ [-Wcast-function-type]
(xmlSchemaValidityWarningFunc) fprintf,
^
CCLD xmllint
CC xmlcatalog.o
CCLD xmlcatalog
sed -e 's?\@XML_LIBDIR\@?-L/usr/local/lib?g' \
-e 's?\@XML_INCLUDEDIR\@?-I/usr/local/include/libxml2?g' \
-e 's?\@VERSION\@?2.9.7?g' \
-e 's?\@XML_LIBS\@?-lxml2 -lz -lm ?g' \
< ./xml2Conf.sh.in > xml2Conf.tmp \
&& mv xml2Conf.tmp xml2Conf.sh
make[2]: Leaving directory '/home/pi/xml/libxml2-2.9.7'
Making all in doc
make[2]: Entering directory '/home/pi/xml/libxml2-2.9.7/doc'
Making all in .
make[3]: Entering directory '/home/pi/xml/libxml2-2.9.7/doc'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/pi/xml/libxml2-2.9.7/doc'
Making all in devhelp
make[3]: Entering directory '/home/pi/xml/libxml2-2.9.7/doc/devhelp'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/pi/xml/libxml2-2.9.7/doc/devhelp'
Making all in examples
make[3]: Entering directory '/home/pi/xml/libxml2-2.9.7/doc/examples'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/pi/xml/libxml2-2.9.7/doc/examples'
make[2]: Leaving directory '/home/pi/xml/libxml2-2.9.7/doc'
Making all in example
make[2]: Entering directory '/home/pi/xml/libxml2-2.9.7/example'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/pi/xml/libxml2-2.9.7/example'
Making all in xstc
make[2]: Entering directory '/home/pi/xml/libxml2-2.9.7/xstc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/pi/xml/libxml2-2.9.7/xstc'
Making all in python
make[2]: Entering directory '/home/pi/xml/libxml2-2.9.7/python'
make all-recursive
make[3]: Entering directory '/home/pi/xml/libxml2-2.9.7/python'
Making all in .
make[4]: Entering directory '/home/pi/xml/libxml2-2.9.7/python'
CC libxml.lo
libxml.c:14:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
make[4]: *** [Makefile:623: libxml.lo] Error 1
make[4]: Leaving directory '/home/pi/xml/libxml2-2.9.7/python'
make[3]: *** [Makefile:684: all-recursive] Error 1
make[3]: Leaving directory '/home/pi/xml/libxml2-2.9.7/python'
make[2]: *** [Makefile:524: all] Error 2
make[2]: Leaving directory '/home/pi/xml/libxml2-2.9.7/python'
make[1]: *** [Makefile:1441: all-recursive] Error 1
make[1]: Leaving directory '/home/pi/xml/libxml2-2.9.7'
make: *** [Makefile:860: all] Error 2
Mais j'obtiens une erreur :
libxml.c:14:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
Il ne trouve pas de fichier ou de répertoire mais lequel ?
Par curiosité j'ai testé l'installation de libxml2 par apt et il est présent.
$ sudo apt install libxml2
Reading package lists... Done
Building dependency tree
Reading state information... Done
libxml2 is already the newest version (2.9.4+dfsg1-7+deb10u1).
0 upgraded, 0 newly installed, 0 to remove and 36 not upgraded.
AI je pris une mauvaise version?
Hors ligne
#7 Le 10/02/2021, à 17:52
- MicP
Re : [SED] Parser de manière recursive
…
Et pourtant avec le sed, cela fonctionne.wget -q http://radiofrance-podcast.net/podcast09/rss_14934.xml -O - | tr '\r' '\n' | tr \' \" | sed -n 's/.*url *= *"\([^"]*\)".*/\1/p'
…
Ça ne retourne qu'un dixième des 100 liens contenus dans la feuille xml
=======
Sur mon système Xubuntu, xmllint est installé par défaut,
donc, il suffit d'entrer la ligne de commande que j'ai proposée dans mon précédent message.
=======
Pour xmlstarlet , qui est AMHA la meilleure solution,
il suffit de l'installer en utilisant la ligne de commande suivante :
sudo apt install xmlstarlet
et de lancer la ligne de commandes suivante
utilisant celle proposée par watael :
michel@xubuT450:~$ wget -qO- https://www.rtl.fr/podcast/le-journal-rtl.xml | xmlstarlet sel -t -v '/rss/channel/item/enclosure/@url' -n
https://rtl.proxycast.org/1806556815471681536/f8a9ef93-1a97-4966-a87e-ea63b65ae7be.mp3?u=eGEnDuWqIq&_=1612973573
https://rtl.proxycast.org/1806538802227847168/de434ded-097f-4f18-88ff-9ac7bfd577aa.mp3?u=eGEnDuWqIq&_=1612969937
https://rtl.proxycast.org/1806522006049398784/ea2b9ee7-0217-43dc-8a3f-188ae668f61e.mp3?u=eGEnDuWqIq&_=1612962722
https://rtl.proxycast.org/1806492371311927296/3c354f7a-eb10-4f8b-93ef-4db68773c1e4.mp3?u=eGEnDuWqIq&_=1612959129
https://rtl.proxycast.org/1806476911770083328/94dc5516-1cf6-4991-bf58-f7530fea0658.mp3?u=eGEnDuWqIq&_=1612955539
https://rtl.proxycast.org/1806461450038812672/599cb054-097f-4d3f-9ece-a49463902701.mp3?u=eGEnDuWqIq&_=1612951937
https://rtl.proxycast.org/1806460171711422464/9b3724ac-0630-49fb-8cdf-23432fc4623b.mp3?u=eGEnDuWqIq&_=1612948350
https://rtl.proxycast.org/1806433107918725120/04e654df-4140-4806-8d8d-c2e7aad0f888.mp3?u=eGEnDuWqIq&_=1612944733
https://rtl.proxycast.org/1806425370556112896/c71416a1-6db1-4373-8577-a4a21de6f838.mp3?u=eGEnDuWqIq&_=1612941131
https://rtl.proxycast.org/1806417647684820992/c12e142f-1ee0-4911-95d5-218fcd126450.mp3?u=eGEnDuWqIq&_=1612941130
https://rtl.proxycast.org/1806409911362396160/07fee61a-284d-406c-9bad-17f0330668a7.mp3?u=eGEnDuWqIq&_=1612937510
https://rtl.proxycast.org/1806402182342254592/06cdde78-8604-4355-a5cb-1bee28d56022.mp3?u=eGEnDuWqIq&_=1612937509
https://rtl.proxycast.org/1806394451862495232/a554b2e9-277a-4554-beea-ff0b466fcb4a.mp3?u=eGEnDuWqIq&_=1612933906
https://rtl.proxycast.org/1806386716362153984/1d763a43-59d4-46f3-b32d-51cc824cee43.mp3?u=eGEnDuWqIq&_=1612933905
https://rtl.proxycast.org/1806377698197512192/8d28224c-5a6a-4b00-81fc-8931d8e1e916.mp3?u=eGEnDuWqIq&_=1612930302
https://rtl.proxycast.org/1806292656540622848/534c9637-4825-4716-a24a-29213d3a5a57.mp3?u=eGEnDuWqIq&_=1612912309
https://rtl.proxycast.org/1806275935125643264/b4f79628-2245-4a90-a155-5791ba572b84.mp3?u=eGEnDuWqIq&_=1612908785
https://rtl.proxycast.org/1806260468461871104/af44ec9f-ed9d-4b29-a3fa-89f881d07994.mp3?u=eGEnDuWqIq&_=1612905099
https://rtl.proxycast.org/1806244981552193536/81b9a355-bea5-4a31-aecd-2244fcd589ae.mp3?u=eGEnDuWqIq&_=1612901528
https://rtl.proxycast.org/1806226953552797696/2fdaddd8-eaf7-400f-a5e0-0b70bcb3d58f.mp3?u=eGEnDuWqIq&_=1612894314
https://rtl.proxycast.org/1805819737012183040/1a61da05-cd18-42f3-bacb-39be90c7ca14.mp3?u=eGEnDuWqIq&_=1612800843
https://rtl.proxycast.org/1806217929528713216/c8bf5a27-7426-4ca4-917d-9d2010e415d0.mp3?u=eGEnDuWqIq&_=1612894313
https://rtl.proxycast.org/1806183135738601472/55481273-21f4-498f-9fbc-6a95b6eedf36.mp3?u=eGEnDuWqIq&_=1612887323
https://rtl.proxycast.org/1806167672342192128/590025dd-e9e5-4e1f-9dec-640a4c38001e.mp3?u=eGEnDuWqIq&_=1612883502
https://rtl.proxycast.org/1806150923425161216/59640174-beaf-45be-808b-3b41a9f18fd5.mp3?u=eGEnDuWqIq&_=1612876298
https://rtl.proxycast.org/1806121286657646592/2f5c5bc6-4863-472c-a314-86f0833b4f62.mp3?u=eGEnDuWqIq&_=1612872700
https://rtl.proxycast.org/1806104535979008000/184888c5-5385-4cfc-919c-7fbb0b740521.mp3?u=eGEnDuWqIq&_=1612865525
https://rtl.proxycast.org/1806089074398732288/887f347c-2daa-4f98-b914-c423e6d1580c.mp3?u=eGEnDuWqIq&_=1612861920
https://rtl.proxycast.org/1806062019766394880/64f124e9-2ab2-4d6f-ae0a-43845915f528.mp3?u=eGEnDuWqIq&_=1612858314
https://rtl.proxycast.org/1806052997273231360/5d84adba-f3ea-48d1-8117-a0cb1658425f.mp3?u=eGEnDuWqIq&_=1612854711
https://rtl.proxycast.org/1806046617040592896/7f6de318-7cc9-4e49-9142-aedcfd49ba21.mp3?u=eGEnDuWqIq&_=1612854710
https://rtl.proxycast.org/1806038824405442560/47ee4129-d085-42cd-af74-c66eabf36008.mp3?u=eGEnDuWqIq&_=1612851134
https://rtl.proxycast.org/1806031092625448960/1505296a-ffde-46e4-b9d5-86acdf954642.mp3?u=eGEnDuWqIq&_=1612851135
https://rtl.proxycast.org/1806023363911491584/ef9ab440-d05e-4c80-8668-ca1a932e5521.mp3?u=eGEnDuWqIq&_=1612847526
https://rtl.proxycast.org/1806014343377068032/5f269c57-8823-458c-b29e-16f5d6640622.mp3?u=eGEnDuWqIq&_=1612847525
https://rtl.proxycast.org/1806007899273568256/1d8d89b0-41dc-4461-ae6d-489e486f149a.mp3?u=eGEnDuWqIq&_=1612843910
https://rtl.proxycast.org/1805920283400347648/960d48e3-f252-44d8-9683-7372ef0857b8.mp3?u=eGEnDuWqIq&_=1612826290
https://rtl.proxycast.org/1805904845203316736/b5ce524f-89f4-4b84-be3d-7711874c9510.mp3?u=eGEnDuWqIq&_=1612822347
https://rtl.proxycast.org/1805889381915959296/4d596bc0-22c9-4a63-b414-256a6d896df1.mp3?u=eGEnDuWqIq&_=1612818769
https://rtl.proxycast.org/1805873895127916544/e7bbcd9c-19aa-46f1-9c96-33a513a49b2d.mp3?u=eGEnDuWqIq&_=1612811590
https://rtl.proxycast.org/1805846843490312192/c7333def-41ba-46da-b2d5-a0afcfe3d257.mp3?u=eGEnDuWqIq&_=1612811585
https://rtl.proxycast.org/1805812051419865088/875f4eb4-02eb-45a7-94c9-e9c8773a3680.mp3?u=eGEnDuWqIq&_=1612800840
https://rtl.proxycast.org/1805796587650162688/5cf10013-a64b-4b0d-b69a-97fd9da5cbef.mp3?u=eGEnDuWqIq&_=1612800842
https://rtl.proxycast.org/1805779836287852544/fa746872-e68d-438f-a4ef-419ffee8e710.mp3?u=eGEnDuWqIq&_=1612789971
https://rtl.proxycast.org/1805750201965617152/8764a7c0-193b-456e-924c-76aed35e3755.mp3?u=eGEnDuWqIq&_=1612783022
https://rtl.proxycast.org/1805734781812482048/4b005d5c-0a8a-4369-93c2-3a2c084e15ad.mp3?u=eGEnDuWqIq&_=1612783019
https://rtl.proxycast.org/1805734797465624576/f63233cd-76dd-4790-b2ef-ed6dbf4294e1.mp3?u=eGEnDuWqIq&_=1612783020
https://rtl.proxycast.org/1805717987789905920/19407aa5-6354-499a-bb31-53b53494b7b2.mp3?u=eGEnDuWqIq&_=1612775554
https://rtl.proxycast.org/1805690936676589568/4d5a82d5-4880-4650-b2ce-88b67e06810c.mp3?u=eGEnDuWqIq&_=1612771948
https://rtl.proxycast.org/1805683201100750848/eb3e5eb7-8b34-4b4b-adca-a5f4fb6927d2.mp3?u=eGEnDuWqIq&_=1612768347
https://rtl.proxycast.org/1805675479168983040/81f9c345-6d4a-4d66-95a7-79a57530faed.mp3?u=eGEnDuWqIq&_=1612768346
https://rtl.proxycast.org/1805666450396946432/2741fdab-4cd7-4e3b-952d-e54f876f4589.mp3?u=eGEnDuWqIq&_=1612764726
https://rtl.proxycast.org/1805660007753064448/29c133cc-cfe2-4e5b-a542-166143fb5a69.mp3?u=eGEnDuWqIq&_=1612764725
https://rtl.proxycast.org/1805650989772972032/ee79270d-60b2-4afd-8541-ae13a640b896.mp3?u=eGEnDuWqIq&_=1612761113
https://rtl.proxycast.org/1805643259008000000/5497b382-a57c-4db3-a3ab-2204cbea25fd.mp3?u=eGEnDuWqIq&_=1612761112
https://rtl.proxycast.org/1805635523935477760/60940eb5-67d3-4434-857f-09880ef8ee9b.mp3?u=eGEnDuWqIq&_=1612757502
https://rtl.proxycast.org/1805488637484212224/63f84d3f-6ce0-420d-9435-d533273d62ef.mp3?u=eGEnDuWqIq&_=1612725144
https://rtl.proxycast.org/1805477049964437504/50e28569-e012-44c2-a2ed-ce9bc1b1dda3.mp3?u=eGEnDuWqIq&_=1612721523
https://rtl.proxycast.org/1805459002700603392/98c3915d-a6fd-4fb3-99af-c13acd74ef49.mp3?u=eGEnDuWqIq&_=1612717927
https://rtl.proxycast.org/1805440965029142528/6219d724-5784-41b3-9c7d-da27f471e288.mp3?u=eGEnDuWqIq&_=1612714335
https://rtl.proxycast.org/1805424218171514880/82bffa34-a810-48b8-a019-de6aafc30a24.mp3?u=eGEnDuWqIq&_=1612707148
https://rtl.proxycast.org/1805385558298468352/2d9fb01a-acfd-44ac-b22b-ec357a24c411.mp3?u=eGEnDuWqIq&_=1612699939
https://rtl.proxycast.org/1805362367307980800/02d75cad-2842-4336-94ca-74ffedbd09aa.mp3?u=eGEnDuWqIq&_=1612692730
https://rtl.proxycast.org/1805350774302056448/ed351573-0c59-4822-b0fb-03010ab6aeed.mp3?u=eGEnDuWqIq&_=1612692729
https://rtl.proxycast.org/1805335311740313600/e8c973f5-fe51-47e5-8197-2e8ffdf89ad5.mp3?u=eGEnDuWqIq&_=1612689135
https://rtl.proxycast.org/1805327578588782592/fb515c44-b091-4d65-a629-d05e3e5c3cc3.mp3?u=eGEnDuWqIq&_=1612685498
https://rtl.proxycast.org/1805319848880775168/ae5d8977-7959-44a3-b849-03fa2edf9cfe.mp3?u=eGEnDuWqIq&_=1612685497
https://rtl.proxycast.org/1805310826689601536/4b8bca0f-532c-4ec8-b1f9-fb17b9d344ed.mp3?u=eGEnDuWqIq&_=1612681894
https://rtl.proxycast.org/1805304387162087424/7e62b9db-ec69-47d7-a515-8b6376974bfb.mp3?u=eGEnDuWqIq&_=1612681893
https://rtl.proxycast.org/1805294076182929408/b7f2d979-7eb4-4981-b27a-57db7f23a1b3.mp3?u=eGEnDuWqIq&_=1612678300
https://rtl.proxycast.org/1805286350245601280/c016eb1b-9c73-44d0-8a24-46482f30502c.mp3?u=eGEnDuWqIq&_=1612678299
https://rtl.proxycast.org/1805273463443693568/e5636e63-864e-41f8-892d-3a22a4a8756f.mp3?u=eGEnDuWqIq&_=1612674696
https://rtl.proxycast.org/1805117551458394112/5ba275ab-eb23-480f-b7c2-889d37337be8.mp3?u=eGEnDuWqIq&_=1612638699
https://rtl.proxycast.org/1805116264633344000/48d7906a-f972-419c-a58f-c54197e472ad.mp3?u=eGEnDuWqIq&_=1612638698
https://rtl.proxycast.org/1805105970959884288/bc107fe6-0015-4309-89f4-02f2a1f2c3d0.mp3?u=eGEnDuWqIq&_=1612635103
https://rtl.proxycast.org/1805071168932159488/af3b580c-2cf5-49a0-b26f-88525f5bc3dd.mp3?u=eGEnDuWqIq&_=1612627901
https://rtl.proxycast.org/1805053130354728960/58f5bd50-e5c0-45b3-a36c-c31fffc57865.mp3?u=eGEnDuWqIq&_=1612620726
https://rtl.proxycast.org/1805037673195249664/1dad2674-bc4b-4989-aa80-c0247bcf2c05.mp3?u=eGEnDuWqIq&_=1612617111
https://rtl.proxycast.org/1805006743214759936/9e5f0653-d843-4686-945f-8e50ab443e88.mp3?u=eGEnDuWqIq&_=1612609925
https://rtl.proxycast.org/1804991281588346880/3c8d99e4-c699-48ec-9f80-79d330dfac3a.mp3?u=eGEnDuWqIq&_=1612606335
https://rtl.proxycast.org/1804979688720834560/cff6a7a1-3b29-4d52-beab-f1415a9e13da.mp3?u=eGEnDuWqIq&_=1612606334
https://rtl.proxycast.org/1804964250410557440/b2f03aed-bebd-434a-bded-213fa51f44ee.mp3?u=eGEnDuWqIq&_=1612602742
https://rtl.proxycast.org/1804964226259755008/4129f95a-9be3-48e7-8746-e3f39a7b5d12.mp3?u=eGEnDuWqIq&_=1612602741
https://rtl.proxycast.org/1804956565472550912/c2ff047a-96f1-443c-98da-825dbdff0c17.mp3?u=eGEnDuWqIq&_=1612599137
https://rtl.proxycast.org/1804950054801252352/2b5f22d0-5fbf-4355-bad7-ba79be18e84d.mp3?u=eGEnDuWqIq&_=1612599136
https://rtl.proxycast.org/1804939741213237248/ef6e52cc-dd2f-40f0-bace-a35bea504367.mp3?u=eGEnDuWqIq&_=1612595514
https://rtl.proxycast.org/1804933301576671232/2ac0f17f-3b63-4427-b5ed-013b547bb575.mp3?u=eGEnDuWqIq&_=1612595512
https://rtl.proxycast.org/1804924280048197632/8fde92d2-8560-476e-9942-43a8448f20ae.mp3?u=eGEnDuWqIq&_=1612591907
https://rtl.proxycast.org/1804916548813463552/b7a29204-fbe3-4298-989f-eee2d58e94af.mp3?u=eGEnDuWqIq&_=1612591906
https://rtl.proxycast.org/1804902379502444544/d497534e-11f9-43c1-9465-e2aa73e0f230.mp3?u=eGEnDuWqIq&_=1612588299
https://rtl.proxycast.org/1804760640334602240/41cc5517-3cac-44a3-8ba7-5561131c9f41.mp3?u=eGEnDuWqIq&_=1612555915
https://rtl.proxycast.org/1804737456377962496/f207cd32-68f2-45b9-90d8-04a3c4e43c39.mp3?u=eGEnDuWqIq&_=1612548751
https://rtl.proxycast.org/1804698792532910080/621182a7-0ce6-41c3-b89f-4a1a3d0c9782.mp3?u=eGEnDuWqIq&_=1612541525
https://rtl.proxycast.org/1804682043498438656/ce22bae4-d557-42c4-a4dd-87f626ab82d8.mp3?u=eGEnDuWqIq&_=1612534338
https://rtl.proxycast.org/1804666580584374272/0350bed6-dc5d-4171-8dd0-dc5ea4cf7cee.mp3?u=eGEnDuWqIq&_=1612530726
https://rtl.proxycast.org/1804636945976926208/cd9c41c9-5421-4f9a-a58b-10442e97cae8.mp3?u=eGEnDuWqIq&_=1612527127
https://rtl.proxycast.org/1804621492600709120/41d00534-32fe-475d-82a9-a42c7975abb5.mp3?u=eGEnDuWqIq&_=1612523551
https://rtl.proxycast.org/1804618904538980352/ad53bb83-8c00-48ea-b784-89d3cfb53504.mp3?u=eGEnDuWqIq&_=1612519934
https://rtl.proxycast.org/1804606021998485504/173af4d5-4e04-4ac3-be5a-44f96df49a87.mp3?u=eGEnDuWqIq&_=1612519933
https://rtl.proxycast.org/1804577680633372672/0550ecb5-b00b-4d3c-b341-95576c2e43c7.mp3?u=eGEnDuWqIq&_=1612512732
michel@xubuT450:~$
Dernière modification par MicP (Le 10/02/2021, à 17:59)
Hors ligne
#8 Le 10/02/2021, à 17:56
- alex2423
Re : [SED] Parser de manière recursive
xmlstarlet sel -t -v '/rss/channel/item/enclosure/@url' -n fichier.xml
[spoiler]je n'ai pas trouvé ça tout seul[/spoiler]
Excellent cet outil xmlstarlet est installable cette fois-ci via apt.
Je viens tester pour Radio France également et cela fonctionne nickel
wget -qO- http://radiofrance-podcast.net/podcast09/rss_14934.xml | xmlstarlet sel -t -v '/rss/channel/item/enclosure/@url' -n
Je viens de découvrir cet outil. xmlstarlet sel --help permet d'avoir des précisions sur les options.
sel => pour une sélection
-t => pour template
-v => pour afficher la valeur du XPath
-n => pour afficher une nouvelle ligne
Un grand merci à vous 2. Et dire que je pensais que sed plus universel. Tu avais bien raison Watael !!!
Je ne pensais pas que l'on pouvait parser propremet du XML en bash. Je pensais que l'on était obligé de passer par un language plus haut niveau comme Python.
EDIT : je ne suis pas très rapide pour répondre. Watael,on a posté presque en même temps.
Dernière modification par alex2423 (Le 10/02/2021, à 17:59)
Hors ligne
#9 Le 10/02/2021, à 17:58
- Watael
Re : [SED] Parser de manière recursive
en l'occurrence, bash ne fait rien. ou pas grand chose : il se contente de faire exécuter la commande xml[...].
Connected \o/
Welcome to sHell. · eval is evil.
Hors ligne