A Python UPnP Media Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
John-Mark Gurney ac10c390dc handle deleting an item multiple times, log when we do so I can try 18 years ago
docs branch the files into a main line branch.. I should of done this 19 years ago
xml branch the files into a main line branch.. I should of done this 19 years ago
ConnectionManager.py switch to using tabs instead of spaces... 19 years ago
ContentDirectory.py handle deleting an item multiple times, log when we do so I can try 18 years ago
DIDLLite.py make DIDLLite's a real object so we can use them 18 years ago
FSStorage.py drop or comment out some debugging 18 years ago
FileDIDL.py make the name/mimetype handling more generic so that other modules 18 years ago
MediaServer.py branch the files into a main line branch.. I should of done this 19 years ago
README rephrase Tim's abandonment of the code, and that I've put in a 18 years ago
SSDP.py add $Id$'s so that people can tell which files have changed between 18 years ago
ZipStorage.py drop or comment out some debugging 18 years ago
browse-zms.py switch to using tabs instead of spaces... 19 years ago
cdsclient switch to using tabs instead of spaces... 19 years ago
connection-manager-scpd.xml branch the files into a main line branch.. I should of done this 19 years ago
content-directory-scpd.xml branch the files into a main line branch.. I should of done this 19 years ago
iterzipfile.py add new wrapper for iterzipfile instead of mod'ing the python modules 18 years ago
pymediaserv add m2t as an extension for video/mpeg (an MPEG-2 TS) 18 years ago
root-device.xml branch the files into a main line branch.. I should of done this 19 years ago
upnp.py add $Id$'s so that people can tell which files have changed between 18 years ago
xmlpretty switch to using tabs instead of spaces... 19 years ago

README

This code is based upon code by Tim Potter.

It is licensed under the MIT license at:
http://opensource.org/licenses/mit-license.php

I got a D-Link DSM-520 but I needed a UPnP Media Server to stream data
with. I tried one, but it had issues running under FreeBSD's Linux
emulation. Since I know Python, I went looking for a python server
and found this code. The code was a good framework, so I expanded upon
it.

Tested devices and/or programs:
Intel's Media Control Point and Media Renderer
D-Link DSM-520

The Intel tools are good for testing and are available at:
http://www.intel.com/cd/ids/developer/asmo-na/eng/downloads/upnp/index.htm

Either make a directory media and put the files there, or make a symlink
named media to your media files. Either will work. Run it as:
./pymediaserv <localip> [ <http server port> ]

Good Luck!

John-Mark Gurney <gurney_j@resnet.uoregon.edu>

Ideas for future improvements:
Understand ZIP files, so you can view images and listen to mp3s
in the zip file. (ZipFile is there.)
Possibly switch how the HTTP media server behaves, and instead
of using static.File, have each object present a Contents
function or something similar, to make understanding ZIP files
easier.
Autodetect IP address.
Support sorting by other attributes.

v0.2:
No longer require restarting to see new files/dirs in hierarchy.
Add FSStorage which is a set of classes for handling filesystem
objects, also handles updateID's.
Make the root container customizable, so you don't end up with
a single entry (like media) at the root. This lets us use a
FSDirectory as the root and get auto-enumeration
Support returning custom error codes, so that we can return 701
No such object among others.
Support deleting items, so we can remove them when no longer on
the file system.
Make Containers a subclass of list. This lets use populate
childCount properly.
Add required attributes to Storage* classes.
Support custom container classes to addContainer.
Add a few more custom mime-types.
Sort listings by name for now.

v0.1:
Don't bind the UDP socket to the multicast address, so replies
go out on our local IP.
Send out notify requests when we register the services with SSDP.
Send out byebye notifications when we are shutting down.
Randomize the UUID for the server (this should be part of the
saved state).
Randomize the port, or optionally set it on the command line.
Teach ContentDirectory.py the basics on handling Containers and
generic browse support. You can addItem and addContainer, which
each return either respective ObjectID.
We already support partial chunking of responses, but we don't yet
support filtering or sorting.