VoxCommando

Help and Support (Using VoxCommando) => Kodi (XBMC) Frodo / Gotham / Isengard / Jarvis => Topic started by: Mace on May 21, 2013, 06:24:47 AM

Title: XBMC + Live TV + VoxCommando
Post by: Mace on May 21, 2013, 06:24:47 AM
Here is a guide for using the live TV function in XBMC Frodo.

<a href="
">See this video for installing VoxCommando with XBMC Frodo.[/url]

Step 1:- Making a TV Payloads.xml file: If you have run the Xsql plug-in correctly then you already have an xbmcTvChannel.xml file in ?XbmcPayloads? folder. Go to Step 2.
If not then from VC window select Plugins then select Xsql
Export XML to Folder: .\\XbmcPayloads (or where ever you choose to save this file, adjust the command to point to it.)

In the OutPut (XML payload files) section add this:
Type: TV
Query: select idChannel, sChannelName from channels where bIsRadio=0
Filename: xbmcTvChannels
Sub: tick

Click Save and Generate

Step 2: Making the commands ? (copy this command to your command tree)

Code: [Select]
<command id="711" name="Live TV Channel" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <cmdString>Player.Open&amp;&amp;"item" : {"channelid" : {1}}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <cmdString>GUI.ShowNotification&amp;&amp;"title" : "{LastSpoken}" , "message" : ""</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase optional="true">Switch to, Play</phrase>
  <phrase>Channel</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone">XbmcPayloads\xbmcTvChannels.xml</payloadFromXML>
</command>

and you're done!

Should look like this:
(https://dl.dropboxusercontent.com/u/67860660/VoxCommando/LiveTV.PNG)

Here's some optional extras for getting the program guide up: -

This one is for the PVR window Program Guide:

Code: [Select]
<command id="1511" name="PVR Screen" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>XJson.ExecBuiltin</cmdType>
                <cmdString>ActivateWindowAndFocus(mypvr, 31,0, 10,0)</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>Program Guide</phrase>
        </command>

In the PVR window:
(https://dl.dropboxusercontent.com/u/67860660/VoxCommando/PGpvrcmd.PNG)
(https://dl.dropboxusercontent.com/u/67860660/VoxCommando/PGpvr.PNG)

And this one shows a Program Guide on-screen while watching tv:

Code: [Select]
<command id="1465" name="EPG On Screen" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <cmdString>GUI.ActivateWindow&amp;&amp;"window" : "pvrosdchannels"</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Program Guide On Screen</phrase>
</command>

On Screen:
(https://dl.dropboxusercontent.com/u/67860660/VoxCommando/PGpvrScrnCmd.PNG)
(https://dl.dropboxusercontent.com/u/67860660/VoxCommando/PGonscreen.PNG)

Command Group File attached if you wish to install as group.

Update: 03/03/2015
Here's a couple updates to better suit the new kodi api.

for TvGuide:
Change - (https://dl.dropboxusercontent.com/u/67860660/VoxCommando/PGpvrScrnCmd.PNG)
      to -> (https://dl.dropboxusercontent.com/u/67860660/VoxCommando/koditvguide.PNG)

for TvGuide on Screen:-
Change - (https://dl.dropboxusercontent.com/u/67860660/VoxCommando/PGpvrScrnCmd.PNG)
      to -> (https://dl.dropboxusercontent.com/u/67860660/VoxCommando/koditvguideonscreen.PNG)

Can also add a new Command to go to the Live TV channel list:
               (https://dl.dropboxusercontent.com/u/67860660/VoxCommando/kodilivetvwindow.PNG)
Title: Re: XBMC + Live TV + VoxCommando
Post by: Kalle on May 21, 2013, 06:50:56 AM
Wow, great job  ::bow :clap
Title: Re: XBMC + Live TV + VoxCommando
Post by: Mace on May 21, 2013, 06:58:03 AM
Do what i can to help.
Title: Re: XBMC + Live TV + VoxCommando
Post by: maxwel on October 13, 2013, 08:02:14 AM
Can someone help me please i can't find any xbmctvchannel.xml ? thank you
Title: Re: XBMC + Live TV + VoxCommando
Post by: nime5ter on October 13, 2013, 08:46:14 AM
Hi maxwel,

See Mace's step 1.
Here is a guide for using the live TV function in XBMC Frodo. <a href="
">See this video for installing VoxCommando with XBMC Frodo.[/url]

Step 1:- Making a TV Payloads.xml file: If you have run the Xsql plug-in correctly then you already have an xbmcTvChannel.xml file in ‘XbmcPayloads’ folder. Go to Step 2.
If not then from VC window select Plugins then select Xsql
Export XML to Folder: .\\XbmcPayloads (or where ever you choose to save this file, adjust the command to point to it.)

In the OutPut (XML payload files) section add this:
Type: TV
Query: select idChannel, sChannelName from channels where bIsRadio=0
Filename: xbmcTvChannels
Sub: tick

Click Save and Generate
Title: Re: XBMC + Live TV + VoxCommando
Post by: maxwel on October 13, 2013, 10:16:08 AM
Thank for your quick response nime5ter. I really appreciate your time.

I have done  that step 1 but i can´t find any xbmcTvChannel.xml file in ‘XbmcPayloads´ What am I doing wrong? Xsql plug is activer
Title: Re: XBMC + Live TV + VoxCommando
Post by: jitterjames on October 13, 2013, 10:46:37 AM
Follow ALL the directions provided by Mace, and then reposted by Nime5ter.

If all you did was activate the plugin then that was not enough.  All the steps are there you just need to follow them.
Title: Re: XBMC + Live TV + VoxCommando
Post by: jitterjames on October 13, 2013, 10:53:13 AM
I hope this is a bit easier to follow.  It is basically the same instructions as given above, but hopefully clearer and more precise for you.

1) go to options and enable the xSql plugin
2) restart VC
3) go to plugin settings for xSql plugin
4) verify that the path labeled "Export XML to Folder" is correctly set to the default value of: .\XbmcPayloads
5) verify that the table contains a row which reads
Code: [Select]
TV    select idChannel, sChannelName from channels where bIsRadio=0      xbmcTvChannels6) select Sub if you want to be able to save only part of the episode name, otherwise leave it unchecked.
7) click "Save and Generate" button.

Once all this is done, you can always perform an update form the main VC window by clicking:
GenXML   >>   XBMC Frodo  >>   xSQL
Title: Re: XBMC + Live TV + VoxCommando
Post by: jitterjames on October 13, 2013, 11:08:02 AM
please note there was an error in my code block above.  I corrected it.

If you don't have this line already you need to create one.
Title: Re: XBMC + Live TV + VoxCommando
Post by: maxwel on October 13, 2013, 03:03:13 PM
Thanks you James for reply .. I'm using the old version of vox that was the problem I think so I am going to update now.
Title: Re: XBMC + Live TV + VoxCommando
Post by: philby85 on January 05, 2014, 02:37:54 AM
Hi Everyone,

Newbie here please be gentle lol. I followed the instructions set everything up and imported the xml. The phrase, "program guide on screen" works for me my while watching live tv. The "program guide" phrase which I am using from the xvmc home screen does not show the the guide. In the top right hand corner displays the text program guide with a circle next to it with and an i in it. The TTS announces program guide. This disappears after a few seconds. My pvr backend is Nextpvr which is all working fine. I am using vc 1.1.8.3. Thanks for a wonderful program and great contributors.

cheers

Phil
Title: Re: XBMC + Live TV + VoxCommando
Post by: Kalle on January 05, 2014, 03:45:39 AM
Hi philby85 and welcome to VC forum.
Did you VC setup with XBMC Eden or Frodo commands? Did you installed the VoxTools-addon in XBMC? Work all other commands for xbmc?
If not, please take a look here http://voxcommando.com/forum/index.php?topic=1073.0 (http://voxcommando.com/forum/index.php?topic=1073.0)

Let us know if this has your problem solved.
Title: Re: XBMC + Live TV + VoxCommando
Post by: philby85 on January 05, 2014, 07:42:04 AM
Hi Kalle,

Thanks for your reply, I have enjoyed your videos. I have setup for frodo. the vox add-on for xbmc is installed. All other commands work so far.

kind regards

Phil
Title: Re: XBMC + Live TV + VoxCommando
Post by: philby85 on January 05, 2014, 08:01:31 AM
Hi Kalle,

I checked my xbmc and although the repo for fox was there the add-on wasn't showing anywhere. So I refreshed the repository and installed and now all working. Thanks for the tip very much appreciate your time.

regards

Phil
Title: Re: XBMC + Live TV + VoxCommando
Post by: Kalle on January 05, 2014, 09:08:18 AM
No problem, thanks for your report  ;)
Title: Re: XBMC + Live TV + VoxCommando
Post by: jitterjames on January 05, 2014, 09:52:33 AM
Problem solved while I slept. I'm glad Kalle is back at his station!  :D

Welcome Philby85.
Title: Re: XBMC + Live TV + VoxCommando
Post by: maxwel on February 05, 2014, 04:05:48 PM
Hi everyone.

i am wondering if it is possible to make VC to say what is now playing on live tv or what tv show is coming next!

thanks for any reply
Title: Re: XBMC + Live TV + VoxCommando
Post by: Kalle on February 05, 2014, 06:15:18 PM
Yes it is possible and I think in different ways. I have done such a command with the Robo browser plugin in VC, which open a programm guide in the robo browser (hidden) and scrape the data from it.
I can post the command group, but all commands and also the TV guide is in german ::)
There is also a command integrated to ask VC which TV show is running on a specific time - only probem, this take some seconds before you get the result.
Title: Re: XBMC + Live TV + VoxCommando
Post by: jitterjames on February 05, 2014, 06:39:18 PM
"what movie is this" should work to tell you what is playing except that it will try to tell you the cast as well so I don't know if that would work with live TV.

Here is a "What am I watching" command you can try that tells you the title of the now playing item:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="517" name="What am I watching" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <cmdString>Player.GetItem&amp;&amp;"playerid":1,  "properties": ["title"]</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.ParseTokens</cmdType>
    <cmdString>Now playing {item.title}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.SoftMute</cmdType>
    <cmdString>60</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.SpeakSync</cmdType>
    <cmdString>{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.SoftUnMute</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>What am I watching</phrase>
</command>

I have no idea how you would do it for "what is playing next".  It will probably vary depending on your pvr back-end etc. and I have no live tv here to experiment with.
Title: Re: XBMC + Live TV + VoxCommando
Post by: Dave on February 06, 2014, 02:55:06 AM
Hey Kalle, could you share your command group?
sounds interesting to me ;D
Title: Re: XBMC + Live TV + VoxCommando
Post by: Kalle on February 06, 2014, 04:16:20 AM
Hallo Dave,

mach ich heute Abend  ;)

Gruß
Kalle
Title: Re: XBMC + Live TV + VoxCommando
Post by: maxwel on February 06, 2014, 12:53:40 PM
i am wondering what would be like the command group of jitterjames and kalle!!

Thanks you guys for your help
Title: Re: XBMC + Live TV + VoxCommando
Post by: Kalle on February 06, 2014, 02:41:16 PM
Hi Dave,

hier mal eine Command group für die TV guide (habe es gerade noch mal am desktop PC ausprobiert - und es will nicht mehr so richtig funktionieren  :-[ - es müssen wohl die RoboB.Element actions angepasst werden).
Aber die Richtung stimmt und vielleicht hast Du die Geduld dafür  ;)

Das ganze hatte mal schön funktioniert, aber vielleicht hat sich was auf der Internetseite geändert  :bonk

Gruß
Kalle

PS: Die tvguide.xml und minutestoGgCal.xml müssen in den payload Ordner von VC und das RoboB plugin aktiviert sein.
Title: Re: XBMC + Live TV + VoxCommando
Post by: maxwel on February 06, 2014, 04:35:44 PM
Hi kalle, would it be possible to have your command group in Engels version  :-[

Grtz
Title: Re: XBMC + Live TV + VoxCommando
Post by: Kalle on February 06, 2014, 04:59:03 PM
Yes, I can translate it, but I want to point out that these commands do not work properly because TVinfo has changed the layout of the website. This example will give you a hint how the RoboB plugin works.
Title: Re: XBMC + Live TV + VoxCommando
Post by: Dave on February 06, 2014, 05:34:19 PM
Hey Kalle, danke erstmal!

Es scheint sich tatsächlich was an der Webseite geändert zu haben, ich schau am Wochenende mal ob ich das hinbekomme!
Title: Re: XBMC + Live TV + VoxCommando
Post by: Kalle on February 06, 2014, 05:43:44 PM
Cool, Danke  ;D
Title: Re: XBMC + Live TV + VoxCommando
Post by: maxwel on February 07, 2014, 01:46:04 AM
Yes please Kalle i'll love it  :)
Title: Re: XBMC + Live TV + VoxCommando
Post by: Kalle on February 07, 2014, 05:37:35 AM
Ok maxwel, I've translate the phrases and also the TTS.speak actions to english. I've disable in both commands the last action RoboB.Dispose, so the RoboB browser stay open after the command. In this way you can see/play in the browser window by your self when you enable the "tracking" function at the top of this windows, which will show you the data behind the elements on this website when you move the mouse over it.

copy the VcGrp_TV guideEN.xml in your command tree. Save the tvguide.xml and minutestoGgCal.xml in the VC payload folder.

1. You need find a website with a TV guide for your country and then figure out which elements you need.
2. You must edit the payload tvguide.xml for your channels.

Good luck  ;D
Kalle
Title: Re: XBMC + Live TV + VoxCommando
Post by: maxwel on February 07, 2014, 12:40:41 PM
Dank u wel Kalle . I really appreciate it
Title: Re: XBMC + Live TV + VoxCommando
Post by: maxwel on February 10, 2014, 01:43:53 PM
Ok maxwel, I've translate the phrases and also the TTS.speak actions to english. I've disable in both commands the last action RoboB.Dispose, so the RoboB browser stay open after the command. In this way you can see/play in the browser window by your self when you enable the "tracking" function at the top of this windows, which will show you the data behind the elements on this website when you move the mouse over it.

copy the VcGrp_TV guideEN.xml in your command tree. Save the tvguide.xml and minutestoGgCal.xml in the VC payload folder.

1. You need find a website with a TV guide for your country and then figure out which elements you need.
2. You must edit the payload tvguide.xml for your channels.

Good luck  ;D
Kalle

Hi Kalle,

I have followed your instruction well but I have a small problem.. I have found the TV guide for my country but the right page is not showing up! so I still need your help Kalle! can you fix that for me please? here is the website with a TV guide ( http://www.tvgids.tv/nu-en-straks )

Thanks you

Grtz Max
Title: Re: XBMC + Live TV + VoxCommando
Post by: Dave on February 10, 2014, 03:52:38 PM
Hey Max,
I played a little with Kalles xml and your Website.
The problem is, that the tags we need to find the right text on the site, seem to change during the (not only on your website, but also on every german tv guide website i tried...).
so you can get it work, but only for a few minutes or maybe hours.  >:(
but here is an example how you could do it with your site:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="224" name="TV guide jetzt - current" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>RoboB.Select</cmdType>
    <cmdString>tvguide</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.SetWinSize</cmdType>
    <cmdString>1920&amp;&amp;1080</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.Show</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.Navigate</cmdType>
    <cmdString>http://www.tvgids.tv/nu-en-straks</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.Wait</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>PY.ExecString</cmdType>
    <cmdString>result = 2*{1}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.ElementByTag</cmdType>
    <cmdString>STRONG&amp;&amp;{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.GetText</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <cmdString>(0\B)</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.Replace</cmdType>
    <cmdString>:0&amp;&amp; Uhr </cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.Replace</cmdType>
    <cmdString>:&amp;&amp; Uhr</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetVar</cmdType>
    <cmdString>time1</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>PY.ExecString</cmdType>
    <cmdString>result = {1}*2+1</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.ElementByTag</cmdType>
    <cmdString>STRONG&amp;&amp;{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.GetText</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <cmdString>(0\B)</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.Replace</cmdType>
    <cmdString>:0&amp;&amp; Uhr </cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.Replace</cmdType>
    <cmdString>:&amp;&amp; Uhr</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetVar</cmdType>
    <cmdString>time2</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>PY.ExecString</cmdType>
    <cmdString>result = 7*{1}+42</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.ElementByTag</cmdType>
    <cmdString>DIV&amp;&amp;{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.GetText</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.Replace</cmdType>
    <cmdString>&lt;STRONG&gt; </cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.Replace</cmdType>
    <cmdString> &lt;/STRONG&gt;</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <cmdString>(..:..)</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetVar</cmdType>
    <cmdString>title1</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>PY.ExecString</cmdType>
    <cmdString>result = 7*{1}+45</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.ElementByTag</cmdType>
    <cmdString>DIV&amp;&amp;{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>RoboB.GetText</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.Replace</cmdType>
    <cmdString>&lt;STRONG&gt; &lt;/STRONG&gt;</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <cmdString>(..:..)</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <cmdString>{Var.title1}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.SpeakSync</cmdType>
    <cmdString>seit {Var.time1} läuft {Var.title1}. Im Anschluss folgt ab {Var.time2} {LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>was läuft jetzt, was läuft, was kommt gerade, current program guide for</phrase>
  <phrase optional="true">auf, im, in</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone">payloads\tvguide.xml</payloadFromXML>
</command>

you need to activate the python plugin for this.
i only added the first 4 programs to the tvguide.xml
sorry, but the tts and phrases are in german again, so you have to translate it.

while the tags on the website change, the position of the elements maybe remains the same. perhaps you can change selection by tag to a selction by coordinates...
Title: Re: XBMC + Live TV + VoxCommando
Post by: jitterjames on February 10, 2014, 06:21:27 PM
Hi Dave,

Can you please tell me which tags (specifically) are changing?  Do you think they are doing this on purpose to prevent people from scraping their sites?  If that is the case then it is my duty to find a way around it ;)

If you could show me a chunk of html and specify which tags change that would be very helpful.  Thanks.
Title: Re: XBMC + Live TV + VoxCommando
Post by: Dave on February 11, 2014, 04:15:03 AM
Hey James, thank you for taking a look!

Code: [Select]
<div class="section-item now-and-later">
<div class="section-item-content">

<div class="channel">
<a class="channel-icon sprite-channel-1" href="/zenders/nederland-1" title="TV Gids Nederland 1"></a>
</div>

<a href="/tv/nos-olympische-spelen-sotsji-live" title="NOS Olympische Spelen Sotsji Live"></a>
<a class="now" href="/tv/nos-olympische-spelen-sotsji-live/10662767" title="NOS Olympische Spelen Sotsji Live" rel="nofollow">
<div class="content ellipsis">
<strong>08:00</strong>
NOS Olympische Spelen Sotsji Live
</div>
<div class="progress">
<div class="bar" style="width: 0%;" data-start-time="1392102000000" data-end-time="1392105600000"></div>
</div>
</a>

<a href="/tv/nos-olympische-spelen-sotsji-live" title="NOS Olympische Spelen Sotsji Live"></a>
<a class="later" href="/tv/nos-olympische-spelen-sotsji-live/10662768" title="NOS Olympische Spelen Sotsji Live" rel="nofollow">
<div class="content ellipsis">
<strong>09:00</strong>
NOS Olympische Spelen Sotsji Live
</div>
</a>
</div>
</div>


<div class="section-item now-and-later">
<div class="section-item-content">

<div class="channel">
<a class="channel-icon sprite-channel-2" href="/zenders/nederland-2" title="TV Gids Nederland 2"></a>
</div>

<a href="/tv/nos-jeugdjournaal-met-gebarentolk" title="NOS Jeugdjournaal met gebarentolk"></a>
<a class="now" href="/tv/nos-jeugdjournaal-met-gebarentolk/10662802" title="NOS Jeugdjournaal met gebarentolk" rel="nofollow">
<div class="content ellipsis">
<strong>08:45</strong>
NOS Jeugdjournaal met gebarentolk
</div>
<div class="progress">
<div class="bar" style="width: 0%;" data-start-time="1392104700000" data-end-time="1392105600000"></div>
</div>
</a>

<a href="/tv/nos-journaal" title="NOS-Journaal"></a>
<a class="later" href="/tv/nos-journaal/10662805" title="NOS-Journaal" rel="nofollow">
<div class="content ellipsis">
<strong>09:00</strong>
NOS-Journaal
</div>
</a>
</div>
</div>

this is a piece of the html from the website maxwel found. but its basically the same problem with all the german sites.
i don't know if they do it on purpose. at least i don't see a reason why changing the tags would be necessary, but i'm not a programmer...
the "<div>"-tags, which i use to get the title change, while the "<strong>"-tags, which i use to get the time, remain.
i hope this is what you wanted me to show  ???

a workaround could be to get the tag of one object by coordinates (if thats possible). on some sites you could than calculate the other tags by using the first tag as a reference.
Title: Re: XBMC + Live TV + VoxCommando
Post by: jitterjames on February 11, 2014, 11:22:26 AM
Yes it is what I was asking, but I'm still not sure what it is about those div tags that is changing.  In any case...

This site is a good example of a basic principle.  While I love RoboBrowser for the things that I allows me to do, I prefer to use scrape whenever it is possible.  Scrape is faster and sometimes more reliable.  I will use RoboBrowser when I really have no choice, such as, when a site only loads content dynamically after the initial page load, via javascript calls etc.  In this case scrape is useless.  Or if a site requires to you log in and it maintains session variables with your login info.  For this you need RoboBrowser.

This site though, loads all the content we need in the initial call so scrape is really perfect, fast, and probably less likely to be broken (although that really depends on how you use it).

Here is my command for getting the "What 's on now and then later for a given channel name" using the site: http://www.tvgids.tv/nu-en-straks

Maybe mine will break too, but I tested it last night, and then again this morning and it seems to work.  This command is designed to work with a payloadXML file and you must ask for a channel by name.  It is not designed to work from a channel number, so if you were going to try to detect what channel number you were already watching and then use that to see what was playing, it would need some modification.  As it is I can ask "what is playing on HBO" and it will respond: "Now:Thing Ice, Later: True Detective"

I have attached the payloadXML file with (I think) all the channels.  I recommend that you edit the list to remove any channels that you know you will never ever use, and to edit the phrases for the ones you do use to make sure they can be easily understood by the engine, and to create comma separated aliases for them if you like.  I started at the top and edited a few.  In particular, phrases for any shows that are made up of letters should be separated by spaces (H B O instead of HBO) so that the engine expects to hear them spelled out.  Fox can be left as Fox since we say it like a word.  In some cases, if you are not sure you could use an alias and do it both ways.  On the value column, you should not edit it unless you notice that i have made a mistake.  I have used . in the values for spaces because . matches any character but if you were to enter a space it would just ignore it.  This is needed for the regex to work, but you could use the more accurate \s (which stands for whitespace character), I just find that using \s makes it harder to read (and is more work to type:))

Here is the command:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="208" name="tv guide scrape" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Scrape</cmdType>
    <cmdString>http://www.tvgids.tv/nu-en-straks</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>System.SetClipboardText</cmdType>
    <cmdString>{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExSingle</cmdType>
    <cmdString>title="TV.Gids.{1}".*?title="(.*?)".*?rel="nofollow".*?title="(.*?)".*?rel="nofollow"&amp;&amp;, Later: </cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <cmdString>Now: {Match.1}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <cmdString>Now: {Match.1}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>what is playing on</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\nustraks.xml</payloadFromXML>
</command>

Dave: See if you can use this technique with your other site but let me know if you need help.  I enjoy these puzzles.
Title: Re: XBMC + Live TV + VoxCommando
Post by: jitterjames on February 11, 2014, 12:45:57 PM
I also noticed that we can scrape more information by using the url for a particular channel:

Note that you must use this new payloadXML (attached) in order for the URL to work.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="230" name="What is next on {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Scrape</cmdType>
    <cmdString>http://www.tvgids.tv/zenders/{1}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExSingle</cmdType>
    <cmdString>&lt;div.class=\"section-content\"&gt;(.*)</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetLastResult</cmdType>
    <cmdString>{Match.1}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExSingle</cmdType>
    <cmdString>class=\"section-item-title\"&gt;\s+(..:..)\s+(.*?)\s+&lt;/span&gt;&amp;&amp; : </cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.MatchConcat</cmdType>
    <cmdString>{CR}then at &amp;&amp;6</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.Replace</cmdType>
    <cmdString>#039;&amp;&amp;'</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <cmdString>IN progress, started at {LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>what is next on</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\nustaksnext.xml</payloadFromXML>
</command>
Title: Re: XBMC + Live TV + VoxCommando
Post by: Kalle on February 11, 2014, 12:46:48 PM
I've  did not test it yet, but that is why we ask you for help - great stuff!  You are the "Voxmaster"  ::bow
Title: Re: XBMC + Live TV + VoxCommando
Post by: maxwel on February 11, 2014, 02:52:49 PM


Hey,

It works like a charm! Thank you so much for your good efforts guys - I really appreciate it - fantastic service as ever!

Thanks guys,

Ps: I hope you're also helped dave

Max
Title: Re: XBMC + Live TV + VoxCommando
Post by: Kalle on February 12, 2014, 05:55:54 AM
Great job James - it works perfect and really fast (much faster as with RoboB) the result comes after milliseconds  :clap

As next I will figured out, how we can have a result by time - like "what is running at 1 pm on channel xyz"

Kalle
Title: Re: XBMC + Live TV + VoxCommando
Post by: Dave on February 12, 2014, 07:00:27 AM
Thank you James! ::bow

After learning to use robob, regex and python to do it my (or Kalles) way, I guess now I have to learn how the scrape command works  ::hmm ;)

@Kalle: hast du James Methode schon mit einer deutschen Seite probiert?
Title: Re: XBMC + Live TV + VoxCommando
Post by: Kalle on February 12, 2014, 08:40:13 AM
@Dave

Nein, nur mit tvgids.tv. Wenn Du schon was erstellt hast, lass es mich wissen :D
Title: Re: XBMC + Live TV + VoxCommando
Post by: nime5ter on February 12, 2014, 10:11:25 PM
@Dave & Kalle:

I made some tv guide commands for you to try. These scrape the website http://www.tvinfo.de/, which Kalle used in his original RoboB commands.

1. What's playing now on [channel name]?
2. What's showing next on [channel name]?
3. What's playing on [channel name] at [time]? (This currently only works for today's date, but you guys can adapt it for other days.)

Of course, you will need to translate the phrases into German and adjust the payload xml phrases as well.

Unfortunately, that site uses the iso-8859-1 character set instead of utf-8 (who does that nowadays??), and my attempts to re-encode the text efficiently have thus far failed, so I just used "results.replace" to fix the character set.  :( It's not pretty, but it works.
Title: Re: XBMC + Live TV + VoxCommando
Post by: Kalle on February 13, 2014, 02:54:53 AM
Big Thanks to nime5ter  :hugs x 1.000.000.000.000.000.000...

I've tried this and now it works perfect!  ::bow

I'm really surprised how easy looks the command in VC. When I look at the website tvinfo.de and at the HTML code, I would never find what I'm looking for to create the command.

Kalle
Title: Re: XBMC + Live TV + VoxCommando
Post by: nime5ter on February 13, 2014, 08:58:03 AM
Thanks. I'm glad it works for you.

Actually, you can clean up the regex for the 2nd, "show next" command. I was a bit messy while playing with the regex last night.

You are really just trying to find the second "floatLeft" tag after the channel name, so you can use:

Code: [Select]
<span>{1}</span>.*?floatLeft.>.*?floatLeft.>(.*?)<.*?class="bold">(.*?)<
This looks for the channel you ask for between <span> tags and then captures two separate patterns. It hunts for the second instance of a tag that has floatLeft"> in it. It captures the text directly after that (the time), then continues scanning until it encounters class="bold">and captures the text after that (the show title).

Just in case others look at this thread, I want to explain that this regex catches two separate patterns, but these are interpreted as a single match {Match.1}.

So, if it finds the first pattern after floatLeft"> but no class="bold"> after that, it will not find any matches.

I'm then defining how those two strings are concatenated together by including a delimiter - {CR} as the second, optional Results.Regex parameter. This delimiter formats the two-part match more neatly in my OSD message. Otherwise it just squishes the two patterns together into one string.

A {Match.2} would be found if this entire regular expression were found more than once on the scraped page.
Title: Re: XBMC + Live TV + VoxCommando
Post by: Kalle on February 13, 2014, 09:20:11 AM
Thanks for explanation  :bignod
Title: Re: XBMC + Live TV + VoxCommando
Post by: nime5ter on February 13, 2014, 10:59:55 AM
When I look at the website tvinfo.de and at the HTML code, I would never find what I'm looking for to create the command.

What method do you use to look at the HTML code?

For these kinds of websites, I prefer to use "inspect element" rather than "view page source". That way I can right-click on exactly the part of the page that I am interested in.
Title: Re: XBMC + Live TV + VoxCommando
Post by: Kalle on February 13, 2014, 12:43:04 PM
Yes, I use also "inspect element" in chrome browser - my problem is/was that I have never really take a look in the regex documentation  ;) which is also available in german  :bonk
Title: Re: XBMC + Live TV + VoxCommando
Post by: nime5ter on February 13, 2014, 12:46:57 PM
The "syntax" for regular expressions is not friendly -- in any language. It's easy to forget it too, when you haven't done it in a while.

I should stop posting on the forum today, though. My migraine is making me *really stoopid*. (That's also why I'm not doing much real work.  ;))
Title: Re: XBMC + Live TV + VoxCommando
Post by: Kalle on February 13, 2014, 01:57:20 PM
Ohh that is bad, get well soon  ::console

Kalle
Title: Re: XBMC + Live TV + VoxCommando
Post by: lja on January 07, 2015, 11:09:51 PM
XBMC Kodi Helix
VC 2.133

Code: [Select]
<command id="1511" name="PVR Screen" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>XJson.ExecBuiltin</cmdType>
                <cmdString>ActivateWindowAndFocus(mypvr, 31,0, 10,0)</cmdString>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <phrase>Program Guide</phrase>
        </command>

I have been using the Live TV by Mace and have it working with the exception of the above Program Guide. Please help me with any change that may be needed. Thanks.
Title: Re: XBMC + Live TV + VoxCommando
Post by: jitterjames on January 07, 2015, 11:43:21 PM
I don't have a pvr so I can't tell you the answer, but I will suggest this very old and frequently suggested trick:

Usually it helps to create a favourite in Kodi and then to look at your favourites XML for a clue about how to correctly format your call to activate window.

Some of the ExecBuiltin actions don't seem to work in Kodi any more (scary) but there is also a json command to do the same thing and there are many examples that use it in the default Kodi config for VC.
Title: Re: XBMC + Live TV + VoxCommando
Post by: nime5ter on January 08, 2015, 12:08:14 AM
I'm not sure if it's possible to set an EPG as a favourite.

@lja -- you may want to post your question on the XBMC boards. It's possible that they've changed how the EPG is called now in Kodi, since they claim that they've added more support for PVRs in general. Or maybe it is a skin-related issue, where that command works with some skins but not in others.

What skin are you using? Maybe someone on our boards can test this command for you if they're using Kodi and have a PVR, but if no one responds, I recommend posting to the XBMC boards.
Title: Re: XBMC + Live TV + VoxCommando
Post by: lja on January 08, 2015, 12:22:13 AM
@jitterjames
@nime5ter

Thanks. In the interim,will also check out the XBMC boards. Presently using Confluence.
Title: Re: XBMC + Live TV + VoxCommando
Post by: jitterjames on January 08, 2015, 12:24:10 AM
This might help...
http://forum.kodi.tv/showthread.php?tid=210552&pid=1860110
Title: Re: XBMC + Live TV + VoxCommando
Post by: nime5ter on January 08, 2015, 08:32:28 AM
You can try the following command (which includes all the new PVR views mentioned in that XBMC forum thread). This is based on the syntax described on the Kodi site.

So you can say "Browse TV Guide", "Browse TV Channels", "Browse TV Recordings", etc. using this one command.

No guarantees, as we have no way of testing it from here, but let us know how it goes. If it doesn't function properly, you can enable logging, test the command, and post your log for us. Maybe that will help.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.3-->
<command id="471" name="PVR windows" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.ExecBuiltin</cmdType>
    <params>
      <param>ActivateWindow({1}{2})</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Browse</phrase>
  <payloadList>TV,Radio</payloadList>
  <payloadList>Channels,Guide,Recordings,Timers,Search</payloadList>
</command>
Title: Re: XBMC + Live TV + VoxCommando
Post by: lja on January 08, 2015, 07:46:14 PM
This might help...
http://forum.kodi.tv/showthread.php?tid=210552&pid=1860110

Thanks. Took a look at it and will try it.
Title: Re: XBMC + Live TV + VoxCommando
Post by: lja on January 08, 2015, 07:50:47 PM
You can try the following command (which includes all the new PVR views mentioned in that XBMC forum thread). This is based on the syntax described on the Kodi site.

So you can say "Browse TV Guide...

@nime5ter Thanks. Tried on Windows 7, VC 2.133, Kodi and all worked as expected, great. However on Windows 8.1, VC2.133, Kodi, no luck. Would any adjustment be necessary for Windows 8.1?
Title: Re: XBMC + Live TV + VoxCommando
Post by: jitterjames on January 08, 2015, 07:58:15 PM
Not likely.  It should work exactly the same way.. Your windows 8 setup is probably incomplete. Like you forgot to enable voxtools add-on or something.
Title: Re: XBMC + Live TV + VoxCommando
Post by: lja on January 09, 2015, 10:27:16 PM
Not likely.  It should work exactly the same way.. Your windows 8 setup is probably incomplete. Like you forgot to enable voxtools add-on or something.

Finally, after checking and finding that voxtools was enabled, but still no luck. I then decided to reinstall Kodi and Vox Commando. So far it's now working as expected. Thanks.
Title: Re: XBMC + Live TV + VoxCommando
Post by: Hiryu on February 26, 2015, 08:03:29 PM
Hi -- finally figured out how to get Live TV on Kodi with the HD Homerun Prime.  Trying out some of these Live TV commands -- from Kodi homescreen, I am able to say "Switch/play to channel [two]" and it will pull up the correct channel.  However, while channel two is playing and I try to change the channel "Switch to channel [four]", I get an error in Kodi, where it says "NextPVR: Tuner not available".  So, really can only use the switch command once.  I know the tuner is working, because even though I can't voice command anymore, if I go into the Live TV view, and just select channel four, it switches over.

I know this might actually be a Kodi issue, but thought I would ask here first if you have any advice or if anyone has encountered this issue.  Any advice on how to troubleshoot this? 

The VC log seems ok, maybe I'm missing something.

Code: [Select]
2/26/2015 6:53:29 PM 954 doCommand:Live TV Channel
2/26/2015 6:53:29 PM 954 [plugin] Sending json request:
2/26/2015 6:53:29 PM 954 [plugin] {"jsonrpc": "2.0", "method": "GUI.ShowNotification", "params":{"title":"Switch to Channel Five (84.4)","message":"(1 Live TV Channel [WNYW Five]) (2 Live TV Channel [Fox Sports 1]) (3 Live TV Channel [Fox Sports 2]) (4 Live TV Channel [CBS Sports Netw]) (5 Live TV Channel [NBC Sports Netw]) (6 Live TV Channel [Fox Sports 1 HD]) "},"id": "0"}
2/26/2015 6:53:29 PM 954 action repeat set to: 1
2/26/2015 6:53:29 PM 955 Action:  XJson.Raw - Player.Open&&"item" : {"channelid" : 4}
2/26/2015 6:53:29 PM 955 [action] XJson.Raw:Player.Open&&"item" : {"channelid" : 4}

2/26/2015 6:53:29 PM 956 [plugin] {
  "id": "0",
  "jsonrpc": "2.0",
  "result": "OK"
}
2/26/2015 6:53:29 PM 957 [plugin] Sending json request:
2/26/2015 6:53:29 PM 957 [plugin] {"jsonrpc": "2.0", "method": "Player.Open", "params":{"item" : {"channelid" : 4}},"id": "0"}
2/26/2015 6:53:29 PM 972 [plugin] {
  "id": "0",
  "jsonrpc": "2.0",
  "result": "OK"
}
2/26/2015 6:53:29 PM 972 action result: OK
2/26/2015 6:53:29 PM 972 action repeat set to: 1
2/26/2015 6:53:29 PM 972 Action:  XJson.Raw - GUI.ShowNotification&&"title" : "Switch to Channel Five" , "message" : ""
2/26/2015 6:53:29 PM 972 [action] XJson.Raw:GUI.ShowNotification&&"title" : "Switch to Channel Five" , "message" : ""

2/26/2015 6:53:29 PM 972 [plugin] {
  "jsonrpc": "2.0",
  "method": "Player.OnStop",
  "params": {
    "data": {
      "end": true,
      "item": {
        "channeltype": "tv",
        "id": 3,
        "title": "WNBC",
        "type": "channel"
      }
    },
    "sender": "xbmc"
  }
}
2/26/2015 6:53:29 PM 974 [plugin] Sending json request:
2/26/2015 6:53:29 PM 974 [plugin] {"jsonrpc": "2.0", "method": "GUI.ShowNotification", "params":{"title" : "Switch to Channel Five" , "message" : ""},"id": "0"}
2/26/2015 6:53:29 PM 976 [plugin] {
  "id": "0",
  "jsonrpc": "2.0",
  "result": "OK"
}
2/26/2015 6:53:29 PM 976 action result: OK
Title: Re: XBMC + Live TV + VoxCommando
Post by: jitterjames on February 27, 2015, 08:54:31 AM
I don't have an HD Homerun, or any kind of PVR so I can't test this but it does sound like an issue with either Kodi or the HD.

I suggest you post your question on a Kodi forum.

The one obvious thing to try is to stop playback first before changing channels.

In the future, please post logs or XML or in a code box, not as a quote.
Title: Re: XBMC + Live TV + VoxCommando
Post by: Mace on March 02, 2015, 10:53:29 PM
Quote
Hi -- finally figured out how to get Live TV on Kodi with the HD Homerun Prime.  Trying out some of these Live TV commands -- from Kodi homescreen, I am able to say "Switch/play to channel [two]" and it will pull up the correct channel.  However, while channel two is playing and I try to change the channel "Switch to channel [four]", I get an error in Kodi, where it says "NextPVR: Tuner not available".  So, really can only use the switch command once.  I know the tuner is working, because even though I can't voice command anymore, if I go into the Live TV view, and just select channel four, it switches over.

Hi Hiryu,
I'm using these same commands in kodi 14.1, all work perfectly for me.
Updated a couple commands on my original post, to better suit the new Kodi api, but this particular command i haven't chanced.
I use tvheadend not Homerun, about the only difference.
Could try adding in a 'Stop' command at the start so it will stop the current channel before changing over.