Help regarding kodi api
#1
Exclamation 
so basically i am building a kodi remote based on arduino which has ir receivers , thats all fine but i cant figure out
How to use requests to use kodi's api

please can anyone share little syntax because documentation is just confusing to me
maybe because i am not so good in python thats why

i previously maded a Esp based remote (github.com/sudo-Mystic/EspBasedKodiRemote )but as now i need python based one so thats not help

TLDR - i need little python syntax with request to use kodi api (send anything like volume down)

apologies for english Smile
Reply
#2
I think I got what your wanted.
send.py

Code:
#!/usr/bin/env python3
import requests
from requests.auth import HTTPBasicAuth

auth= HTTPBasicAuth('kodi', 'kodi')

resutl = requests.post(\
    "http://127.0.0.1:8080/jsonrpc",\
     data=\
     '{"jsonrpc": "2.0", "id": 1,\
     "method": "Input.ButtonEvent",\
     "params": {"button": "play_pause", "keymap": "KB"}}',\
     auth = auth)

print(resutl)
print(resutl.text)
Reply

Logout Mark Read Team Forum Stats Members Help
Help regarding kodi api0