Support for XBMC2 plugin (formerly XBMCRepeat)

Questions and comments specific to a particular plugin should go here.
egbaud
Posts: 35
Joined: Tue Mar 18, 2014 1:30 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by egbaud » Sun Aug 06, 2017 9:08 pm

How do I translate this: xbmc.VideoLibrary.RemoveMovie(movieid=1234) into XBMC2 form.

I know the first part is eg.plugins.XBMC2.JSONRPC(u'VideoLibrary.RemoveMovie', ????), but how do I encode the "movieid=1234" part?

jonib
Plugin Developer
Posts: 1244
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Sun Aug 06, 2017 9:59 pm

egbaud wrote:How do I translate this: xbmc.VideoLibrary.RemoveMovie(movieid=1234) into XBMC2 form.

I know the first part is eg.plugins.XBMC2.JSONRPC(u'VideoLibrary.RemoveMovie', ????), but how do I encode the "movieid=1234" part?

Code: Select all

eg.plugins.XBMC2.JSONRPC(u'VideoLibrary.RemoveMovie', [1234] )
or

Code: Select all

eg.plugins.XBMC2.JSONRPC(u'VideoLibrary.RemoveMovie', {"movieid": 1234} )
I did not test but should work, post again if not.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

egbaud
Posts: 35
Joined: Tue Mar 18, 2014 1:30 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by egbaud » Mon Aug 07, 2017 5:32 pm

Thank you! Worked perfectly.

MaxMan23
Posts: 18
Joined: Sat Jun 29, 2013 4:36 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by MaxMan23 » Mon Aug 14, 2017 10:25 am

Hello. Can someone help me with a python script. I want to send clear signals for play pause (not toggle). If an Event comes for Pause a script should be executed. And if an Event comes for Play another script should be executed.

Someone wrote this as an example:
def getVideoPlaying():
videoPlaying = 0
activePlayer = eg.plugins.XBMC2.JSONRPC(u'Player.GetActivePlayers', u'', False)
if activePlayer:
if activePlayer[0]["type"] == "video":
mediaSpeed = eg.plugins.XBMC2.JSONRPC(u'Player.GetProperties', u'1,["speed"]', False)["speed"]
if mediaSpeed > 0:
videoPlaying = 1
return videoPlaying


I need something like this (for Pause):
def getVideoPlaying():
videoPlaying = 0
activePlayer = eg.plugins.XBMC2.JSONRPC(u'Player.GetActivePlayers', u'', False)
if activePlayer:
if activePlayer[0]["type"] == "video":
mediaSpeed = eg.plugins.XBMC2.JSONRPC(u'Player.GetProperties', u'1,["speed"]', False)["speed"]
if mediaSpeed > 1:
eg.plugins.XBMC2.JSONRPC(u'Player.PlayPause.....



Here is an Json Example:
{"jsonrpc": "2.0", "method": "Player.PlayPause", "params": { "playerid": 0 }, "id": 1}


Can someone help me with the right format for the script, please. And can anyone tell me if this could work?

jonib
Plugin Developer
Posts: 1244
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Mon Aug 14, 2017 3:16 pm

MaxMan23 wrote:Hello. Can someone help me with a python script. I want to send clear signals for play pause (not toggle). If an Event comes for Pause a script should be executed. And if an Event comes for Play another script should be executed.

Code: Select all

Can someone help me with the right format for the script, please. And can anyone tell me if this could work?[/quote]I would start with these actions:
[code]XBMC2->Actions->Media playing->Play
XBMC2->Actions->Media playing->Pause
"Play" will only start playback and resume playback if paused, "Pause" will pause and resume playback if paused but not start.

As "Pause" works as a semi toggle, try this for a pure pause, something must be playing for it to work:

Code: Select all

{"jsonrpc": "2.0", "method": "Player.PlayPause", "params": {"playerid": 1, "play": False}, "id": 1}
jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

MaxMan23
Posts: 18
Joined: Sat Jun 29, 2013 4:36 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by MaxMan23 » Tue Aug 15, 2017 10:31 am

"Pause" will pause and resume playback if paused but not start.
If i press Pause two times, playback should not start again.

Can you help me with the right format:
eg.plugins.XBMC2.JSONRPC(u'Player.PlayPause

jonib
Plugin Developer
Posts: 1244
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Tue Aug 15, 2017 2:59 pm

MaxMan23 wrote:Can you help me with the right format:
Put this in a "Python script" action:

Code: Select all

activePlayer = eg.plugins.XBMC2.JSONRPC(u'Player.GetActivePlayers', u'', False)
if activePlayer:
    eg.plugins.XBMC2.JSONRPC(u'Player.PlayPause', u'{0},False'.format(activePlayer[0]['playerid']), False)
jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

Foune
Experienced User
Posts: 88
Joined: Sun Jul 03, 2011 7:08 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by Foune » Wed Aug 30, 2017 2:49 pm

jonib wrote:Plugin updated to 0.6.35, get it on Github, only the
Thank you for your work. I stopped using this xbmc plugin some years ago because of compatibility problems. I'll try your code ASAP.

enobhsiw
Posts: 29
Joined: Mon Sep 11, 2017 7:51 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by enobhsiw » Wed Sep 13, 2017 9:36 pm

Hi,

I am very new to EG. Im trying to launch Kodi on my 'Always On' Windows 10 Enterprise x64 laptop, using the 'Wake on LAN' feature on Official Kodi Remote on my Iphone.
I tried using Broadcaster and XBMC Event Receiver aswell, and configured the UDP port to 9, but I recieve the following error:

Code: Select all

error: uncaptured python exception, closing channel <eg.CorePluginModule.XBMCEventReceiver.Server connected :9 at 0x4a1ccb0> (<type 'exceptions.UnicodeDecodeError'>:'utf8' codec can't decode byte 0xff in position 0: unexpected code byte [asyncore.pyc|read|76] [asyncore.pyc|handle_read_event|414] [C:\Program Files (x86)\EventGhost\plugins\XBMCEventReceiver\__init__.py|handle_read|110] [encodings\utf_8.pyc|decode|16])
Please help, and guide me on what I could do to achieve what I am trying to do.

Thanks in advance.

jonib
Plugin Developer
Posts: 1244
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Thu Sep 14, 2017 5:43 am

enobhsiw wrote:Hi,

I am very new to EG. Im trying to launch Kodi on my 'Always On' Windows 10 Enterprise x64 laptop, using the 'Wake on LAN' feature on Official Kodi Remote on my Iphone.
I tried using Broadcaster and XBMC Event Receiver aswell, and configured the UDP port to 9, but I recieve the following error:

Code: Select all

error: uncaptured python exception, closing channel <eg.CorePluginModule.XBMCEventReceiver.Server connected :9 at 0x4a1ccb0> (<type 'exceptions.UnicodeDecodeError'>:'utf8' codec can't decode byte 0xff in position 0: unexpected code byte [asyncore.pyc|read|76] [asyncore.pyc|handle_read_event|414] [C:\Program Files (x86)\EventGhost\plugins\XBMCEventReceiver\__init__.py|handle_read|110] [encodings\utf_8.pyc|decode|16])
Please help, and guide me on what I could do to achieve what I am trying to do.

Thanks in advance.
There is no "Wake on LAN" specific functionality in the XBMC2 plugin and I don't support the Official Kodi remote or IPhone so can't help with any of it.

Also I don't support the "XBMC Event Receiver" plugin (Support for it is here), I do support the XBMC broadcast events in the XBMC2 plugin but it probably is NOT supported in the version of Kodi/XBMC you are using.

I see that kgschlosser pointed you here, So start by removing the "XBMC Event Receiver" plugin and if you are using a very old version of XBMC (11 or older) activate broadcast events in the XBMC2 options. But I don't think WakeOnLAN is related to this.
So what is not working except for the error you are receiving?

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

enobhsiw
Posts: 29
Joined: Mon Sep 11, 2017 7:51 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by enobhsiw » Thu Sep 14, 2017 9:11 pm

jonib wrote: There is no "Wake on LAN" specific functionality in the XBMC2 plugin and I don't support the Official Kodi remote or IPhone so can't help with any of it.

Also I don't support the "XBMC Event Receiver" plugin (Support for it is here), I do support the XBMC broadcast events in the XBMC2 plugin but it probably is NOT supported in the version of Kodi/XBMC you are using.

I see that kgschlosser pointed you here, So start by removing the "XBMC Event Receiver" plugin and if you are using a very old version of XBMC (11 or older) activate broadcast events in the XBMC2 options. But I don't think WakeOnLAN is related to this.
So what is not working except for the error you are receiving?

jonib
Hi Jonib,

I am using the Kodi Kryptop 17.4 version. So far I stopped with the launching of the application(Kodi) using the 'Wake on LAN' feature of the remote of the app.
Will ask for help for the rest if I run into any trouble.
Thanks for the help :)

jonib
Plugin Developer
Posts: 1244
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Fri Sep 15, 2017 6:37 am

enobhsiw wrote:Will ask for help for the rest if I run into any trouble.
Good

Thanks to you I finally looked into using WakeOnLan for my HTPC, and got it working when in sleep mode. Now I can have it go to sleep and be able to wake it up when I need to do some testing when I'm developing the XBMC2 plugin, cool 8)

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

Post Reply