-
-
Save bonelifer/0bdad8136c900cdba672c172e7268ed5 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment