Author Topic: Open 1channel Search  (Read 13285 times)

0 Members and 2 Guests are viewing this topic.

tyebeach

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 0
    • View Profile
Open 1channel Search
« on: April 10, 2015, 07:58:41 PM »
I accidentally posted this in the old XBMC section and am reposting it here.

I would like to make VC open an XBMC addon and pass what I say into a search. For instance, I would like to say "search 1channel shows for" and whatever I say have 1channel search for it. I have read a few posts about making 1channel search a favorite, but I can't get voxcommando to open the favorite. I may be using the wrong command or simply inserting the wrong info from the xml file. Could someone please point me in the right direction?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Open 1channel Search
« Reply #1 on: April 10, 2015, 08:04:27 PM »
If you post the xml for the command or commands you've made, that will make it a bit easier for us to steer you in the right direction.
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)

tyebeach

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 0
    • View Profile
Re: Open 1channel Search
« Reply #2 on: April 11, 2015, 02:03:18 AM »
Thanks for such a fast reply. I have saved 1Channel "search" under "TV Shows" into favorites. Here is what the Kodi xml looks like:

Code: [Select]
<?xml version="1.0"?>

-<favourites>

<favourite thumb="art\themes\Classic\search.jpg" name="Search">PlayMedia("plugin://plugin.video.1channel/?section=tv&mode=GetSearchQuery&next_mode=Search")</favourite>

</favourites>


and here is what my xml looks like in voxcommando:


Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.2-->
<command id="579" name="search 1channel  tv shows" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.ExecBuiltin</cmdType>
    <params>
      <param>PlayMedia("plugin://plugin.video.1channel/?section=tv&amp;mode=GetSearchQuery&amp;next_mode=Search")</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>search 1channel  tv shows</phrase>
</command>


I don't understand why it doesn't open the search inside of 1channel.

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: Open 1channel Search
« Reply #3 on: April 11, 2015, 02:57:39 AM »
this will launch the 1channel tv show search popup,
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<command id="595" name="search 1channel  tv shows" 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": "video", "parameters": ["plugin://plugin.video.1channel/?section=tv&amp;mode=GetSearchQuery&amp;next_mode=Search"]</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>search 1channel  tv shows</phrase>
</command>


 there are a couple different reasons that your command didn't work, if you compare this command and your command you can see the differences between the two, when running into a command that's not working or your trying something new it's always a good idea to look at other similar commands to see what works and that should help you in the right direction,

also when looking for help with VC, posting your commands go along way to people understanding what your problem is and what your trying to do  :D


nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Open 1channel Search
« Reply #4 on: April 11, 2015, 06:55:31 AM »
I don't understand why it doesn't open the search inside of 1channel.

PegLeg's GUI.ActivateWindow method is best, but you followed the instructions quite well with your original attempt. I think the only reason your method didn't open the search window for you was that you had quotes around the URL path, PlayMedia("path"). PlayMedia(path) should have worked.

Building on PegLeg's solution, you can actually search directly for a particular title.

Try manually executing a 1channel search for a show and then check your Kodi log. You'll see what the query string looks like. That can be a good start when building commands as well, once you have a sense of what you're doing.

You'll see a log entry like:
Code: [Select]
05:29:51 T:4588  NOTICE: 1Channel: Args: |['plugin://plugin.video.1channel/', '7', '?query=Bobs+Burgers&section=tv&mode=Search']|

You can then try to turn that into a command, like so:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.2-->
<command id="825" name="Search One Channel for {1}" 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": "video", "parameters": ["plugin://plugin.video.1channel/?query={1}&amp;section=tv&amp;mode=Search"]</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>1000</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Btn.KB</cmdType>
    <params>
      <param>down</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Search One Channel for</phrase>
  <payloadList>Bob's Burgers, 8 out of 10 Cats, The Good Wife</payloadList>
</command>

For demo purposes I've used a payload list of a few show titles. You could use a payload XML file if you want, or payload dictation if you need to be super flexible.

... I added one "down" action, which is a bit of a hacky way to automatically highlight the first entry in the list of search hits if you're doing a fresh search. You may not want that.
« Last Edit: April 11, 2015, 09:39:25 AM 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)

tyebeach

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 0
    • View Profile
Re: Open 1channel Search
« Reply #5 on: April 11, 2015, 11:25:36 AM »
Thanks nime5ter & PegLegTV! Those both work. I will test them out further.

tyebeach

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 0
    • View Profile
Re: Open 1channel Search
« Reply #6 on: April 13, 2015, 03:35:25 PM »
I have 1channel opening fine and have it working with dictation set to regular. When I say "search one channel for" it enters what I want into the search and finds it. I would like to be able to set this up with all of the video addons that I use. I understand that every addon behaves differently. I posted my xml for the 1channel favorite earlier in this thread. I noticed that to get the search to open properly through VC, we had to add "query={1}" and remove "GetSearchQuery&next_mode" from the string.

Basically I noticed it was changed from:

Code: [Select]
plugin://plugin.video.1channel/?section=tv&mode=GetSearchQuery&next_mode=Search
To:

Code: [Select]
plugin://plugin.video.1channel/?query={1}&section=tv&mode=Search
I understand why "query={1}" was inserted, but don't understand why it was put in that exact place of the string and why "GetSearchQuery&next_mode" was deleted.

I feel if I could understand why it would help me figure out how to setup Project Free TV the same way.

My xml for Project Free TV looks like this:

Code: [Select]
<favourite thumb="C:\Users\NAC\AppData\Roaming\Kodi\addons\plugin.video.projectfreetv/icons/Search.png" name="Search">ActivateWindow(10025,"plugin://plugin.video.projectfreetv/?mode=search&section=shows",return)</favourite>
I'm not sure where to put the "query={1}" so that when I say "search Project Free TV for" it automatically pulls it up. I have figured out how to open the search, but I can't figure out how to make it insert what I want to search for.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Open 1channel Search
« Reply #7 on: April 13, 2015, 05:48:25 PM »
I understand why "query={1}" was inserted, but don't understand why it was put in that exact place of the string and why "GetSearchQuery&next_mode" was deleted.

I feel if I could understand why it would help me figure out how to setup Project Free TV the same way.

The window that you initially added to your favourites was the Search window for 1channel. So, as you tried, and as PegLegTV also demonstrated, you could use the syntax

Code: [Select]
plugin://plugin.video.1channel/?section=tv&mode=GetSearchQuery&next_mode=Search

to open that window -- but then you would still have needed to emulate typing in your search string and hitting enter in order to return the actual search results. Doable, but awkward and, in this case, not necessary.

The ultimate search query syntax that I shared came from analysing the next step in the search process. As I think I mentioned above, I actually did a search using that search window, and then I checked the Kodi log to see if it said anything useful about how the plugin was implementing that search. It did.

So the syntax is different because we're actually going directly to the next stage (mode) in the search process, bypassing the search window.

That said, the order of the parameters used in the search query probably doesn't matter. You could just as easily have used:

Code: [Select]
plugin://plugin.video.1channel/?section=tv&mode=Search&query={1}

Quote
My xml for Project Free TV looks like this:

Code: [Select]
<favourite thumb="C:\Users\NAC\AppData\Roaming\Kodi\addons\plugin.video.projectfreetv/icons/Search.png" name="Search">ActivateWindow(10025,"plugin://plugin.video.projectfreetv/?mode=search&section=shows",return)</favourite>
I'm not sure where to put the "query={1}" so that when I say "search Project Free TV for" it automatically pulls it up. I have figured out how to open the search, but I can't figure out how to make it insert what I want to search for.

You should try to follow the same process. Manually enter a search in your Project Free TV search window, and then check your Kodi log to see what it says. The plugin determines the syntax, not us.
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)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Open 1channel Search
« Reply #8 on: April 13, 2015, 05:53:27 PM »
It's important to note that there are no rules here.  Each addon is free to implement calls however they want (within reason).  You are looking for rules where there are probably none. As mentioned, the Kodi log can be a very useful way to see what is possible.

tyebeach

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 0
    • View Profile
Re: Open 1channel Search
« Reply #9 on: April 13, 2015, 06:32:15 PM »
OK I closed Kodi and deleted the old log files. I reopened Kodi and searched for "Simpsons" in Project Free TV. I have browsed through the log file and I am lost. Can someone point me in the right direction?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Open 1channel Search
« Reply #10 on: April 13, 2015, 06:37:38 PM »
I'm not sure but you might need to enable debug logging in Kodi first.

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: Open 1channel Search
« Reply #11 on: April 13, 2015, 06:41:35 PM »
steps to using the log file method:

1.) go to: settings-system-debugging- enable debugging
2.) close XBMC/KODI
3.) Launch XBMC/KODI
4.) perform search (or do what your trying to figure out)
5.) navigate to and open KODI.LOG (XBMC.LOG)

tyebeach

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 0
    • View Profile
Re: Open 1channel Search
« Reply #12 on: April 13, 2015, 06:56:14 PM »
I am amazed at the quickness in this forum. You guys are awesome!

I have enabled debugging and have looked at the log. This time I clicked on "Search All" within Project Free TV. I see a line in the log file that looks like this:

Code: [Select]
plugin://plugin.video.projectfreetv/','2','?mode=search&section=all
Would this be the line that I modify?
« Last Edit: April 13, 2015, 07:35:47 PM by tyebeach »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Open 1channel Search
« Reply #13 on: April 13, 2015, 09:12:04 PM »
The best way to know is to test it out and see what happens. It's a bit of a black art.

To me, that looks like it might open the search window, but not more than that.

There are no guarantees that what was possible with the 1channel plugin will be possible with other addons. It depends on how they work internally.
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)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Open 1channel Search
« Reply #14 on: April 13, 2015, 09:50:11 PM »
This is a bit kludgy, but seems to work.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.2-->
<command id="834" name="Project Free TV" 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": "video", "parameters": ["plugin://plugin.video.projectfreetv/?mode=search&amp;name={1}"]</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Btn.KB</cmdType>
    <params>
      <param>enter</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Search project free for</phrase>
  <payloadList>30 Rock, Life on Mars, Little Rascals</payloadList>
</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)

tyebeach

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 0
    • View Profile
Re: Open 1channel Search
« Reply #15 on: April 14, 2015, 01:00:07 PM »
Awesome! That works great. Thanks!

Darthvuder2

  • Jr. Member
  • **
  • Posts: 13
  • Karma: 0
    • View Profile
Re: Open 1channel Search
« Reply #16 on: December 31, 2016, 01:15:52 AM »
Hello,
I've been trying to refine this for Exodus but keep on getting a parsing error. The attached kodi log is after I've typed "simpsons" into search page and pushed 'done'.
Any help is appreciated.


My code is:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<command id="595" name="search 1channel  tv shows" 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": "video", "parameters": ["plugin://plugin.video.exodus/action=tvshowPage&url=http%3A%2F%2Fapiv2launch.trakt.tv%2Fsearch%3Ftype%3Dshow%26limit%3D20%26page%3D1%26query%3Dsimpsons"]</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>search 1channel  tv shows</phrase>
</command>
« Last Edit: December 31, 2016, 08:30:46 AM by jitterjames »

Darthvuder2

  • Jr. Member
  • **
  • Posts: 13
  • Karma: 0
    • View Profile
Re: Open 1channel Search
« Reply #17 on: December 31, 2016, 01:27:51 AM »
The parsing error happens when Voxcommando starts (line 18, position 97 corresponds with an &)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Open 1channel Search
« Reply #18 on: December 31, 2016, 08:42:10 AM »
Please post your XML again, and this time put it in a code box.  When I try to paste your xml into VC I get an error.  It has something to do with the long parameter.

Don't open the XML or edit it in any other program, just copy and paste directly from VC to a code box on the forum.

Alternatively you can copy and paste the actual contents of the parameter into a code box.

Thanks.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Open 1channel Search
« Reply #19 on: December 31, 2016, 08:57:57 AM »
The parsing error happens when Voxcommando starts (line 18, position 97 corresponds with an &)

Line 18?  Really?  I think you sent the wrong log file.

I can't find any parsing error, nor any mention of trakt or simpsons in the log and on line 18 Kodi is still loading.

Darthvuder2

  • Jr. Member
  • **
  • Posts: 13
  • Karma: 0
    • View Profile
Re: Open 1channel Search
« Reply #20 on: December 31, 2016, 12:49:31 PM »
Sorry for the confusion. I had to copy my kodi log with each individual step done to make sure I understood where the parameter was coming from. I thought it was in the third log but actually in the 4th.

The parsing error happens when I start Voxcommando. I did a test run using the code for 1channel listed in the previous comments and it ran beautifully. I replaced the parameter "plugin..." with that found in the log below and when I start voxcommando gives me a popup box stating "error (re)loading groups:An error occurred while parsing EntityName. LIne 18, position 97".

I assumed this referenced the voxcommando voicecommands.xml file line 18, which corresponds to the line with the new parameter pasted in.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Open 1channel Search
« Reply #21 on: December 31, 2016, 01:06:03 PM »
Are you trying to edit the VoxCommando voicecommands.xml  XML file by hand?

If so, please stop doing that.  Click "Edit" in VoxCommando and then edit your tree and commands the normal way.

It looks like you have corrupted your voicecommands.xml file by entering invalid XML when editing it.

Cautionary reminder to everyone on the forum:

Quote
The commands in your command tree are stored "behind the scenes" as XML.
You should never edit the XML directly; this is what the Command Tree Editor is for. ...

http://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum
http://voxcommando.com/mediawiki/index.php?title=How_to_use_VoxCommando#The_Basics
« Last Edit: December 31, 2016, 01:18:57 PM by nime5ter »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Open 1channel Search
« Reply #22 on: December 31, 2016, 01:30:15 PM »
Hi,

I have cleaned up your voicecommands.xml file and re-created the command that corrupted the original file. See attached.

I don't know whether the new command will do what you want, but it is proper xml now.

As James mentions above, stick to using the Command Tree Editor to avoid these kinds of issues in the future.

cheers.
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)

Darthvuder2

  • Jr. Member
  • **
  • Posts: 13
  • Karma: 0
    • View Profile
Re: Open 1channel Search
« Reply #23 on: December 31, 2016, 06:29:13 PM »
okay so it worked with your new voicecommands file beautifully. You guys are geniuses, thanks a bunch