[RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...)

  Thread Rating:
  • 4 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
ReplayHarry Offline
Junior Member
Posts: 42
Joined: Feb 2014
Reputation: 0
Post: #226
Ok, thanks.
Actually I do need filename and title, but I will install this and see what happens, then I can always go back.
Won't be able to try till tomorrow mornings "Good Day".
Question: Would this affect getting filename and title in this particular circumstance (not getting filename or title) or all? If it just affects this one, then I could probably live with it.
I sure appreciate your assistance. I'll get back to you tomorrow.
find quote
KenV99 Offline
Senior Member
Posts: 291
Joined: Nov 2013
Reputation: 9
Post: #227
It's only happening when you are getting the error. Even though Kodi is triggering the script that playback has started, it is not able to retrieve either the filename or title at that point. This is the first that I am hearing of this issue and should only affect this circumstance with comskip as far as I can tell.
find quote
ReplayHarry Offline
Junior Member
Posts: 42
Joined: Feb 2014
Reputation: 0
Post: #228
(2015-05-26 20:01)KenV99 Wrote:  It's only happening when you are getting the error. Even though Kodi is triggering the script that playback has started, it is not able to retrieve either the filename or title at that point. This is the first that I am hearing of this issue and should only affect this circumstance with comskip as far as I can tell.

Success! It worked perfect this morning.

Thanks again for your help above and beyond. This addon has been a big help to me and appreciate your designing and coding it. You're an artist.
find quote
KenV99 Offline
Senior Member
Posts: 291
Joined: Nov 2013
Reputation: 9
Post: #229
(2015-05-27 15:38)ReplayHarry Wrote:  
(2015-05-26 20:01)KenV99 Wrote:  It's only happening when you are getting the error. Even though Kodi is triggering the script that playback has started, it is not able to retrieve either the filename or title at that point. This is the first that I am hearing of this issue and should only affect this circumstance with comskip as far as I can tell.

Success! It worked perfect this morning.

Thanks again for your help above and beyond. This addon has been a big help to me and appreciate your designing and coding it. You're an artist.

No problem, glad it's working now.
find quote
GriffeyJuni0r Online
Member
Posts: 64
Joined: Oct 2011
Reputation: 0
Post: #230
Love this service -

Is there a way to set an action to run only when a Smart Playlist plays?

I have an action working on the regular Playback event, but would love to restrict this to only Smart Playlists.

Thanks!
find quote
KenV99 Offline
Senior Member
Posts: 291
Joined: Nov 2013
Reputation: 9
Post: #231
(2015-06-06 07:48)GriffeyJuni0r Wrote:  Love this service -

Is there a way to set an action to run only when a Smart Playlist plays?

I have an action working on the regular Playback event, but would love to restrict this to only Smart Playlists.

Thanks!

In short, no not directly. Looking through the Kodi Pydocs, there is no easy way to discover from the playing item if it is playing from a smart playlist.
There might be a way using JSON but I'll leave that for your own exploration.
find quote
tekno Offline
Senior Member
Posts: 216
Joined: Feb 2012
Reputation: 1
Post: #232
I just tried this on Raspberry Pi 2 running OSMC and the script never runs. I have executable permissions. Is there some dependency? I have great success on 64 bit ubuntu , but not on Pi 2 with OSMC
find quote
KenV99 Offline
Senior Member
Posts: 291
Joined: Nov 2013
Reputation: 9
Post: #233
(2015-06-22 21:52)tekno Wrote:  I just tried this on Raspberry Pi 2 running OSMC and the script never runs. I have executable permissions. Is there some dependency? I have great success on 64 bit ubuntu , but not on Pi 2 with OSMC

If you installed my version from GitHub there aren't any dependencies.

As always, a log uploaded to pastebin or similar and linked here is really the only way to provide any assistance.
find quote
tekno Offline
Senior Member
Posts: 216
Joined: Feb 2012
Reputation: 1
Post: #234
Thanks KenV99,

I have been using this older version for some time and was unaware of a newer fork.

this newer version works great. Good work.

Mark
find quote
ReplayHarry Offline
Junior Member
Posts: 42
Joined: Feb 2014
Reputation: 0
Post: #235
Ken: My little script has been working just fine for awhile now, but today on my desktop (my test machine before I put changes on my HTPC) I started to get script errors on the callback2 addon. See below.
21:53:12 T:1892 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.ImportError'>
Error Contents: No module named requests2
Traceback (most recent call last):
File "C:\Users\Harry\AppData\Roaming\Kodi\addons\service.xbmc.callbacks2-master\default.py", line 46, in <module>
import requests2 as requests
ImportError: No module named requests2
-->End of Python script error report<--
I had been modifying my script for some "cosmetic" issues and testing the changes. Out of nowhere this comes up. I made no modifications to your script, but since I installed Helix since I put your last fix in, I was thinking maybe that was it.
Any ideas? What kind of additional info might you need.

Thanks for any help you may give. If worst comes to worst I will just re-install the addon and start from scratch I guess.
find quote
spoyser Offline
Donor
Posts: 637
Joined: Oct 2011
Reputation: 30
Post: #236
Is it missing an import request2?
find quote
ReplayHarry Offline
Junior Member
Posts: 42
Joined: Feb 2014
Reputation: 0
Post: #237
I looked at the code and it has IMPORT REQUESTS2 as REQUESTS
But the question is what happen to the REQUEST2 module and how do I get it back? As it appears it isn't finding it all of a sudden.

----UPDATE
Since I was awake anyway, I decided to put my new code (my script that works with callback2) on my HTPC. Of course I renamed my old code to oldxxxx.py so I could go back to it. It worked fine over there and no "script error" for callback2 when I started up Kodi.
So all I can figure out is that someway the REQUEST2 module got zapped when I was testing my code on my desktop.
So if I can get it back, all should be normal again.
Do I just pip it back? I know how to do that on Python in general, but how do I get it back into Kodi's python.

--update 6/26/2015
uninstalled callback2 addon and re-installed and all is working fine again.
(This post was last modified: 2015-06-27 02:36 by ReplayHarry.)
find quote
Post Reply