Mopidy-Podcast

Mopidy-Podcast is a Mopidy extension for browsing and playing podcasts.

This extension lets you browse podcasts distributed as RSS feeds and play individual episodes in a variety of audio formats. Podcasts are mapped to albums, while podcast episodes are shown as tracks in Mopidy, with metadata converted to Mopidy’s native data model where applicable. OPML 2.0 subscription lists and directories are also supported for multi-level browsing.

To use this extension, you first need a way to access podcasts from Mopidy:

  • If you are already using a podcasting client, chances are that it supports exporting your subscribed feeds as an OPML file. Simply store this file in the location pointed to by podcast/browse_root to access your favorite podcasts from Mopidy.

  • Since OPML is a simple XML format, it is also feasible to create your own, using an XML or text editor of your choice. OPML also supports linking to other OPML files, both locally and on the Web, so this even allows creating your own meta directory pointing to podcast collections from the BBC, gpodder.net, and other sources:

    <?xml version="1.0" encoding="UTF-8"?>
    <opml>
      <body>
        <outline text="TED Radio Hour" type="rss" xmlUrl="http://www.npr.org/rss/podcast.php?id=510298" />
        <outline text="BBC Radio Podcasts" type="include" url="http://www.bbc.co.uk/podcasts.opml" />
        <outline text="gpodder.net - Python" type="include" url="http://gpodder.net/search.opml?q=Python" />
      </body>
    </opml>
    
  • If your client supports entering Mopidy URIs for playback and browsing directly, just prefix the feed URL with podcast+ to make sure it is not treated as an audio stream:

    mpc add "podcast+http://www.npr.org/rss/podcast.php?id=510298"
    
  • Last but not least, you can install Mopidy-Podcast-iTunes, a companion extension to Mopidy-Podcast, to browse and search podcasts on the Apple iTunes Store.

Installation

On Debian Linux and Debian-based distributions like Ubuntu or Raspbian, install the mopidy-podcast package from apt.mopidy.com:

apt-get install mopidy-podcast

Otherwise, install the Python package from PyPI:

pip install Mopidy-Podcast

Configuration

This extension provides a number of configuration values that can be tweaked. However, the default configuration should contain everything to get you up and running, and will usually require only a few modifications, if any, to match personal preferences.

Configuration Values

podcast/enabled

Whether this extension should be enabled or not.

podcast/browse_root

A local path or URL pointing to an OPML syndication feed to use as the root for browsing the Podcasts directory in Mopidy. Relative paths refer to files in the extension’s configuration directory [1].

For example, this will point the Podcasts directory to a collection of all the BBC Radio and Music feeds:

browse_root = http://www.bbc.co.uk/podcasts.opml

The default value is Podcasts.opml, so simply exporting your subscribed feeds from your favorite podcast client under this name and dropping the file in Mopidy-Podcast’s configuration directory is usually all you need to do.

If set to an empty string, the Podcasts directory will be hidden when browsing Mopidy.

podcast/browse_order

Whether to sort podcast episodes by ascending (asc) or descending (desc) publication date for browsing.

podcast/lookup_order

Whether to sort podcast episodes by ascending (asc) or descending (desc) publication date for lookup, for example when adding a podcast to Mopidy’s tracklist.

podcast/cache_size

The maximum number of podcast feeds that will be cached in memory.

podcast/cache_ttl

The cache’s time to live, i.e. the number of seconds after which a cached feed expires and needs to be reloaded.

podcast/timeout

The HTTP request timeout when retrieving podcast feeds, in seconds.

Default Configuration

For reference, this is the default configuration shipped with Mopidy-Podcast release 2.0.1:

[podcast]
enabled = true

# optional path or URL to an OPML file used as the root for browsing;
# relative paths will be resolved according to the extension's
# configuration directory
browse_root = Podcasts.opml

# sort podcast episodes by ascending (asc) or descending (desc)
# publication date for browsing
browse_order = desc

# sort podcast episodes by ascending (asc) or descending (desc)
# publication date for lookup, e.g. when adding a podcast to Mopidy's
# tracklist
lookup_order = asc

# maximum number of podcast feeds to cache in memory
cache_size = 64

# cache time-to-live in seconds
cache_ttl = 86400

# HTTP request timeout in seconds
timeout = 10

Footnotes

[1]When running Mopidy as a regular user, this will usually be ~/.config/mopidy/podcast. When running as a system service, this should be /etc/mopidy/podcast. Note that it may be necessary to create these directories manually when installing the Python package from PyPi, depending on local file permissions.

Change Log

v2.0.1 (2016-08-10)

  • Add OPML example to docs.
  • Remove PyPI downloads badge from README.
  • Correct tests under extreme timezones (thanks to Chris Lamb).

v2.0.0 (2016-03-23)

  • Add support for OPML subscription lists and directories.
  • Add configuration options for browse and lookup order.
  • Change URI scheme for podcast episodes to use GUID as fragment identifier.
  • Drop feeds directory.
  • Drop directory API.
  • Drop search support.
  • Upgrade dependencies to Mopidy v1.1.1.

v1.1.2 (2015-08-27)

  • Pass episodes as list to Podcast.copy().

v1.1.1 (2015-03-25)

  • Prepare for Mopidy v1.0 exact search API.

v1.1.0 (2014-11-22)

  • Improve podcast URI scheme.
  • Report podcasts as albums when browsing.
  • Update dependencies.
  • Update unit tests.

v1.0.0 (2014-05-24)

  • Move RSS parsing to FeedsDirectory.
  • Support for additional podcast/episode properties.
  • Add search_results config value.
  • Add uri_schemes property to PodcastDirectory.
  • Add uri property to Podcast and Episode.
  • Support for <itunes:image>.
  • Convert Podcast.Image and Episode.Enclosure to Mopidy model types.

v0.4.0 (2014-04-11)

  • PodcastDirectory and models API changes.
  • Performance and stability improvements.
  • Configuration cleanup.

v0.3.0 (2014-03-14)

  • Complete rewrite to integrate podcast directory extensions.

v0.2.0 (2014-02-07)

  • Improve handling of iTunes tags.
  • Improve performance by removing feedparser.
  • Support searching for podcasts and episodes.

v0.1.0 (2014-02-01)

  • Initial release.

License

Mopidy-Podcast is Copyright (c) 2014-2016 Thomas Kemmer and contributors.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this software except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.