Metadaten aus Icecast-Audio-Stream abrufen

1897
LaPriWa

Ich möchte Metadaten von dieser Station erhalten:

http://ice1.somafm.com/deepspaceone-128-mp3 

Um dies zu erreichen, habe ich folgende Anfrage per Shell gemacht:

$ GET -H "Icy-MetaData: 1" http://ice1.somafm.com/deepspaceone-128-mp3 

Obwohl ich erwartet hatte, den Icy-metaintWert zu erhalten, gibt er keine Ausgabe aus.

Ich habe auch folgende Anfrage gestellt:

$ HEAD http://ice1.somafm.com/deepspaceone-128-mp3 

Dies ergibt:

200 OK Cache-Control: no-cache, no-store Connection: Close Date: Sun, 24 Apr 2016 07:23:14 GMT Pragma: no-cache Server: Icecast 2.4.0-kh3 Content-Type: audio/mpeg Expires: Mon, 26 Jul 1997 05:00:00 GMT Access-Control-Allow-Headers: Origin, Accept, X-Requested-With, Content-Type Access-Control-Allow-Methods: GET, OPTIONS, HEAD Access-Control-Allow-Origin: * Client-Date: Sun, 24 Apr 2016 07:21:38 GMT Client-Peer: 173.239.76.148:80 Client-Response-Num: 1 Icy-Br: 128 Icy-Genre: Ambient Space Icy-Name: Deep Space One: Deep ambient electronic and space music. [SomaFM] Icy-Notice1: <BR>This stream requires <a href="http://www.winamp.com/">Winamp</a><BR> Icy-Notice2: SHOUTcast Distributed Network Audio Server/Linux v1.9.5<BR> Icy-Pub: 0 Icy-Url: http://somafm.com 

Was mache ich falsch?

1

1 Antwort auf die Frage

1
TBR

You should verify, that the command you are using really sends that header.

Using cURL it works just fine (see last line of output):

$ curl -H "Icy-MetaData: 1" -v "http://ice1.somafm.com/deepspaceone-128-mp3" >/dev/null % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 173.239.76.148... 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to ice1.somafm.com (173.239.76.148) port 80 (#0) > GET /deepspaceone-128-mp3 HTTP/1.1 > Host: ice1.somafm.com > User-Agent: curl/7.45.0 > Accept: */* > Icy-MetaData: 1 > * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Content-Type: audio/mpeg < Date: Mon, 25 Apr 2016 04:16:47 GMT < icy-br:128 < icy-genre:Ambient Space < icy-name:Deep Space One: Deep ambient electronic and space music. [SomaFM] < icy-notice1:<BR>This stream requires <a href="http://www.winamp.com/">Winamp</a><BR> < icy-notice2:SHOUTcast Distributed Network Audio Server/Linux v1.9.5<BR> < icy-pub:0 < icy-url:http://somafm.com < Server: Icecast 2.4.0-kh3 < Cache-Control: no-cache, no-store < Pragma: no-cache < Access-Control-Allow-Origin: * < Access-Control-Allow-Headers: Origin, Accept, X-Requested-With, Content-Type < Access-Control-Allow-Methods: GET, OPTIONS, HEAD < Connection: Close < Expires: Mon, 26 Jul 1997 05:00:00 GMT < icy-metaint:45000 < 
Vielen Dank! : -DI hat eine letzte Frage: Warum muss ich die Ausgabe nach / dev / null umleiten? LaPriWa vor 8 Jahren 0
Das war nur, um die Ausgabe auf die Header zu beschränken, indem der Body auf / dev / null umgeleitet wurde. Für Ihren Anwendungsfall möchten Sie wahrscheinlich den Datenstrom verdauen und das Signal "metaint" analysieren. TBR vor 8 Jahren 1
Ich persönlich würde wahrscheinlich ihre Website-Oberfläche betrachten, da sie dort auch Metadaten anzeigt. Könnte einfacher sein, als es aus einem Bach zu schnitzen. TBR vor 8 Jahren 1
Die Website-Benutzeroberfläche kann sich jederzeit ändern, was möglicherweise dazu führt, dass Programme davon abhängen. Die Shoutcast-Spezifikation ändert sich nicht so schnell und wäre die sicherere Methode. Die Verwendung der Metadaten ist auch auf andere Shoutcast- / Icecast-Server portierbar und nicht nur für SoMaFM (eine großartige Sammlung von Internet-Radiosendern). Hydranix vor 7 Jahren 1