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

0 Members and 1 Guest 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: 1999
  • 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
  • Sr. Member
  • *****
  • Posts: 497
  • 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: 1999
  • 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: 1999
  • 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: 7714
  • 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: 7714
  • 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
  • Sr. Member
  • *****
  • Posts: 497
  • 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: 1999
  • 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: 1999
  • 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)