2021-04-09 13:37:54 -04:00
|
|
|
# OwnTone and Radio Stream tweaking
|
2020-05-17 17:51:02 -04:00
|
|
|
|
|
|
|
Radio streams have many different ways in how metadata is sent. Many should
|
|
|
|
just work as expected, but a few may require some tweaking. If you are not
|
2021-04-09 13:37:54 -04:00
|
|
|
seeing expected title, track, artist, artwork in clients or web UI, the
|
|
|
|
following may help.
|
2020-05-17 17:51:02 -04:00
|
|
|
|
|
|
|
First, understand what and how the particular stream is sending information.
|
|
|
|
ffprobe is a command that can be used to interegrate most of the stream
|
|
|
|
information. `ffprobe <http://stream.url>` should give you some useful output,
|
|
|
|
look at the Metadata section, below is an example.
|
|
|
|
|
|
|
|
```
|
|
|
|
Metadata:
|
|
|
|
icy-br : 320
|
|
|
|
icy-description : DJ-mixed blend of modern and classic rock, electronica, world music, and more. Always 100% commercial-free
|
|
|
|
icy-genre : Eclectic
|
|
|
|
icy-name : Radio Paradise (320k aac)
|
|
|
|
icy-pub : 1
|
|
|
|
icy-url : https://radioparadise.com
|
|
|
|
StreamTitle : Depeche Mode - Strangelove
|
|
|
|
StreamUrl : http://img.radioparadise.com/covers/l/B000002LCI.jpg
|
|
|
|
```
|
|
|
|
|
|
|
|
In the example above, all tags are populated with correct information, no
|
2021-04-09 13:37:54 -04:00
|
|
|
modifications to the server configuration should be needed. Note that
|
2020-05-17 17:51:02 -04:00
|
|
|
StreamUrl points to the artwork image file.
|
|
|
|
|
|
|
|
|
2021-04-09 13:37:54 -04:00
|
|
|
Below is another example that will require some tweaks to the server, Notice
|
2020-05-17 17:51:02 -04:00
|
|
|
`icy-name` is blank and `StreamUrl` doesn't point to an image.
|
|
|
|
|
|
|
|
```
|
|
|
|
Metadata:
|
|
|
|
icy-br : 127
|
|
|
|
icy-pub : 0
|
|
|
|
icy-description : Unspecified description
|
|
|
|
icy-url :
|
|
|
|
icy-genre : various
|
|
|
|
icy-name :
|
|
|
|
StreamTitle : Pour Some Sugar On Me - Def Leppard
|
|
|
|
StreamUrl : https://radio.stream.domain/api9/eventdata/49790578
|
|
|
|
```
|
|
|
|
|
|
|
|
In the above, first fix is the blank name, second is the image artwork.
|
2021-01-21 16:46:19 -05:00
|
|
|
|
|
|
|
### 1) Set stream name/title via the M3U file
|
2020-05-17 17:51:02 -04:00
|
|
|
Set the name with an EXTINF tag in the m3u playlist file:
|
|
|
|
|
|
|
|
```
|
|
|
|
#EXTM3U
|
|
|
|
#EXTINF:-1, - My Radio Stream Name
|
|
|
|
http://radio.stream.domain/stream.url
|
|
|
|
```
|
|
|
|
|
|
|
|
The format is basically `#EXTINF:<length>, <Artist Name> - <Artist Title>`.
|
|
|
|
Length is -1 since it's a stream, `<Artist Name>` was left blank since
|
|
|
|
`StreamTitle` is accurate in the Metadata but `<Artist Title>` was set to
|
|
|
|
`My Radio Stream Name` since `icy-name` was blank.
|
|
|
|
|
2021-01-21 16:46:19 -05:00
|
|
|
### 2) StreamUrl is a JSON file with metadata
|
2020-05-17 17:51:02 -04:00
|
|
|
If `StreamUrl` does not point directly to an artwork file then the link may be
|
2021-04-09 13:37:54 -04:00
|
|
|
to a json file that contains an artwork link. If so, you can make the server
|
2020-05-17 17:51:02 -04:00
|
|
|
download the file automatically and search for an artwork link, and also track
|
|
|
|
duration.
|
|
|
|
|
|
|
|
Try to download the file, e.g. with `curl "https://radio.stream.domain/api9/eventdata/49790578"`.
|
|
|
|
Let's assume you get something like this:
|
|
|
|
|
|
|
|
```
|
|
|
|
{
|
|
|
|
"eventId": 49793707,
|
|
|
|
"eventStart": "2020-05-08 16:23:03",
|
|
|
|
"eventFinish": "2020-05-08 16:27:21",
|
|
|
|
"eventDuration": 254,
|
|
|
|
"eventType": "Song",
|
|
|
|
"eventSongTitle": "Pour Some Sugar On Me",
|
|
|
|
"eventSongArtist": "Def Leppard",
|
|
|
|
"eventImageUrl": "https://radio.stream.domain/artist/1-1/320x320/562.jpg?ver=1465083491",
|
|
|
|
"eventImageUrlSmall": "https://radio.stream.domain/artist/1-1/160x160/562.jpg?ver=1465083491",
|
|
|
|
"eventAppleMusicUrl": "https://geo.itunes.apple.com/dk/album/530707298?i=530707313"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2021-04-09 13:37:54 -04:00
|
|
|
In this case, you would need to tell the server to look for "eventDuration"
|
2020-05-17 17:51:02 -04:00
|
|
|
and "eventImageUrl" (or just "duration" and "url"). You can do that like this:
|
|
|
|
|
|
|
|
```
|
|
|
|
curl -X PUT "http://localhost:3689/api/settings/misc/streamurl_keywords_length" --data "{\"name\":\"streamurl_keywords_length\",\"value\":\"duration\"}"
|
|
|
|
curl -X PUT "http://localhost:3689/api/settings/misc/streamurl_keywords_artwork_url" --data "{\"name\":\"streamurl_keywords_artwork_url\",\"value\":\"url\"}
|
|
|
|
```
|
|
|
|
|
|
|
|
If you want multiple search phrases then comma separate, e.g. "duration,length".
|
|
|
|
|
2021-01-21 16:46:19 -05:00
|
|
|
### 3) Set metadata with a custom script
|
|
|
|
If your radio station publishes metadata via another method than the above, e.g.
|
|
|
|
just on their web site, then you will have to write a script that pulls the
|
2021-04-09 13:37:54 -04:00
|
|
|
metadata and then pushes it to the server. To update metadata for the
|
2021-01-21 16:46:19 -05:00
|
|
|
currently playing radio station use something like this JSON API request:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
curl -X PUT "http://localhost:3689/api/queue/items/now_playing?title=Awesome%20title&artwork_url=http%3A%2F%2Fgyfgafguf.dk%2Fimages%2Fpige3.jpg"
|
|
|
|
```
|
2020-05-17 17:51:02 -04:00
|
|
|
|
|
|
|
If your radio station is not returning any artwork links, you can also just make
|
|
|
|
a static artwork by placing a png/jpg in the same directory as the m3u, and with
|
|
|
|
the same name, e.g. `My Radio Stream.jpg` for `My Radio Stream.m3u`.
|