Mopidy-Podcast-2.0.1/0000775000175000017500000000000012752702040014271 5ustar tkemtkem00000000000000Mopidy-Podcast-2.0.1/mopidy_podcast/0000775000175000017500000000000012752702040017307 5ustar tkemtkem00000000000000Mopidy-Podcast-2.0.1/mopidy_podcast/backend.py0000664000175000017500000000302712706703703021260 0ustar tkemtkem00000000000000from __future__ import unicode_literals import contextlib import logging import cachetools from mopidy import backend import pykka from . import Extension, feeds from .library import PodcastLibraryProvider from .playback import PodcastPlaybackProvider logger = logging.getLogger(__name__) class PodcastFeedCache(cachetools.TTLCache): pykka_traversable = True def __init__(self, config): # FIXME: "missing" parameter will be deprecated in cachetools v1.2 super(PodcastFeedCache, self).__init__( maxsize=config[Extension.ext_name]['cache_size'], ttl=config[Extension.ext_name]['cache_ttl'], missing=self.__missing ) self.__opener = Extension.get_url_opener(config) self.__timeout = config[Extension.ext_name]['timeout'] def __missing(self, uri): ext_name, _, feedurl = uri.partition('+') assert ext_name == Extension.ext_name f = self.__opener.open(feedurl, timeout=self.__timeout) with contextlib.closing(f) as source: feed = feeds.parse(source) return feed class PodcastBackend(pykka.ThreadingActor, backend.Backend): uri_schemes = [ 'podcast', 'podcast+file', 'podcast+http', 'podcast+https' ] def __init__(self, config, audio): super(PodcastBackend, self).__init__() self.feeds = PodcastFeedCache(config) self.library = PodcastLibraryProvider(config, backend=self) self.playback = PodcastPlaybackProvider(audio, backend=self) Mopidy-Podcast-2.0.1/mopidy_podcast/feeds.py0000664000175000017500000001626612752166431020772 0ustar tkemtkem00000000000000from __future__ import unicode_literals import datetime import email.utils import re from mopidy import models import uritools from . import Extension try: import xml.etree.cElementTree as ElementTree except ImportError: import xml.etree.ElementTree as ElementTree def parse(source): if isinstance(source, basestring): url = uritools.uricompose('file', '', source) else: url = source.geturl() root = ElementTree.parse(source).getroot() if root.tag == 'rss': return RssFeed(url, root) elif root.tag == 'opml': return OpmlFeed(url, root) else: raise TypeError('Not a recognized podcast feed: %s', url) class PodcastFeed(object): def __init__(self, url): self.uri = self.getfeeduri(url) @classmethod def getfeeduri(cls, url): return uritools.uridefrag(Extension.ext_name + '+' + url).uri def getitemuri(self, guid, safe=uritools.SUB_DELIMS+b':@/?'): return self.uri + '#' + uritools.uriencode(guid, safe=safe) def getstreamuri(self, guid): raise NotImplemented def items(self, newest_first=None): raise NotImplemented def tracks(self, newest_first=None): return [] def images(self): return [] class RssFeed(PodcastFeed): ITUNES_PREFIX = '{http://www.itunes.com/dtds/podcast-1.0.dtd}' DURATION_RE = re.compile(r""" (?: (?:(?P\d+):)? (?P\d+): )? (?P\d+) """, flags=re.VERBOSE) def __init__(self, url, root): super(RssFeed, self).__init__(url) self.__channel = channel = root.find('channel') items = channel.findall('./item/enclosure[@url]/..') self.__items = list(sorted(items, key=self.__order)) def getstreamuri(self, guid): for item in self.__items: if self.__guid(item) == guid: return item.find('enclosure').get('url') return None def items(self, newest_first=False): for item in (reversed(self.__items) if newest_first else self.__items): yield models.Ref.track( uri=self.getitemuri(self.__guid(item)), name=item.findtext('title') ) def tracks(self, newest_first=False): album = models.Album( uri=self.uri, name=self.__channel.findtext('title'), artists=self.__artists(self.__channel), num_tracks=len(self.__items) ) genre = self.__genre(self.__channel) items = enumerate(self.__items, start=1) for index, item in (reversed(list(items)) if newest_first else items): yield models.Track( uri=self.getitemuri(self.__guid(item)), name=item.findtext('title'), album=album, artists=(self.__artists(item) or album.artists), genre=genre, date=self.__date(item), length=self.__length(item), comment=item.findtext('description'), track_no=index ) def images(self): image = self.__image(self.__channel) default = [image] if image else None if default: yield self.uri, default for item in self.__items: image = self.__image(item) if image: yield self.getitemuri(self.__guid(item)), [image] elif default: yield self.getitemuri(self.__guid(item)), default else: pass @classmethod def __artists(cls, etree): elem = etree.find(cls.ITUNES_PREFIX + 'author') if elem is not None: return [models.Artist(name=elem.text)] else: return None @classmethod def __date(cls, etree): text = etree.findtext('pubDate') try: timestamp = email.utils.mktime_tz(email.utils.parsedate_tz(text)) except AttributeError: return None except TypeError: return None else: return datetime.datetime.utcfromtimestamp( timestamp, ).date().isoformat() @classmethod def __genre(cls, etree): elem = etree.find(cls.ITUNES_PREFIX + 'category') if elem is not None: return elem.get('text') else: return None @classmethod def __guid(cls, etree): return etree.findtext('guid') or etree.find('enclosure').get('url') @classmethod def __image(cls, etree): elem = etree.find(cls.ITUNES_PREFIX + 'image') if elem is not None: return models.Image(uri=elem.get('href')) else: return None @classmethod def __length(cls, etree): text = etree.findtext(cls.ITUNES_PREFIX + 'duration') try: groups = cls.DURATION_RE.match(text).groupdict('0') except AttributeError: return None except TypeError: return None else: d = datetime.timedelta(**{k: int(v) for k, v in groups.items()}) return int(d.total_seconds() * 1000) @staticmethod def __order(etree): text = etree.findtext('pubDate') try: timestamp = email.utils.mktime_tz(email.utils.parsedate_tz(text)) except AttributeError: return 0 except TypeError: return 0 else: return timestamp class OpmlFeed(PodcastFeed): # not really a "feed" TYPES = { 'include': lambda e: models.Ref.directory( name=e.get('text'), uri=PodcastFeed.getfeeduri(e.get('url')) ), 'link': lambda e: models.Ref( type=( models.Ref.DIRECTORY if e.get('url').endswith('.opml') else models.Ref.ALBUM ), name=e.get('text'), uri=PodcastFeed.getfeeduri(e.get('url')) ), 'rss': lambda e: models.Ref.album( name=e.get('title', e.get('text')), uri=PodcastFeed.getfeeduri(e.get('xmlUrl')) ) } def __init__(self, url, root): super(OpmlFeed, self).__init__(url) self.__outlines = root.findall('./body//outline[@type]') def items(self, newest_first=None): for e in self.__outlines: try: ref = self.TYPES[e.get('type').lower()] except KeyError: pass else: yield ref(e) if __name__ == '__main__': # pragma: no cover import argparse import contextlib import json import urllib2 import sys from mopidy.models import ModelJSONEncoder parser = argparse.ArgumentParser() parser.add_argument('url', metavar='URL') parser.add_argument('-i', '--images', action='store_true') parser.add_argument('-t', '--tracks', action='store_true') args = parser.parse_args() with contextlib.closing(urllib2.urlopen(args.url)) as source: feed = PodcastFeed.parse(source) if args.tracks: result = list(feed.tracks()) elif args.images: result = dict(feed.images()) else: result = list(feed.items()) json.dump(result, sys.stdout, cls=ModelJSONEncoder, indent=2) sys.stdout.write('\n') Mopidy-Podcast-2.0.1/mopidy_podcast/ext.conf0000664000175000017500000000123112706703703020761 0ustar tkemtkem00000000000000[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 Mopidy-Podcast-2.0.1/mopidy_podcast/__init__.py0000664000175000017500000000372212752676446021450 0ustar tkemtkem00000000000000from __future__ import unicode_literals import os from mopidy import config, ext, httpclient __version__ = '2.0.1' class Extension(ext.Extension): dist_name = 'Mopidy-Podcast' ext_name = 'podcast' version = __version__ def get_default_config(self): return config.read(os.path.join(os.path.dirname(__file__), 'ext.conf')) def get_config_schema(self): schema = super(Extension, self).get_config_schema() schema['browse_root'] = config.String(optional=True) schema['browse_order'] = config.String(choices=['asc', 'desc']) schema['lookup_order'] = config.String(choices=['asc', 'desc']) schema['cache_size'] = config.Integer(minimum=1) schema['cache_ttl'] = config.Integer(minimum=1) schema['timeout'] = config.Integer(optional=True, minimum=1) # no longer used schema['browse_limit'] = config.Deprecated() schema['search_limit'] = config.Deprecated() schema['search_details'] = config.Deprecated() schema['update_interval'] = config.Deprecated() schema['feeds'] = config.Deprecated() schema['feeds_root_name'] = config.Deprecated() schema['feeds_cache_size'] = config.Deprecated() schema['feeds_cache_ttl'] = config.Deprecated() schema['feeds_timeout'] = config.Deprecated() return schema def setup(self, registry): from .backend import PodcastBackend registry.add('backend', PodcastBackend) @classmethod def get_url_opener(cls, config): import urllib2 proxy = httpclient.format_proxy(config['proxy']) if proxy: handlers = [urllib2.ProxyHandler({'http': proxy, 'https': proxy})] else: handlers = [] opener = urllib2.build_opener(*handlers) user_agent = '%s/%s' % (cls.dist_name, cls.version) opener.addheaders = [ ('User-agent', httpclient.format_user_agent(user_agent)) ] return opener Mopidy-Podcast-2.0.1/mopidy_podcast/playback.py0000664000175000017500000000077012706703703021461 0ustar tkemtkem00000000000000from __future__ import unicode_literals import logging from mopidy import backend import uritools logger = logging.getLogger(__name__) class PodcastPlaybackProvider(backend.PlaybackProvider): def translate_uri(self, uri): parts = uritools.uridefrag(uri) try: feed = self.backend.feeds[parts.uri] except Exception as e: logger.error('Error retrieving %s: %s', parts.uri, e) else: return feed.getstreamuri(parts.getfragment()) Mopidy-Podcast-2.0.1/mopidy_podcast/library.py0000664000175000017500000000752412706703703021343 0ustar tkemtkem00000000000000from __future__ import unicode_literals import itertools import locale import logging import os from mopidy import backend, models import uritools from . import Extension logger = logging.getLogger(__name__) def strerror(error): if isinstance(error.strerror, bytes): return error.strerror.decode(locale.getpreferredencoding()) else: return error.strerror def get_config_dir(config): try: return Extension.get_config_dir(config) except EnvironmentError as e: logger.warning('Cannot access %s config directory: %s', Extension.dist_name, strerror(e)) except Exception as e: logger.warning('Cannot access %s config directory: %s', Extension.dist_name, e) return None class PodcastLibraryProvider(backend.LibraryProvider): def __init__(self, config, backend): super(PodcastLibraryProvider, self).__init__(backend) self.__config_dir = get_config_dir(config) self.__browse_root = config[Extension.ext_name]['browse_root'] self.__browse_order = config[Extension.ext_name]['browse_order'] self.__lookup_order = config[Extension.ext_name]['lookup_order'] self.__tracks = {} # cache tracks for faster lookup @property def root_directory(self): root = self.__browse_root if not root: return None elif root.startswith(('file:', 'http:', 'https:')): uri = uritools.uridefrag('podcast+' + root).uri elif os.path.isabs(root): uri = uritools.uricompose('podcast+file', '', root) elif self.__config_dir: uri = uritools.uricompose('podcast+file', '', os.path.join(self.__config_dir, root)) else: return None return models.Ref.directory(name='Podcasts', uri=uri) def browse(self, uri): try: feed = self.backend.feeds[uri] except Exception as e: logger.error('Error retrieving %s: %s', uri, e) # TODO: raise? else: return list(feed.items(self.__browse_order == 'desc')) return [] # FIXME: hide errors from clients def get_images(self, uris): def key(uri): return uritools.uridefrag(uri).uri result = {} for feeduri, uris in itertools.groupby(sorted(uris, key=key), key=key): try: images = dict(self.backend.feeds[feeduri].images()) except Exception as e: logger.error('Error retrieving images for %s: %s', feeduri, e) else: result.update((uri, images.get(uri, [])) for uri in uris) return result def lookup(self, uri): # pop from __tracks since cached tracks shouldn't live too long try: track = self.__tracks.pop(uri) except KeyError: logger.debug('Lookup cache miss: %s', uri) else: return [track] try: feed = self.backend.feeds[uritools.uridefrag(uri).uri] except Exception as e: logger.error('Error retrieving %s: %s', uri, e) # TODO: raise? else: return self.__lookup(feed, uri) return [] # FIXME: hide errors from clients def refresh(self, uri=None): if uri: self.backend.feeds.pop(uritools.uridefrag(uri).uri, None) else: self.backend.feeds.clear() self.__tracks.clear() def __lookup(self, feed, uri): if uri == feed.uri: return list(feed.tracks(self.__lookup_order == 'desc')) else: self.__tracks = tracks = {t.uri: t for t in feed.tracks()} try: track = tracks.pop(uri) except KeyError: logger.warning('No such track: %s', uri) # TODO: raise? else: return [track] Mopidy-Podcast-2.0.1/tests/0000775000175000017500000000000012752702040015433 5ustar tkemtkem00000000000000Mopidy-Podcast-2.0.1/tests/conftest.py0000664000175000017500000000161112706703703017637 0ustar tkemtkem00000000000000from __future__ import unicode_literals import functools import os import mock import pytest import mopidy_podcast as ext @pytest.fixture def abspath(): return functools.partial(os.path.join, os.path.dirname(__file__)) @pytest.fixture def audio(): return mock.Mock() @pytest.fixture def config(): return { 'podcast': { 'browse_root': 'Podcasts.opml', 'browse_order': 'desc', 'lookup_order': 'asc', 'cache_size': 64, 'cache_ttl': 86400, 'timeout': 10 }, 'core': { 'config_dir': os.path.dirname(__file__) }, 'proxy': {} } @pytest.fixture def backend(config, audio): return ext.backend.PodcastBackend(config, audio) @pytest.fixture def library(backend): return backend.library @pytest.fixture def playback(backend): return backend.playback Mopidy-Podcast-2.0.1/tests/directory.xml0000664000175000017500000001111712706703703020170 0ustar tkemtkem00000000000000 mySubscriptions.opml Sat, 18 Jun 2005 12:11:52 GMT Tue, 02 Aug 2005 21:42:48 GMT Dave Winer dave@scripting.com 1 61 304 562 842 Mopidy-Podcast-2.0.1/tests/test_extension.py0000664000175000017500000000375312706703703021076 0ustar tkemtkem00000000000000from __future__ import unicode_literals import urllib2 import mock import pytest from mopidy_podcast import Extension, backend def test_get_default_config(): config = Extension().get_default_config() assert '[' + Extension.ext_name + ']' in config assert 'enabled = true' in config def test_get_config_schema(): schema = Extension().get_config_schema() assert 'browse_root' in schema assert 'browse_order' in schema assert 'lookup_order' in schema assert 'cache_size' in schema assert 'cache_ttl' in schema assert 'timeout' in schema def test_setup(): registry = mock.Mock() Extension().setup(registry) registry.add.assert_called_once_with('backend', backend.PodcastBackend) @pytest.mark.parametrize('url,handler,method,proxy_config', [ ('file://example.com/feed.xml', urllib2.FileHandler, 'file_open', {}), ('http://example.com/feed.xml', urllib2.HTTPHandler, 'http_open', {}), ('https://example.com/feed.xml', urllib2.HTTPSHandler, 'https_open', {}), ('http://example.com/feed.xml', urllib2.HTTPHandler, 'http_open', {'scheme': 'http', 'hostname': 'localhost', 'port': 9999}), ('http://example.com/feed.xml', urllib2.HTTPSHandler, 'https_open', {'scheme': 'https', 'hostname': 'localhost', 'port': 9999}) ]) def test_get_url_opener(url, handler, method, proxy_config): opener = Extension.get_url_opener({'proxy': proxy_config}) with mock.patch.object(handler, method) as mock_open: try: opener.open(url) except Exception: pass assert mock_open.mock_calls (req,), _ = mock_open.call_args if req.header_items(): user_agent = '%s/%s' % (Extension.dist_name, Extension.version) assert user_agent in req.get_header('User-agent') if proxy_config: assert req.get_type() == proxy_config['scheme'] assert req.get_host() == '{hostname}:{port}'.format(**proxy_config) assert req.get_selector() == url assert url == req.get_full_url() Mopidy-Podcast-2.0.1/tests/test_feeds.py0000664000175000017500000000067512706703703020150 0ustar tkemtkem00000000000000from __future__ import unicode_literals import pytest import uritools from mopidy_podcast import feeds @pytest.mark.parametrize('filename,expected', [ ('directory.xml', feeds.OpmlFeed), ('rssfeed.xml', feeds.RssFeed), ]) def test_parse(abspath, filename, expected): path = abspath(filename) feed = feeds.parse(path) assert isinstance(feed, expected) assert feed.uri == uritools.uricompose('podcast+file', '', path) Mopidy-Podcast-2.0.1/tests/test_playback.py0000664000175000017500000000102612706703703020637 0ustar tkemtkem00000000000000from __future__ import unicode_literals import pytest from mopidy_podcast import feeds @pytest.mark.parametrize('filename', ['rssfeed.xml']) def test_translate_uri(playback, filename, abspath): feed = feeds.parse(abspath(filename)) for track in feed.tracks(): assert playback.translate_uri(track.uri) is not None assert playback.translate_uri(feed.uri + '#n/a') is None assert playback.translate_uri(feed.uri) is None def test_translate_empty_uri(playback): assert playback.translate_uri('') is None Mopidy-Podcast-2.0.1/tests/test_library.py0000664000175000017500000000541612706703703020524 0ustar tkemtkem00000000000000from __future__ import unicode_literals import pytest from mopidy_podcast import feeds def test_root_directory(library): assert library.root_directory is not None assert library.root_directory.name == 'Podcasts' assert library.root_directory.uri.endswith('Podcasts.opml') @pytest.mark.parametrize('filename', ['directory.xml', 'rssfeed.xml']) def test_browse(config, library, filename, abspath): feed = feeds.parse(abspath(filename)) newest_first = config['podcast']['browse_order'] == 'desc' assert library.browse(feed.uri) == list(feed.items(newest_first)) assert feed.uri in library.backend.feeds @pytest.mark.parametrize('uri,expected', [ (None, []), ('podcast+file:///', []), ]) def test_browse_error(library, uri, expected): if isinstance(expected, type): with pytest.raises(expected): library.browse(uri) else: assert library.browse(uri) == expected @pytest.mark.parametrize('filename', ['rssfeed.xml']) def test_get_images(library, filename, abspath): feed = feeds.parse(abspath(filename)) for uri, images in feed.images(): assert library.get_images([uri]) == {uri: images} images = {uri: images for uri, images in feed.images()} assert library.get_images(list(images)) == images assert feed.uri in library.backend.feeds @pytest.mark.parametrize('uris,expected', [ (None, TypeError), ('podcast+file:///', {}), ]) def test_get_images_error(library, uris, expected): if isinstance(expected, type): with pytest.raises(expected): library.get_images(uris) else: assert library.get_images(uris) == expected @pytest.mark.parametrize('filename', ['rssfeed.xml']) def test_lookup(config, library, filename, abspath): feed = feeds.parse(abspath(filename)) for track in feed.tracks(): assert library.lookup(track.uri) == [track] newest_first = config['podcast']['lookup_order'] == 'desc' assert library.lookup(feed.uri) == list(feed.tracks(newest_first)) assert feed.uri in library.backend.feeds @pytest.mark.parametrize('uri,expected', [ (None, []), ('podcast+file:///', []) ]) def test_lookup_error(library, uri, expected): if isinstance(expected, type): with pytest.raises(expected): library.lookup(uri) else: assert library.lookup(uri) == expected @pytest.mark.parametrize('filename', ['rssfeed.xml']) def test_refresh(library, filename, abspath): feed = feeds.parse(abspath(filename)) tracks = library.lookup(feed.uri) assert feed.uri in library.backend.feeds library.refresh(tracks[0].uri) assert feed.uri not in library.backend.feeds library.lookup(tracks[0].uri) assert feed.uri in library.backend.feeds library.refresh() assert not library.backend.feeds Mopidy-Podcast-2.0.1/tests/test_rss.py0000664000175000017500000001053412706703703017664 0ustar tkemtkem00000000000000from __future__ import unicode_literals from mopidy import models import pytest from mopidy_podcast import feeds XML = b""" All About Everything http://www.example.com/everything/index.html en-us ℗ & © 2014 John Doe & Family John Doe All About Everything is a show about everything. Shake Shake Shake Your Spices episode3 Wed, 15 Jun 2014 19:00:00 GMT 7:04 Socket Wrench Shootout Jane Doe episode2 Wed, 8 Jun 2014 19:00:00 GMT 4:34 Red, Whine, & Blue Various Wed, 1 Jun 2014 19:00:00 GMT 3:59 """ @pytest.fixture def rss(): from StringIO import StringIO class StringSource(StringIO): def geturl(self): return 'http://www.example.com/everything.xml' return feeds.parse(StringSource(XML)) @pytest.fixture def album(): return models.Album( uri='podcast+http://www.example.com/everything.xml', name='All About Everything', artists=[models.Artist(name='John Doe')], num_tracks=3 ) @pytest.fixture def tracks(album): return [ models.Track( uri='podcast+http://www.example.com/everything.xml#episode3', name='Shake Shake Shake Your Spices', artists=[models.Artist(name='John Doe')], album=album, genre='Technology', date='2014-06-15', length=424000, track_no=3 ), models.Track( uri='podcast+http://www.example.com/everything.xml#episode2', name='Socket Wrench Shootout', artists=[models.Artist(name='Jane Doe')], album=album, genre='Technology', date='2014-06-08', length=274000, track_no=2 ), models.Track( uri=('podcast+http://www.example.com/everything.xml' '#http://example.com/everything/Episode1.mp3'), name='Red, Whine, & Blue', artists=[models.Artist(name='Various')], album=album, genre='Technology', date='2014-06-01', length=239000, track_no=1 ), ] @pytest.fixture def items(tracks): return [models.Ref.track(uri=t.uri, name=t.name) for t in tracks] def test_items(rss, items): assert list(rss.items(newest_first=True)) == items assert list(rss.items(newest_first=False)) == list(reversed(items)) def test_tracks(rss, tracks): assert list(rss.tracks(newest_first=True)) == tracks assert list(rss.tracks(newest_first=False)) == list(reversed(tracks)) def test_images(rss): assert dict(rss.images()) == { 'podcast+http://www.example.com/everything.xml': [ models.Image(uri='http://example.com/everything/Podcast.jpg') ], 'podcast+http://www.example.com/everything.xml#episode3': [ models.Image(uri='http://example.com/everything/Episode3.jpg') ], 'podcast+http://www.example.com/everything.xml#episode2': [ models.Image(uri='http://example.com/everything/Episode2.jpg') ], ('podcast+http://www.example.com/everything.xml' '#http://example.com/everything/Episode1.mp3'): [ models.Image(uri='http://example.com/everything/Podcast.jpg') ] } Mopidy-Podcast-2.0.1/tests/__init__.py0000664000175000017500000000000012706703703017540 0ustar tkemtkem00000000000000Mopidy-Podcast-2.0.1/tests/rssfeed.xml0000664000175000017500000000662412706703703017626 0ustar tkemtkem00000000000000 All About Everything http://www.example.com/podcasts/everything/index.html en-us ℗ & © 2014 John Doe & Family A show about everything John Doe All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our podcast in the Podcasts app or in the iTunes Store All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our podcast in the Podcasts app or in the iTunes Store John Doe john.doe@example.com Shake Shake Shake Your Spices John Doe A short primer on table spices salt and pepper shakers, comparing and contrasting pour rates, construction materials, and overall aesthetics. Come and join the party!]]> http://example.com/podcasts/archive/aae20140615.m4a Wed, 15 Jun 2014 19:00:00 GMT 7:04 Socket Wrench Shootout Jane Doe Comparing socket wrenches is fun! This week we talk about metric vs. Old English socket wrenches. Which one is better? Do you really need both? Get all of your answers here. http://example.com/podcasts/archive/aae20140608.mp3 Wed, 8 Jun 2014 19:00:00 GMT 4:34 Red,Whine, & Blue Various Red + Blue != Purple This week we talk about surviving in a Red state if you are a Blue person. Or vice versa. http://example.com/podcasts/archive/aae20140601.mp3 Wed, 1 Jun 2014 19:00:00 GMT 3:59 Mopidy-Podcast-2.0.1/tests/test_opml.py0000664000175000017500000000423312706703703020023 0ustar tkemtkem00000000000000from __future__ import unicode_literals from mopidy import models import pytest from mopidy_podcast import feeds XML = b""" example.opml Tue, 02 Mar 2016 12:01:00 GMT Tue, 02 Mar 2016 12:01:00 GMT """ @pytest.fixture def opml(): from StringIO import StringIO class StringSource(StringIO): def geturl(self): return 'http://example.com/example.opml' return StringSource(XML) def test_items(opml): feed = feeds.parse(opml) assert list(feed.items()) == [ models.Ref.album( uri='podcast+http://example.com/podcast1.rss', name='Podcast' ), models.Ref.album( uri='podcast+http://example.com/podcast2.xml', name='Podcast' ), models.Ref.album( uri='podcast+http://example.com/podcast3', name='Podcast' ), models.Ref.directory( uri='podcast+http://example.com/directory1', name='Directory' ), models.Ref.directory( uri='podcast+http://example.com/directory2.opml', name='Directory' ), models.Ref.album( uri='podcast+http://example.com/podcast4.xml', name='Podcast' ) ] def test_tracks(opml): feed = feeds.parse(opml) assert list(feed.tracks()) == [] def test_images(opml): feed = feeds.parse(opml) assert dict(feed.images()) == {} Mopidy-Podcast-2.0.1/PKG-INFO0000664000175000017500000000617612752702040015400 0ustar tkemtkem00000000000000Metadata-Version: 1.1 Name: Mopidy-Podcast Version: 2.0.1 Summary: Mopidy extension for browsing and playing podcasts Home-page: https://github.com/tkem/mopidy-podcast Author: Thomas Kemmer Author-email: tkemmer@computer.org License: Apache License, Version 2.0 Description: 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. For more information and installation instructions, please see Mopidy-Podcast's online documentation_. Project Resources ------------------------------------------------------------------------ .. image:: http://img.shields.io/pypi/v/Mopidy-Podcast.svg?style=flat :target: https://pypi.python.org/pypi/Mopidy-Podcast/ :alt: Latest PyPI version .. image:: http://img.shields.io/travis/tkem/mopidy-podcast/master.svg?style=flat :target: https://travis-ci.org/tkem/mopidy-podcast/ :alt: Travis CI build status .. image:: http://img.shields.io/coveralls/tkem/mopidy-podcast/master.svg?style=flat :target: https://coveralls.io/r/tkem/mopidy-podcast/ :alt: Test coverage .. image:: https://readthedocs.org/projects/mopidy-podcast/badge/?version=latest&style=flat :target: http://mopidy-podcast.readthedocs.io/en/latest/ :alt: Documentation Status - `Issue Tracker`_ - `Source Code`_ - `Change Log`_ License ------------------------------------------------------------------------ Copyright (c) 2014-2016 Thomas Kemmer and contributors_. Licensed under the `Apache License, Version 2.0`_. .. _Mopidy: http://www.mopidy.com/ .. _Documentation: http://mopidy-podcast.readthedocs.io/en/latest/ .. _Issue Tracker: https://github.com/tkem/mopidy-podcast/issues/ .. _Source Code: https://github.com/tkem/mopidy-podcast/ .. _Change Log: https://github.com/tkem/mopidy-podcast/blob/master/CHANGES.rst .. _contributors: https://github.com/tkem/mopidy-podcast/blob/master/AUTHORS .. _Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 Platform: UNKNOWN Classifier: Environment :: No Input/Output (Daemon) Classifier: Intended Audience :: End Users/Desktop Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python :: 2 Classifier: Topic :: Multimedia :: Sound/Audio :: Players Mopidy-Podcast-2.0.1/CHANGES.rst0000664000175000017500000000340212752676434016113 0ustar tkemtkem00000000000000v2.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 ````. - 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. Mopidy-Podcast-2.0.1/README.rst0000664000175000017500000000411112752676773016004 0ustar tkemtkem00000000000000Mopidy-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. For more information and installation instructions, please see Mopidy-Podcast's online documentation_. Project Resources ------------------------------------------------------------------------ .. image:: http://img.shields.io/pypi/v/Mopidy-Podcast.svg?style=flat :target: https://pypi.python.org/pypi/Mopidy-Podcast/ :alt: Latest PyPI version .. image:: http://img.shields.io/travis/tkem/mopidy-podcast/master.svg?style=flat :target: https://travis-ci.org/tkem/mopidy-podcast/ :alt: Travis CI build status .. image:: http://img.shields.io/coveralls/tkem/mopidy-podcast/master.svg?style=flat :target: https://coveralls.io/r/tkem/mopidy-podcast/ :alt: Test coverage .. image:: https://readthedocs.org/projects/mopidy-podcast/badge/?version=latest&style=flat :target: http://mopidy-podcast.readthedocs.io/en/latest/ :alt: Documentation Status - `Issue Tracker`_ - `Source Code`_ - `Change Log`_ License ------------------------------------------------------------------------ Copyright (c) 2014-2016 Thomas Kemmer and contributors_. Licensed under the `Apache License, Version 2.0`_. .. _Mopidy: http://www.mopidy.com/ .. _Documentation: http://mopidy-podcast.readthedocs.io/en/latest/ .. _Issue Tracker: https://github.com/tkem/mopidy-podcast/issues/ .. _Source Code: https://github.com/tkem/mopidy-podcast/ .. _Change Log: https://github.com/tkem/mopidy-podcast/blob/master/CHANGES.rst .. _contributors: https://github.com/tkem/mopidy-podcast/blob/master/AUTHORS .. _Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 Mopidy-Podcast-2.0.1/docs/0000775000175000017500000000000012752702040015221 5ustar tkemtkem00000000000000Mopidy-Podcast-2.0.1/docs/config.rst0000664000175000017500000000530212706703703017226 0ustar tkemtkem00000000000000Configuration ======================================================================== This extension provides a number of configuration values that can be tweaked. However, the :ref:`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. .. _confvals: Configuration Values ------------------------------------------------------------------------ .. confval:: podcast/enabled Whether this extension should be enabled or not. .. confval:: 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 [#footnote1]_. 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. .. confval:: podcast/browse_order Whether to sort podcast episodes by ascending (``asc``) or descending (``desc``) publication date for browsing. .. confval:: 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. .. confval:: podcast/cache_size The maximum number of podcast feeds that will be cached in memory. .. confval:: 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. .. confval:: podcast/timeout The HTTP request timeout when retrieving podcast feeds, in seconds. .. _defconf: Default Configuration ------------------------------------------------------------------------ For reference, this is the default configuration shipped with Mopidy-Podcast release |release|: .. literalinclude:: ../mopidy_podcast/ext.conf :language: ini .. rubric:: Footnotes .. [#footnote1] 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. .. _PyPI: https://pypi.python.org/pypi/Mopidy-Podcast/ Mopidy-Podcast-2.0.1/docs/license.rst0000664000175000017500000000126212752170321017377 0ustar tkemtkem00000000000000License ======================================================================== 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 http://www.apache.org/licenses/LICENSE-2.0 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. Mopidy-Podcast-2.0.1/docs/conf.py0000664000175000017500000000144712706703703016534 0ustar tkemtkem00000000000000def setup(app): app.add_object_type( 'confval', 'confval', objname='configuration value', indextemplate='pair: %s; configuration value' ) def get_version(filename): from re import findall with open(filename) as f: metadata = dict(findall(r"__([a-z]+)__ = '([^']+)'", f.read())) return metadata['version'] project = 'Mopidy-Podcast' copyright = '2014-2016 Thomas Kemmer' version = get_version(b'../mopidy_podcast/__init__.py') release = version exclude_patterns = ['_build'] master_doc = 'index' html_theme = 'default' latex_documents = [( 'index', 'Mopidy-Podcast.tex', 'Mopidy-Podcast Documentation', 'Thomas Kemmer', 'manual' )] man_pages = [( 'index', 'mopidy-podcast', 'Mopidy-Podcast Documentation', ['Thomas Kemmer'], 1 )] Mopidy-Podcast-2.0.1/docs/Makefile0000664000175000017500000001273412706703703016676 0ustar tkemtkem00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Mopidy-Podcast.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Mopidy-Podcast.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/Mopidy-Podcast" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Mopidy-Podcast" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." Mopidy-Podcast-2.0.1/docs/changelog.rst0000664000175000017500000000016112706703703017706 0ustar tkemtkem00000000000000Change Log ======================================================================== .. include:: ../CHANGES.rst Mopidy-Podcast-2.0.1/docs/index.rst0000664000175000017500000000460412752166431017076 0ustar tkemtkem00000000000000Mopidy-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 :confval:`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:: - 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 `_. .. toctree:: :hidden: install config changelog license .. _Mopidy: http://www.mopidy.com/ .. _OPML 2.0 specification: http://dev.opml.org/spec2.html .. _Mopidy-Podcast-iTunes: https://github.com/tkem/mopidy-podcast-itunes/ Mopidy-Podcast-2.0.1/docs/install.rst0000664000175000017500000000066512706703703017436 0ustar tkemtkem00000000000000Installation ======================================================================== 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 .. _PyPI: https://pypi.python.org/pypi/Mopidy-Podcast/ .. _apt.mopidy.com: http://apt.mopidy.com/ Mopidy-Podcast-2.0.1/Mopidy_Podcast.egg-info/0000775000175000017500000000000012752702040020701 5ustar tkemtkem00000000000000Mopidy-Podcast-2.0.1/Mopidy_Podcast.egg-info/dependency_links.txt0000664000175000017500000000000112752702037024755 0ustar tkemtkem00000000000000 Mopidy-Podcast-2.0.1/Mopidy_Podcast.egg-info/top_level.txt0000664000175000017500000000001712752702037023437 0ustar tkemtkem00000000000000mopidy_podcast Mopidy-Podcast-2.0.1/Mopidy_Podcast.egg-info/PKG-INFO0000664000175000017500000000617612752702037022016 0ustar tkemtkem00000000000000Metadata-Version: 1.1 Name: Mopidy-Podcast Version: 2.0.1 Summary: Mopidy extension for browsing and playing podcasts Home-page: https://github.com/tkem/mopidy-podcast Author: Thomas Kemmer Author-email: tkemmer@computer.org License: Apache License, Version 2.0 Description: 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. For more information and installation instructions, please see Mopidy-Podcast's online documentation_. Project Resources ------------------------------------------------------------------------ .. image:: http://img.shields.io/pypi/v/Mopidy-Podcast.svg?style=flat :target: https://pypi.python.org/pypi/Mopidy-Podcast/ :alt: Latest PyPI version .. image:: http://img.shields.io/travis/tkem/mopidy-podcast/master.svg?style=flat :target: https://travis-ci.org/tkem/mopidy-podcast/ :alt: Travis CI build status .. image:: http://img.shields.io/coveralls/tkem/mopidy-podcast/master.svg?style=flat :target: https://coveralls.io/r/tkem/mopidy-podcast/ :alt: Test coverage .. image:: https://readthedocs.org/projects/mopidy-podcast/badge/?version=latest&style=flat :target: http://mopidy-podcast.readthedocs.io/en/latest/ :alt: Documentation Status - `Issue Tracker`_ - `Source Code`_ - `Change Log`_ License ------------------------------------------------------------------------ Copyright (c) 2014-2016 Thomas Kemmer and contributors_. Licensed under the `Apache License, Version 2.0`_. .. _Mopidy: http://www.mopidy.com/ .. _Documentation: http://mopidy-podcast.readthedocs.io/en/latest/ .. _Issue Tracker: https://github.com/tkem/mopidy-podcast/issues/ .. _Source Code: https://github.com/tkem/mopidy-podcast/ .. _Change Log: https://github.com/tkem/mopidy-podcast/blob/master/CHANGES.rst .. _contributors: https://github.com/tkem/mopidy-podcast/blob/master/AUTHORS .. _Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 Platform: UNKNOWN Classifier: Environment :: No Input/Output (Daemon) Classifier: Intended Audience :: End Users/Desktop Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python :: 2 Classifier: Topic :: Multimedia :: Sound/Audio :: Players Mopidy-Podcast-2.0.1/Mopidy_Podcast.egg-info/entry_points.txt0000664000175000017500000000006112752702037024202 0ustar tkemtkem00000000000000[mopidy.ext] podcast = mopidy_podcast:Extension Mopidy-Podcast-2.0.1/Mopidy_Podcast.egg-info/not-zip-safe0000664000175000017500000000000112706704737023145 0ustar tkemtkem00000000000000 Mopidy-Podcast-2.0.1/Mopidy_Podcast.egg-info/SOURCES.txt0000664000175000017500000000145112752702040022566 0ustar tkemtkem00000000000000AUTHORS CHANGES.rst LICENSE MANIFEST.in README.rst setup.cfg setup.py tox.ini Mopidy_Podcast.egg-info/PKG-INFO Mopidy_Podcast.egg-info/SOURCES.txt Mopidy_Podcast.egg-info/dependency_links.txt Mopidy_Podcast.egg-info/entry_points.txt Mopidy_Podcast.egg-info/not-zip-safe Mopidy_Podcast.egg-info/requires.txt Mopidy_Podcast.egg-info/top_level.txt docs/Makefile docs/changelog.rst docs/conf.py docs/config.rst docs/index.rst docs/install.rst docs/license.rst mopidy_podcast/__init__.py mopidy_podcast/backend.py mopidy_podcast/ext.conf mopidy_podcast/feeds.py mopidy_podcast/library.py mopidy_podcast/playback.py tests/__init__.py tests/conftest.py tests/directory.xml tests/rssfeed.xml tests/test_extension.py tests/test_feeds.py tests/test_library.py tests/test_opml.py tests/test_playback.py tests/test_rss.pyMopidy-Podcast-2.0.1/Mopidy_Podcast.egg-info/requires.txt0000664000175000017500000000011212752702037023301 0ustar tkemtkem00000000000000setuptools Mopidy >= 1.1.1 Pykka >= 1.1 cachetools >= 1.0 uritools >= 1.0 Mopidy-Podcast-2.0.1/MANIFEST.in0000664000175000017500000000033312752166431016036 0ustar tkemtkem00000000000000include AUTHORS include CHANGES.rst include LICENSE include MANIFEST.in include README.rst include mopidy_podcast/ext.conf include tox.ini recursive-include tests *.py *.xml recursive-include docs * prune docs/_build Mopidy-Podcast-2.0.1/LICENSE0000664000175000017500000002367612706703703015322 0ustar tkemtkem00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS Mopidy-Podcast-2.0.1/setup.cfg0000664000175000017500000000035112752702040016111 0ustar tkemtkem00000000000000[flake8] application-import-names = mopidy_podcast,tests exclude = .git,.tox [wheel] universal = 1 [build_sphinx] source-dir = docs/ build-dir = docs/_build all_files = 1 [egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 Mopidy-Podcast-2.0.1/AUTHORS0000664000175000017500000000011512752166431015346 0ustar tkemtkem00000000000000- Thomas Kemmer - Chris Lamb Mopidy-Podcast-2.0.1/tox.ini0000664000175000017500000000103412706712746015617 0ustar tkemtkem00000000000000[tox] envlist = check-manifest,docs,flake8,py27 [testenv] sitepackages = true deps = mock pytest pytest-cov pytest-xdist commands = py.test --basetemp={envtmpdir} --cov=mopidy_podcast {posargs} [testenv:check-manifest] deps = check-manifest commands = check-manifest skip_install = true [testenv:docs] deps = sphinx commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html [testenv:flake8] deps = flake8 flake8-import-order commands = flake8 skip_install = true Mopidy-Podcast-2.0.1/setup.py0000664000175000017500000000252212706703703016012 0ustar tkemtkem00000000000000from __future__ import unicode_literals from setuptools import find_packages, setup def get_version(filename): from re import findall with open(filename) as f: metadata = dict(findall("__([a-z]+)__ = '([^']+)'", f.read())) return metadata['version'] setup( name='Mopidy-Podcast', version=get_version('mopidy_podcast/__init__.py'), url='https://github.com/tkem/mopidy-podcast', license='Apache License, Version 2.0', author='Thomas Kemmer', author_email='tkemmer@computer.org', description='Mopidy extension for browsing and playing podcasts', long_description=open('README.rst').read(), packages=find_packages(exclude=['tests', 'tests.*']), zip_safe=False, include_package_data=True, install_requires=[ 'setuptools', 'Mopidy >= 1.1.1', 'Pykka >= 1.1', 'cachetools >= 1.0', 'uritools >= 1.0' ], entry_points={ 'mopidy.ext': [ 'podcast = mopidy_podcast:Extension', ], }, classifiers=[ 'Environment :: No Input/Output (Daemon)', 'Intended Audience :: End Users/Desktop', 'License :: OSI Approved :: Apache Software License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'Topic :: Multimedia :: Sound/Audio :: Players', ], )