Created
January 21, 2024 17:51
-
-
Save Gregwar/b8760f7893e5f3988222cc703165370b to your computer and use it in GitHub Desktop.
Play URL to Kodi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Can be use to send an url (e.g: http://.../movie.mp4) to your Kodi media center | |
| # You have to enable HTTP control (without password) | |
| # This can be used on an Android Phone with pyDroid (don't forget to pip install requests) | |
| import requests | |
| # Kodi IP address | |
| kodi = "192.168.1.34" | |
| url = input("Enter URL: ") | |
| # Sending the request | |
| payload = {"jsonrpc": "2.0", "id": 1, "method": "Player.Open", "params": {"item": {"file": url}}} | |
| requests.post(f"http://{kodi}/jsonrpc", json=payload) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A simple Python script to send an URL (e.g movie) to a Kodi media center. Can be used as a hacky solution from an Android phone and pyDroid for example