Coverage for coherence/backends/playlist_storage.py : 73%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# Licensed under the MIT license # http://opensource.org/licenses/mit-license.php
# a backend
# Copyright 2007, Frank Scholz <coherence@beebits.net> # Copyright 2008, Jean-Michel Sizun <jm.sizun@free.fr>
else: item = DIDLLite.AudioItem(upnp_id, upnp_parent_id, self.name)
# what to do with MMS:// feeds? protocol = "rtsp-rtp-udp"
'%s:*:%s:*' % (protocol, self.mimetype))
'Playlist', 'exposes the list of video/audio streams from a m3u playlist (e.g. ' 'web TV listings published by french ISPs such as Free, SFR...).', None)
{'option': 'name', 'text': 'Server Name:', 'type': 'string', 'default': 'my media', 'help': 'the name under this MediaServer ' 'shall show up with on other UPnP clients'}, {'option': 'version', 'text': 'UPnP Version:', 'type': 'int', 'default': 2, 'enum': (2, 1), 'help': 'the highest UPnP version this MediaServer shall support', 'level': 'advance'}, {'option': 'uuid', 'text': 'UUID Identifier:', 'type': 'string', 'help': 'the unique (UPnP) identifier for this MediaServer, ' 'usually automatically set', 'level': 'advance'}, {'option': 'playlist_url', 'text': 'Playlist file URL:', 'type': 'string', 'help': 'URL to the playlist file (M3U).'}, ]
'playlist_url', 'https://mafreebox.freebox.fr/freeboxtv/playlist.m3u' )
if isinstance(obj, str): mimetype = 'directory' else: mimetype = obj['mimetype']
UPnPClass = classChooser(mimetype) id = self.getnextID() update = False if hasattr(self, 'update_id'): update = True
item = PlaylistItem( id, obj, mimetype, parent=parent, storageid=parent, upnpclass=UPnPClass, update=update)
self.store[id] = item self.store[id].store = self if hasattr(self, 'update_id'): self.update_id += 1 if self.server: self.server.content_directory_server.set_variable( 0, 'SystemUpdateID', self.update_id) if parent: value = (parent.get_id(), parent.get_update_id()) if self.server: self.server.content_directory_server.set_variable( 0, 'ContainerUpdateIDs', value)
if mimetype == 'directory': return self.store[id]
return None
self.server.connection_manager_server.set_variable( 0, 'SourceProtocolInfo', ['rtsp-rtp-udp:*:video/mpeg:*', 'http-get:*:video/mpeg:*', 'rtsp-rtp-udp:*:audio/mpeg:*', 'http-get:*:audio/mpeg:*'], default=True)
mimetype, channel)) option = re.match('#EXTVLCOPT:(.*)', line).group(1) if option == 'no-video': mimetype = 'audio/mpeg' line = next(lines)
self.warning("Unable to retrieve playlist: %s", url) print("Error: %s" % error) return None
|