Skip to content

Instantly share code, notes, and snippets.

@Gregwar
Created January 21, 2024 17:51
Show Gist options
  • Select an option

  • Save Gregwar/b8760f7893e5f3988222cc703165370b to your computer and use it in GitHub Desktop.

Select an option

Save Gregwar/b8760f7893e5f3988222cc703165370b to your computer and use it in GitHub Desktop.
Play URL to Kodi
# 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)
@Gregwar
Copy link
Author

Gregwar commented Jan 21, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment