Page 65 of 94

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Posted: Thu May 29, 2014 11:31 am
by gechu
Hi!

Trying to get the call:

Code: Select all

JSON-RPC->Player->GetActivePlayers->(No parameters)
working in Gotham. I┬┤m using the second latest release (not the debug version).

Anyone has it working in Gotham?

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Posted: Thu May 29, 2014 4:50 pm
by jonib
gechu wrote:Trying to get the call:
Something seems to work differently as an empty parameter don't seem to work at the moment.
Put in:

Code: Select all

{}
or

Code: Select all

[]
as the parameter and it should work. I will look into whats wrong later.

jonib

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Posted: Thu May 29, 2014 5:18 pm
by gechu
This worked:

Code: Select all

[]


BTW, I┬┤m buying you a beer + pizza for the great work you put into this plugin! Thank you!

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Posted: Thu May 29, 2014 5:23 pm
by jonib
gechu wrote:This worked:

Code: Select all

[]
Great.
BTW, I┬┤m buying you a beer + pizza for the great work you put into this plugin! Thank you!
Nice, I was getting a bit hungry. :D

jonib

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Posted: Fri May 30, 2014 7:01 am
by gechu
:)

Need to implement some sort of smart pause-function that would only trigger an XBMC pause command if a video or music is playing.

First I run "Player.GetActivePlayers" with the "[]" parameters to retrieve the current player in an event payload: eg.result[0]["playerid"]

To embed that Python variable in an JSON call, I noticed that you┬┤ve built a function to seaches for "{{" called "def ParseString2(text, filterFunc=None):". Problem seems to be that the ParseString2 isn┬┤t getting called, because when I run "Player.GetProperties" with the string:

Code: Select all

{ "playerid":{{eg.result[0]["playerid"]}}, "properties": ["speed"]}
The dynamic part isn┬┤t correcly evaluated to the value received in the previous call to "Player.GetActivePlayers".

This is the trace:

Code: Select all

08:23:17   Traceback (most recent call last) (1640):
08:23:17     File "C:\Program Files Portable\EventGhost\eg\Classes\TaskletDialog.py", line 59, in ProcessingTask
08:23:17       self.Configure(*args, **kwargs)
08:23:17     File "C:\Program Files Portable\EventGhost\eg\Classes\ConfigDialog.py", line 165, in Configure
08:23:17       treeItem.Configure(*args)
08:23:17     File "C:\Program Files Portable\EventGhost\eg\Classes\ActionItem.py", line 101, in Configure
08:23:17       return self.executable.Configure(*args)
08:23:17     File "C:\Program Files Portable\EventGhost\plugins\XBMCRepeat\__init__.py", line 1144, in Configure
08:23:17       if 'jsonrpc' in json.loads(textControl2.GetValue()):
08:23:17     File "json\__init__.pyc", line 307, in loads
08:23:17     File "json\decoder.pyc", line 319, in decode
08:23:17     File "json\decoder.pyc", line 336, in raw_decode
08:23:17     File "json\scanner.pyc", line 55, in iterscan
08:23:17     File "json\decoder.pyc", line 183, in JSONObject
08:23:17     File "json\scanner.pyc", line 55, in iterscan
08:23:17     File "json\decoder.pyc", line 171, in JSONObject
08:23:17   ValueError: Expecting property name: line 1 column 14 (char 14)
Now I┬┤m using the latest version of the plugin. Any ideas of where the issue may lie?

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Posted: Fri May 30, 2014 5:14 pm
by jonib
gechu wrote:The dynamic part isn┬┤t correcly evaluated to the value received in the previous call to "Player.GetActivePlayers".
Try this:

Code: Select all

{{eg.result[0]['playerid']}},['speed']
It works for me, but I'm having a weird lock up problem editing the parameter so I will have to look into it.

jonib

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Posted: Fri Jun 06, 2014 10:12 pm
by Pliind
Hey guys!

I'm using XBMC with a plugin called Plexbmc. So i'm using my plexserver with xbmc.

I've got basicly everything working in the plugin except for "get current playing filename"

This is my error.

Code: Select all

   Error in Action: "XBMC2: GetCurrentlyPlayingFilename"
   Traceback (most recent call last) (1640):
     File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
       return self(*args)
     File "C:\Program Files (x86)\EventGhost\plugins\XBMCRepeat\__init__.py", line 690, in __call__
       responce = self.plugin.JSON_RPC.send('Player.GetActivePlayers')
     File "C:\Program Files (x86)\EventGhost\plugins\XBMCRepeat\__init__.py", line 681, in send
       return json.loads(responce)
     File "json\__init__.pyc", line 307, in loads
     File "json\decoder.pyc", line 319, in decode
     File "json\decoder.pyc", line 338, in raw_decode
   ValueError: No JSON object could be decoded
Is this because XBMC just as Plex has no idea what it is currently playing? there is no "filename" because it's on the plexserver?

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Posted: Fri Jun 06, 2014 10:55 pm
by jonib
Pliind wrote:I've got basicly everything working in the plugin except for "get current playing filename"
It hasn't worked for a while I will probably remove it in the next release. You will need to use the JSON-RPC actions to get the filename.

jonib

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Posted: Fri Jun 06, 2014 11:12 pm
by Pliind
jonib wrote:
Pliind wrote:I've got basicly everything working in the plugin except for "get current playing filename"
I hasn't worked for a while I will probably remove it in the next release. You will need to use the JSON-RPC actions to get the filename.

jonib
Yeah i did a bit of back-tracking in the thread, so Iv'e also updated my plugin.

Could I ask you for the code to put into JSON-RPC to get "playing now"? i've tried the scripts found further back but i keep getting errors :( connection seams fine, if i pause or press play in XBMC my EG log shows currently playing.

(why i want currently playing in plain text is because i want to display this on my iMon display)

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Posted: Sat Jun 07, 2014 9:55 pm
by Pliind
Ok so i finally found the solution to getting what's being played printed.


Anyways here it is for anybody looking.

Code: Select all

PlayerID = eg.plugins.XBMC2.JSONRPC(u'Player.GetActivePlayers', u'', False)[0]['playerid']
eg.result = eg.plugins.XBMC2.JSONRPC(u'Player.GetItem', u"["+str(PlayerID)+",['title']]", False)
(Thanks Jonib @ page 51)

i made a slight change so i only get title back.

This is what is output to the log.

Code: Select all

   {u'item': {u'title': u'', u'type': u'unknown', u'label': u'filename.mp4'}}
So the scriptkiddy that i am, managed to do this. Hopefully some other's might find something usefull
Make a Python Script.
So there might be 1000 ways to do this easier, but yeah I'm a noob so deal with it :) oh and im using PleXBMC so my settings might not fit all. (it's the split that determins what you crop and filter kinda)

Code: Select all

PlayerID = eg.plugins.XBMC2.JSONRPC(u'Player.GetActivePlayers', u'', False)[0]['playerid']
eg.result = eg.plugins.XBMC2.JSONRPC(u'Player.GetItem', u"["+str(PlayerID)+",['title']]", False)
print eg.result

b = str(eg.result)
b = b.split(" ",6)
playing=b[6]
eg.globals.playing = playing
print eg.globals.playing

c = str(eg.globals.playing)
c = c.split("'",10)
title=c[3]
eg.globals.title = title
print eg.globals.title

d = str(eg.globals.title)
d = d.split(".")
show=d[0]
eg.globals.show = show
print eg.globals.show

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Posted: Tue Jul 08, 2014 4:19 pm
by MikeD82
Need some help running the following Json url command in the plugin.

http://192.168.1.20:8080/jsonrpc?reques ... sume":true}}}

I can get the file to play by running:
JSONRPC Namespace:Player Method:Open
[{"file":"{{eg.globals.playing}}"}]

eg.globals.playing=file path

That starts the video at the beginning. I would like to resume the video or atleast ask me if I would like to resume the movie.

Any ideas?

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Posted: Thu Jul 10, 2014 2:40 pm
by jonib
MikeD82 wrote:Need some help running the following Json url command in the plugin.

http://192.168.1.20:8080/jsonrpc?reques ... sume":true}}}

I can get the file to play by running:
JSONRPC Namespace:Player Method:Open
[{"file":"{{eg.globals.playing}}"}]

eg.globals.playing=file path

That starts the video at the beginning. I would like to resume the video or atleast ask me if I would like to resume the movie.

Any ideas?
I'm having big PC related problems at the moment so can't do any real development/debugging, I don't even get e-mails correctly. :cry:

I think this should be the correct syntax, but I think there is a problem in the plugin so it might not work even if it's "correct":

Code: Select all

[{"file":"{{eg.globals.playing}}","options":{"resume":true}}]
Unfortunately I have no idea when I might be able to look into/fix any related problems.

jonib

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Posted: Sat Aug 02, 2014 7:03 am
by steve1977
I'll be making another attempt to use and configure the remote. What would be the latest version? Is the one included in the June version of EG the latest? Thanks in advance!

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Posted: Tue Aug 19, 2014 5:12 pm
by jonib
steve1977 wrote:I'll be making another attempt to use and configure the remote. What would be the latest version? Is the one included in the June version of EG the latest? Thanks in advance!
Very sorry for the late reply.
0.6.14 is included with EventGhost.
I don't think I have made any changes/fixes for the apple remote.

jonib

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Posted: Tue Sep 02, 2014 2:33 am
by simonturk
Hi Guys,

Sorry for jumping on your thread but hoping you can help me - and then I can get out of your hair!

When using XBMC2 commands i.e. Open Window: Movies no control is passed to XBMC. I used the XBMC Log to track JSON and nothing was logged. To make sure I would see something logged I performed the same command with an iPhone app and sure enough the JSON is registered by XBMC.

So, after many hours pulling my hair out (not complaining I think you do a great job) I found that if i manually send the command using your experimental action "Send Any JSON" I can get it to work.

It seems to me there is some problem sending JSON with the builtin commands? My work around is OK but it is slow going, and kind of defeats the purpose of the plugin.

Any idea on what the problem may be?

Machine: Windows 7
XBMC: Gotham (cna't remember exact version at the moment)

Thanks,

Simon