Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. def media_player(self, command):
  2. if command == "**list_radio**":
  3. if len(os.listdir(self.radio_dir)) == 0:
  4. self.send_message("[-] Raadiofaile pole lisatud.")
  5. else:
  6. self.senddef media_player(self, command):
  7. if command == "**list_radio**":
  8. if len(os.listdir(self.radio_dir)) == 0:
  9. self.send_message("[-] Raadiofaile pole lisatud.")
  10. else:
  11. self.send_message("Raadiokanalid:")
  12. [self.send_message("!{}".format(os.path.splitext(os.path.basename(i))[0]))
  13. for i in os.listdir(self.radio_dir)]
  14. elif command == "**stop**":
  15. if Utilities.is_processs_active("vlc"):
  16. os.popen("killall vlc &")
  17. else:
  18. pass
  19. else:
  20. if command.endswith(".pls"):
  21. os.popen("cvlc --vout none {}{} &".format(self.radio_dir, command))
  22. else:
  23. os.popen("cvlc --vout none {} &".format(command))_message("Raadiokanalid:")
  24. [self.send_message("!{}".format(os.path.splitext(os.path.basename(i))[0]))
  25. for i in os.listdir(self.radio_dir)]
  26. elif command == "**stop**":
  27. if Utilities.is_processs_active("vlc"):
  28. os.popen("killall vlc &")
  29. else:
  30. pass
  31. else:
  32. if command.endswith(".pls"):
  33. os.popen("cvlc --vout none {}{} &".format(self.radio_dir, command))
  34. else:
  35. os.popen("cvlc --vout none {} &".format(command))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement