Author Topic: Kodi Live TV Help  (Read 6052 times)

0 Members and 1 Guest are viewing this topic.

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Kodi Live TV Help
« on: January 07, 2016, 07:20:50 PM »
Ok so i get the payload of the live tv PVR.

<payload>
        <value>18</value>
        <phrase>HD Кино</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>

Ok so i am always having a problem because the service i use always moves the channels around to different server or what ever. The name of the channels are always the same. I mean always. Any way to make something that will i guess rename the phrase?

Example

if phrase HD Кино change to B two (HD Кино)

So like regenerate the livetv payload?

Maybe adding something to xsql option.xml
<genXmlParam useSubStrings="true" xmlFilename="xbmcTvChannels" queryString="select idChannel, sChannelName from channels where bIsRadio=0" dataType="TV"/>
« Last Edit: January 07, 2016, 07:35:40 PM by eugekiller »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi Live TV Help
« Reply #1 on: January 07, 2016, 09:14:22 PM »
I think you just need to Generate XML whenever your TV channels change in Kodi.

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Re: Kodi Live TV Help
« Reply #2 on: January 07, 2016, 11:28:52 PM »
Hi James. By the way thanks before now getting the hang of this thing. ITS FREAKING GREAT!!!!!!!!!!

Ok so i use a service provider for live tv. But each channels address always changing. But the channel names are the same. Most channels are in Russian :(. So Vox cant dual language.

So i wanted to change the channel name in the payload for live tv. But the problem is i also have to refresh the payload every time and then find the channels again and change there names.

ok so i get a web address from this provider. In that address is hundreds of channels. Each channels is directed to its own site. Some times they remove a channel if its not working which messes the whole payload up. :(
to top it all off the channel names are in Russian or half in half. So i wanted to rename certain channels when the payload gets generated.

I hope i explained it where you could understand it.
Or Any ideas or solutions one might have?

« Last Edit: January 07, 2016, 11:48:41 PM by eugekiller »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi Live TV Help
« Reply #3 on: January 08, 2016, 08:27:49 AM »
Can you send us the example TV channel payload XML file before and after it has been changed because of updates to the services?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Kodi Live TV Help
« Reply #4 on: January 08, 2016, 08:29:36 AM »
You haven't told us anything about what service or addon you are using. Is it possible that you can rename channels in Kodi.
« Last Edit: January 08, 2016, 09:11:46 AM by jitterjames »

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Re: Kodi Live TV Help
« Reply #5 on: January 08, 2016, 09:52:39 AM »
Ok will show you a brief explanation lol. :)

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<!--Payload for XBMC data.-->
<PayloadsRoot>
    <payload>
        <value>1</value>
        <phrase>Pro Все</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>2</value>
        <phrase>Premier Sports</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>3</value>
        <phrase>MGM HD</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>4</value>
        <phrase>Shop 24</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>5</value>
        <phrase>Усадьба</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>6</value>
        <phrase>1+1</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>7</value>
        <phrase>43 Канал HD</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>8</value>
        <phrase>Ля-минор</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>9</value>
        <phrase>Индия</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>10</value>
        <phrase>Eska TV</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>11</value>
        <phrase>Russian Travel Guide</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>12</value>
        <phrase>Спорт 1 HD</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>

foe example this is the payload at 9am. Then by 6pm the payload can look like this

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<!--Payload for XBMC data.-->
<PayloadsRoot>
    <payload>
        <value>1</value>
        <phrase>Pro Все</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>2</value>
        <phrase>Premier Sports</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>3</value>
        <phrase>MGM HD</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>4</value>
        <phrase>Усадьба</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>5</value>
        <phrase>1+1</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>6</value>
        <phrase>43 Канал HD</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>7</value>
        <phrase>Ля-минор</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>8</value>
        <phrase>Индия</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
     <payload>
        <value>9</value>
        <phrase>Russian Travel Guide</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>10</value>
        <phrase>Спорт 1 HD</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>
    <payload>
        <value>11</value>
        <phrase>Shop 24</phrase>
        <subsetmatching>true</subsetmatching>
    </payload>

This is the code i use that you gave me to control live tv.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<commandGroup open="True" name="Kodi Live TV" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="711" name="Switch to channel {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.Open</param>
        <param>"item" : {"channelid" : {1}}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Switch to, Go to, Start</phrase>
    <phrase>Channel</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\xbmcTvChannels.xml</payloadFromXML>
  </command>
</commandGroup>

So i did go in to the payload and renamed the chanels saved the payload.
Example: Eska TV would name it B One (Eska TV)

Then when i say B One it would go to B One (Eska TV) and then 4 hour later when i say B One (Eska TV) it would go to Спорт 1 HD. I hope that explained it.

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Re: Kodi Live TV Help
« Reply #6 on: January 08, 2016, 10:03:48 AM »
So what i was thinking if its possible.

Tell VOX reload live tv payload.
It would generate new payload of the live tv from kodi.
then it would clean the payload up and generate a new livetv payload,

so it would take
chanel5 and rename it to b6
chanle 10 and rename it to b5
chanle 60 and rename it to b4

and so on. And your script that uses the original payload redirect it to use the changed payload.
(or some how when it generates the original payload to edit the names right away.)

I dont believe i can edit them in kodi but i might but ether way i dont believe it would solve the problem since all the channel values always change.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi Live TV Help
« Reply #7 on: January 08, 2016, 11:07:12 AM »
First, just generally speaking: it's important in VoxCommando to use the editor tools provided in order to edit commands and payloads.

You should not be opening  payload XML files or your command XML in a text editor in order to edit the XML, if that's what you are doing. (I don't know if you are, but it seems like you might be based on your posts.)

These tools are also a more friendly way to view commands and payload XML files than a text editor.

The payload XML editor can be accessed in VoxCommando's File menu, or directly within the Command Tree Editor, by clicking on any payload XML that is already assigned to a command.

Second:

It's actually not such a big problem.

Use the Payload XML Editor to create a new payload XML file, where the Russian channel name is the value and its equivalent English channel name is the phrase. Save the file in your payloads folder, as "Channel_translations.xml" (see the example file that I've attached to this post).

Then replace the Kodi Live TV channel command that James provided the other day with the following:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<commandGroup open="True" name="Kodi Live TV" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="711" name="Switch to channel {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>PayloadXML.GetValue</cmdType>
      <params>
        <param>XbmcPayloads\xbmcTvChannels.xml</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.Open</param>
        <param>"item" : {"channelid" : {LastResult}}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Switch to, Go to, Start</phrase>
    <phrase>Channel</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\Channel_translations.xml</payloadFromXML>
  </command>
</commandGroup>


Now you can regularly generate the Kodi XML for the "xbmcTvChannels.xml" so that the channel IDs are updated as needed. As long as the Russian channel names don't change, then all this revised command does is:

1. Based on the English channel name you ask for, it will look up the Russian equivalent in your Channel_translations payload XML file.

2. It will then use the Russian channel name to look up the appropriate channel ID value in the xbmcTvChannels.xml file (which you can keep updating as needed).

3. This ID value becomes the {LastResult} that is passed to the Kodi action that navigates to the appropriate channel.
« Last Edit: January 08, 2016, 12:12:24 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Re: Kodi Live TV Help
« Reply #8 on: January 08, 2016, 03:44:31 PM »
Thak You So Much worked like a charm :).

Quick question any way to generate xml payload from xbmc by voice command? and to do a hard restart?
« Last Edit: January 08, 2016, 03:51:26 PM by eugekiller »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi Live TV Help
« Reply #9 on: January 08, 2016, 04:31:30 PM »
If you installed one of the standard Kodi configurations in VC, you already have a "Generate XML" voice command.

That default command may use the xJson plugin gen xml action. You should probably replace that one action in the command with the equivalent xSql plugin action.

Instead of posting questions about basic functionality on the forum, you should review all the available actions either in the wiki or in VC's action selection tree.

And also review all the commands in your command tree.

That's generally the best way to get familiar with the many things you can do in VC.

Forum support is really for questions that go beyond the basic information already covered thoroughly in the tutorials and the wiki.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Re: Kodi Live TV Help
« Reply #10 on: January 08, 2016, 05:08:33 PM »
Thank you Again.

I was afraid to mess with it since i didnt know what it did exactly. But i got it Thank you again and i am sorry for beeing a pain.

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Re: Kodi Live TV Help
« Reply #11 on: January 09, 2016, 11:46:25 AM »
One more question anyway i can add switch to next channel?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi Live TV Help
« Reply #12 on: January 09, 2016, 12:29:57 PM »
What does "next channel" mean in this context?

Kodi's channels are loaded based on the ID they are assigned in the TV database. These don't necessarily relate to their order in the "real" TV world.

As you noted yesterday, the channels change their IDs regularly in the service you use.

There might be another column in the TV database that corresponds to the real-word channel number, and possibly that could be used instead of the channel ID to pick a channel. But as I don't get TV here, I have no way to figure out what the right column label would be.

Maybe other users here can look into it.

For now though:

I can't test these, but you could play around with displaying the TV guide and channel list views in Kodi, and then navigate to different channels on that list using the standard navigation commands "go up"/"go down" & "select" etc.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<commandGroup open="True" name="Kodi Live TV guide" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="115" name="Show T V Guide" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>GUI.ActivateWindow</param>
        <param>"window" : "tvguide"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Show TV Guide</phrase>
  </command>
  <command id="117" name="List TV channels" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>GUI.ActivateWindow</param>
        <param>"window" : "tvchannels"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>List TV channels</phrase>
  </command>
</commandGroup>

I used the list of Kodi window names here: http://kodi.wiki/view/Window_IDs, to create the two commands.

I'm not sure exactly what the difference is between a TV Guide and a TV Channel list, but you can experiment with these and other window names identified on that web page.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

eugekiller

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 0
    • View Profile
Re: Kodi Live TV Help
« Reply #13 on: January 09, 2016, 02:15:51 PM »
Ok so this is what i have

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.9-->
<command id="711" name="Switch to channel {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>PayloadXML.GetValue</cmdType>
    <params>
      <param>XbmcPayloads\xbmcTvChannels.xml</param>
      <param>{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.Open</param>
      <param>"item" : {"channelid" : {LastResult}}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Switch to, Go to, Start</phrase>
  <phrase>Channel</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\Channel_translations.xml</payloadFromXML>
</command>

The payload that it uses doesnt have value so looks like this.

Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>

<!--A VoxCommando Payload file-->

-<PayloadsRoot>


-<payload>

<value>Первый канал HD</value>

<phrase>B One</phrase>

</payload>


-<payload>

<value>Первый канал (Европа)</value>

<phrase>B Two</phrase>

</payload>


-<payload>

<value>Первый канал</value>

<phrase>B Three</phrase>

</payload>


-<payload>

<value>Первый канал (+6)</value>

<phrase>B Four</phrase>

</payload>

so it would have to jump from payload to payload since there is no values is that possible?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Kodi Live TV Help
« Reply #14 on: January 09, 2016, 02:56:11 PM »
Do you care what channel you go to, when you ask for the "next channel," or do you just want to be able to switch TV channels?

If you don't care about the channel order, but just want to change channels (browse channels), then I think this will work.

I can't really test it.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<command id="753" name="Next channel" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>PayloadXML.GetRandomP</cmdType>
    <params>
      <param>XbmcPayloads\xbmcTvChannels.xml</param>
      <param>2</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="True">
    <ifType>(A)==(B)</ifType>
    <ifParams>{Match.1}&amp;&amp;{var.channel}</ifParams>
    <then>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>Switching to channel: {Match.1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>PayloadXML.GetValue</cmdType>
        <params>
          <param>XbmcPayloads\xbmcTvChannels.xml</param>
          <param>{Match.1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>XJson.Raw</cmdType>
        <params>
          <param>Player.Open</param>
          <param>"item" : {"channelid" : {LastResult}}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>channel</param>
          <param>{Match.1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>Switching to channel: {Match.2}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>PayloadXML.GetValue</cmdType>
        <params>
          <param>XbmcPayloads\xbmcTvChannels.xml</param>
          <param>{Match.2}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>XJson.Raw</cmdType>
        <params>
          <param>Player.Open</param>
          <param>"item" : {"channelid" : {LastResult}}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>channel</param>
          <param>{Match.2}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>Next channel</phrase>
</command>
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)