|
12345678910111213141516171819202122232425262728 |
- #!/usr/bin/env python3
-
- import mpd
- import os
- from urllib.parse import urlparse
- import getpass
-
- # get current user
- print(getpass.getuser())
-
- client = mpd.MPDClient()
- client.connect("localhost", 6600)
-
- for entry in client.lsinfo("/"):
- print("%s" % entry)
- for key, value in client.status().items():
- print("%s: %s" % (key, value))
-
- print(client.currentsong())
- # print(client.config())
-
- # p = urlparse('file:///home/pi/discobert/music/1/')
- p = urlparse('1/')
- finalPath = os.path.abspath(os.path.join(p.netloc, p.path))
-
- client.lsinfo('file:///var/local/music/')
- # client.add(p)
- client.play(0)
|