diff --git a/README.md b/README.md index e674881..cc4b292 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,8 @@ Follow these steps to easily control your kodi using simple voice commands with **Binge watch a tv show:** "Hey Google, kodi binge watch [tv show name]" --> will add all unwatched episodes to the playlist and play it. ### **Search and play a youtube video:** -"Hey Google youtube [youtube title]" --> will search a youtube video, and play the first video. +"Hey Google, kodi play youtube [youtube title]" --> will search a youtube video, and play the first video. +"Hey Google, kodi search youtube [youtube title]" --> will search youtube and show you the results on the kodi screen. ### **Pause / Resume kodi:** "Hey Google, pause kodi" @@ -515,7 +516,8 @@ For **PVR TV support - Set channel by number**, use "Say a phrase with a number" | Say a simple phrase | Kodi reboot | _YOUR_NODE_SERVER_/reboot | | Say a simple phrase | Kodi suspend | _YOUR_NODE_SERVER_/suspend | | Say a phrase with a text ingredient | Kodi shuffle $ | _YOUR_NODE_SERVER_/shuffleepisode?q={{TextField}} | -| Say a phrase with a text ingredient | Kodi youtube play $ | _YOUR_NODE_SERVER_/playyoutube?q={{TextField}}&max=15 | +| Say a phrase with a text ingredient | Kodi play youtube $ | _YOUR_NODE_SERVER_/playyoutube?q={{TextField}}&max=15 | +| Say a phrase with a text ingredient | Kodi search youtube $ | _YOUR_NODE_SERVER_/searchyoutube?q={{TextField}} | | Say a simple phrase | Kodi scan library | _YOUR_NODE_SERVER_/scanlibrary | | Say a simple phrase | Kodi clean library | _YOUR_NODE_SERVER_/cleanlibrary | | Say a phrase with a number
Say a simple phrase | Kodi Navigate up #
Kodi Navigate up | _YOUR_NODE_SERVER_/navup?q={{NumberField}}
_YOUR_NODE_SERVER_/navup | diff --git a/helpers.js b/helpers.js index 3067bd9..0e5bcea 100644 --- a/helpers.js +++ b/helpers.js @@ -1130,6 +1130,14 @@ exports.kodiPlayChannelByNumber = (request, response) => { // eslint-disable-lin return kodiPlayChannel(request, response, pvrFuzzySearchOptions); }; +exports.kodiSearchYoutube = (request, response) => { // eslint-disable-line no-unused-vars + let searchString = request.query.q.trim(); + let kodi = request.kodi; + + return kodiOpenVideoWindow( + `plugin://plugin.video.youtube/kodion/search/query?q=${searchString}`, kodi); +}; + exports.kodiPlayYoutube = (request, response) => { // eslint-disable-line no-unused-vars let searchString = request.query.q.trim(); let maxItems = request.query.max !== undefined ? parseInt(request.query.max) : 15; diff --git a/server.js b/server.js index cb946c9..4144b0f 100644 --- a/server.js +++ b/server.js @@ -178,6 +178,8 @@ app.all('/playpvrchannelbyname', exec(Helper.kodiPlayChannelByName)); // http://1.1.1.1/playyoutube?q=bla app.all('/playyoutube', exec(Helper.kodiPlayYoutube)); +app.all('/searchyoutube', exec(Helper.kodiSearchYoutube)); + // Parse request to watch a PVR channel by number // Request format: http://[THIS_SERVER_IP_ADDRESS]/playpvrchannelbynumber?q=[CHANNEL_NUMBER] app.all('/playpvrchannelbynumber', exec(Helper.kodiPlayChannelByNumber));