<commit_before># https://kodi.wiki/view/JSON-RPC_API
# https://kodi.wiki/view/JSON-RPC_API/v12

# Set hostname in .env file (syntax: baseurl=http://...)
@baseurl = {{$dotenv baseurl}}
@active_playerid = 1

### Ping
POST {{baseurl}}

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "JSONRPC.Ping"
}

### GetActivePlayers
POST {{baseurl}}

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "Player.GetActivePlayers"
}

### Get Properties
POST {{baseurl}}

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "Player.GetProperties",
    "params": {
      "playerid": {{active_playerid}},
      "properties": ["playlistid", "position", "percentage", "time", "totaltime", "speed"]
    }
}

### Info
POST {{baseurl}}

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "Player.GetItem",
    "params": {
      "playerid": {{active_playerid}},
      "properties": ["title", "file", "runtime", "starttime", "endtime", "thumbnail"]
    }
}

### Play/Pause
POST {{baseurl}}

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "Player.PlayPause",
    "params": {
        "playerid": {{active_playerid}}
    }
}

### Mute
POST {{baseurl}}

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "Application.SetMute",
    "params": {
        "mute": "toggle"
    }
}

### Seek
POST {{baseurl}}

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "Player.Seek",
  "params": {
    "playerid": {{{active_playerid}},
    "value": {
      "hours": 0,
      "minutes": 0,
      "seconds": 30
    }
  }
}

### Play URL
POST {{baseurl}}

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "Player.open",
  "params": {
    "item": {
      "file": "{http://URL-HERE}"
    }
  }
}

### Play Youtube
POST {{baseurl}}

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "Player.Open",
  "params": {
    "item": {
      "file": "plugin://plugin.video.youtube/?action=play_video&videoid={VIDEOID}"
    }
  }
}

### Play URL and seek
POST {{baseurl}}


{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "Player.Open",
    "params": {
        "item": {
            "file": "plugin://plugin.video.youtube/?action=play_video&videoid={VIDEOID}"
        },
        "options": {
            "resume": {
                "hours": 0,
                "minutes": 0,
                "seconds": 30
            }
        }
    }
}<commit_msg>Improve requests<commit_after># https://kodi.wiki/view/JSON-RPC_API
# https://kodi.wiki/view/JSON-RPC_API/v12

# id: An identifier established by the Client that MUST contain a String, Number, or NULL value if included.
# If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers
# SHOULD NOT contain fractional parts.

# Set hostname in .env file (syntax: baseurl=http://...)
@baseurl = {{$dotenv baseurl}}
@active_playerid = 1

### Ping
POST {{baseurl}}

{
    "id": "{{$guid}}",
    "jsonrpc": "2.0",
    "method": "JSONRPC.Ping"
}

### GetActivePlayers
POST {{baseurl}}

{
    "id": "{{$guid}}",
    "jsonrpc": "2.0",
    "method": "Player.GetActivePlayers"
}

### Get Properties
POST {{baseurl}}

{
    "id": "{{$guid}}",
    "jsonrpc": "2.0",
    "method": "Player.GetProperties",
    "params": {
      "playerid": {{active_playerid}},
      "properties": ["playlistid", "position", "percentage", "time", "totaltime", "speed"]
    }
}

### Info
POST {{baseurl}}

{
    "id": "{{$guid}}",
    "jsonrpc": "2.0",
    "method": "Player.GetItem",
    "params": {
      "playerid": {{active_playerid}},
      "properties": ["title", "file", "runtime", "starttime", "endtime", "thumbnail"]
    }
}

### Play/Pause
POST {{baseurl}}

{
    "id": "{{$guid}}",
    "jsonrpc": "2.0",
    "method": "Player.PlayPause",
    "params": {
        "playerid": {{active_playerid}}
    }
}

### Mute
POST {{baseurl}}

{
    "id": "{{$guid}}",
    "jsonrpc": "2.0",
    "method": "Application.SetMute",
    "params": {
        "mute": "toggle"
    }
}

### Seek
POST {{baseurl}}

{
  "id": "{{$guid}}",
  "jsonrpc": "2.0",
  "method": "Player.Seek",
  "params": {
    "playerid": {{{active_playerid}},
    "value": {
      "hours": 0,
      "minutes": 0,
      "seconds": 30
    }
  }
}

### Play URL
POST {{baseurl}}

{
  "id": "{{$guid}}",
  "jsonrpc": "2.0",
  "method": "Player.open",
  "params": {
    "item": {
      "file": "{http://URL-HERE}"
    }
  }
}

### Play Youtube
POST {{baseurl}}

{
  "id": "{{$guid}}",
  "jsonrpc": "2.0",
  "method": "Player.Open",
  "params": {
    "item": {
      "file": "plugin://plugin.video.youtube/?action=play_video&videoid={VIDEOID}"
    }
  }
}

### Play URL and seek
POST {{baseurl}}


{
    "id": "{{$guid}}",
    "jsonrpc": "2.0",
    "method": "Player.Open",
    "params": {
        "item": {
            "file": "plugin://plugin.video.youtube/?action=play_video&videoid={VIDEOID}"
        },
        "options": {
            "resume": {
                "hours": 0,
                "minutes": 0,
                "seconds": 30
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.23112824675324675, 'fraction_numerical': 0.014813311688311688, 'mean_word_length': 2.53080229226361, 'pattern_counts': {'":': 120, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1842629', 'n_tokens_mistral': 1931, 'n_tokens_neox': 1869, 'n_words': 380}