INTERACT FORUM
More => Old Versions => JRiver Media Center 25 for Windows => Topic started by: DrKNo on March 28, 2019, 07:38:36 pm
-
A while ago I posted here with the intent of gauging interest in a python Wrapper for MCWS. I finally got my code together and uploaded it. May I present: pyMCWS! It is written for python 3 and depends on the requests library only. The aim is to allow fast and easy development while preserving the power of the API. The easiest way to use it is using recipes, simplified versions of the API calls:
pip install pymcws
import pymcws as mcws
from pymcws import MediaServer
office = MediaServer("MyAccessKey", "username", "supersecretpassword")
# Play an album using a play recipe
mcws.play_album(office, "Ludovico Einaudi", "I Giorni")
If you need more power, the original MCWS API is wrapped for python too — looking at the API documentation provided by JRiver should be enough to use pyMCWS it in most instances:
mcws.files_search(office, query='my Query', action='play', use_play_doctor=True, shuffle=False)
Find the code here:
https://github.com/kenomaerz/pymcws — see example.py for usage examples.
The current version on PyPi is listed as 0.0.1, an early proof of concept. What works right now is:
- Resolution of Access Keys, on the local network
- Playback commands (Stop, pause, etc)
- Playing Files via queries
- Retrieving zones from server
- Specifying target zones for commands[\li]
Have fun poking around with it, and let me know if you need a specific functionality, I'll see to implementing it. Help is also wildly appreciated, so feel free to create a pull request. Please also post the inevitable bugs that you encounter. I'm sure there's a lot to improve.
-
Starred! Can't wait to try it out
-
Thanks.
Have you ever heard about MCUtils? https://yabb.jriver.com/interact/index.php?topic=100449.0
It's a similar project, developped in perl, with tons of very useful functionality added year after year.
The project is ongoing and completely alive: see the attached instructions.
-
Nice Thanks!
-
Have you ever heard about MCUtils?
I have not, in fact. Thanks a lot for pointing me to the project! After a cursory glance I am sure that there are lot of concepts and reference points that will be useful to me.
-
I decided to continue maintaining pymcws. The official thread is now in the third party forum, where it will be kept up to date:
https://yabb.jriver.com/interact/index.php/topic,123397.0.html (https://yabb.jriver.com/interact/index.php/topic,123397.0.html)
-
I am super excited to see this. I am going to a coding bootcamp in March that focuses on Python, I have a feeling this is going to come in very handy.
-
Awesome! Let me know your thoughts and please be bold and contribute code :) It is early enough to change the API if we feel there are better ways of doing things after all.