<?sphp $this->text('pagetitle') ?>
 
Home of the Squeezebox™ & Transporter® network music players.

OPML support

From SqueezeboxWiki

Revision as of 13:24, 25 June 2010 by Soulkeeper (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

SqueezeCenter/SqueezeNetwork OPML Support

Through the use of simple XML files, it is possible to browse a hierarchical listing of items such as radio streams, RSS feeds, or podcasts.

Because OPML is a loosely defined format, this page documents how these files may be used with SqueezeCenter, as well as the custom attributes it supports.

<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.1">
  <head>
    <title>Slim Devices Picks</title>
  </head>
  <body>
    <outline text="Best of Internet Radio">
      <outline text="Classical | WGBH Classical - Boston, MA" URL="http://streams.wgbh.org/classical.pls" type="audio" />
      <outline text="AccuRadio - New!" URL="http://www1.accuradio.com/shoutcast/accuradio.opml" />
    </outline>
  </body>
</opml>

This OPML file allows the user to navigate into Slim Devices Picks, select Best of Internet Radio, and then view 2 items. The first item is an audio stream and can be played by pressing PLAY. The second item is a reference to an external OPML file. When the user presses RIGHT on the AccuRadio item, the remote file is loaded and inserted into the existing structure.

<title> Element

The title element in the head section defines the title that is displayed when browsing the first level of the OPML file. This value should always be specified.

<outline> Element

Outline elements represent the structure of the file. These may be nested to any level. The following attributes are supported.

  • text

Required. /text/ specifies the title of the item.

  • URL

Required. /URL/ is the location of the item. Depending on the value of the /type/ attribute, this can be either a single audio stream or audio playlist, a remote OPML file containing a playlist of audio items, or a remote OPML file to browse.

  • type

Optional. /type/ describes how the /URL/ should be interpreted by SlimServer. A type of /audio/ means SlimServer should attempt to play the URL as an audio stream. /audio/ should also be used for remote playlist files such as m3u, pls, or asx. A type of /playlist/ means SlimServer should load the given OPML file and play all items found. This attribute should not be included if the URL is a remote OPML file that should be browsed normally.

  • bitrate

Optional. /bitrate/ may be used to specify the bitrate of an audio stream, in kbps.

Optional. Enter the MIME type of the stream/file. Any MIME type listed in SlimServer's types.conf file may be used.

Optional. If the item is not a live radio stream, set /duration/ to the playback duration in seconds to ensure the progress bar is displayed correctly. This is especially helpful for VBR files where our bitrate detection may not work properly.

  • listeners

Optional. /listeners/ may be used to display the number of listeners currently listening to an audio stream.

  • current_track

Optional. Use /current_track/ to display the track that was most recently playing on a radio station.

  • genre

Optional. The /genre/ of a stream may be specified with this attribute.

  • source

Optional. The /source/ of the audio. This is currently used by the Live Music Archive plugin to describe how a concert was recorded.

Playlist Example

These two files show how type="playlist" can be used.

<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.1">
  <head>
    <title>Grateful Dead</title>
  </head>
  <body>
    <outline text="1995">
      <outline text="1995-07-09/Chicago, IL" type="playlist" URL="http://server.com/chicago.opml" />
    </outline>
  </body>
</opml>

chicago.opml

<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.1">
  <head>
    <title>Grateful Dead - 1995-07-09-Chicago, IL</title>
  </head>
  <body>
    <outline URL="http://www.archive.org/.../gd1995-07-09d1t01_vbr.mp3" bitrate="200" source="Soundboard" text="Touch Of Grey" type="audio" />
    <outline URL="http://www.archive.org/.../gd1995-07-09d1t02_vbr.mp3" bitrate="203" source="Soundboard" text="Little Red Rooster" type="audio" />
    <outline URL="http://www.archive.org/.../gd1995-07-09d1t03_vbr.mp3" bitrate="194" source="Soundboard" text="Lazy River Road" type="audio" />
  </body>
</opml>

When viewing the entry "1995-07-09/Chicago, IL", pressing PLAY or ADD will load up the 3 audio tracks listed in the playlist OPML file. Pressing RIGHT will navigate into the playlist.

Search support

SqueezeCenter 7.0+/SqueezeNetwork support a new value for /type/, "search". This will cause the player and web interfaces to render a search screen/box when browsing to this item. The URL for this item must contain the text QUERY in braces which will be replaced by the user's search query.

Example:

<outline URL="http://www.sample.com/search?q={QUERY}" type="search" text="Search For Artists" />