Steven Smith revised this gist . Go to revision
1 file changed, 22 insertions
checkminidlna.py(file created)
| @@ -0,0 +1,22 @@ | |||
| 1 | + | #!/usr/bin/python2.7 | |
| 2 | + | import urllib | |
| 3 | + | ||
| 4 | + | def getInfo(): | |
| 5 | + | audio, video, image = urllib.urlopen("http://localhost:8200").read()[111:-22].split("<br>") | |
| 6 | + | audiod = audio.split(" files: ") | |
| 7 | + | videod = video.split(" files: ") | |
| 8 | + | imaged = image.split(" files: ") | |
| 9 | + | info = {audiod[0]: int(audiod[1]), | |
| 10 | + | videod[0]: int(videod[1]), | |
| 11 | + | imaged[0]: int(imaged[1])} | |
| 12 | + | return info | |
| 13 | + | ||
| 14 | + | def main(): | |
| 15 | + | info = getinfo() | |
| 16 | + | print "MiniDLNA status" | |
| 17 | + | print "Audio files:", str(info["Audio"]) | |
| 18 | + | print "Video files:", str(info["Video"]) | |
| 19 | + | print "Image files:", str(info["Image"]) | |
| 20 | + | ||
| 21 | + | if __name__ == "__main__": | |
| 22 | + | main() | |
Newer
Older