Created
May 20, 2013 03:48
-
-
Save blha303/5610323 to your computer and use it in GitHub Desktop.
MiniDLNA status checker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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