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.

29 lines
596 B

  1. #!/usr/bin/env python3
  2. import mpd
  3. import os
  4. from urllib.parse import urlparse
  5. import getpass
  6. # get current user
  7. print(getpass.getuser())
  8. client = mpd.MPDClient()
  9. client.connect("localhost", 6600)
  10. for entry in client.lsinfo("/"):
  11. print("%s" % entry)
  12. for key, value in client.status().items():
  13. print("%s: %s" % (key, value))
  14. print(client.currentsong())
  15. # print(client.config())
  16. # p = urlparse('file:///home/pi/discobert/music/1/')
  17. p = urlparse('1/')
  18. finalPath = os.path.abspath(os.path.join(p.netloc, p.path))
  19. client.lsinfo('file:///var/local/music/')
  20. # client.add(p)
  21. client.play(0)