Skip to content

Instantly share code, notes, and snippets.

@blha303
Created May 20, 2013 03:48
Show Gist options
  • Save blha303/5610323 to your computer and use it in GitHub Desktop.
Save blha303/5610323 to your computer and use it in GitHub Desktop.
MiniDLNA status checker
#!/usr/bin/python2.7
import urllib
def getInfo():
audio, video, image = urllib.urlopen("http://localhost:8200").read()[111:-22].split("<br>")
audiod = audio.split(" files: ")
videod = video.split(" files: ")
imaged = image.split(" files: ")
info = {audiod[0]: int(audiod[1]),
videod[0]: int(videod[1]),
imaged[0]: int(imaged[1])}
return info
def main():
info = getinfo()
print "MiniDLNA status"
print "Audio files:", str(info["Audio"])
print "Video files:", str(info["Video"])
print "Image files:", str(info["Image"])
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment