Jump to content

Allow to execute custom scripts on Emby events (e.g. on movie delete action)


booch

Recommended Posts

Just downloaded and added this plugin. Before I can write scripts, this only works for 4 events, right? Playback Started, Stopped, Session Started, Updated?

 

In that case, it is not useful for me. Can you add something for deletion?

 

 

Yes, I'll add every event I can add.

  • Like 1
Link to comment
Share on other sites

@@chef

 

Thanks for working on this plugin!

 

Before going further, my script should ‘know’ what exactly was deleted. Is it possible to retrieve path of the deleted item (movie/tvshow/etc.) from performed delete event and pass it as first argument to my script?

 

I think also for the other events would be nice to pass appropriate arguments to scripts (e.g. name of the item for Playback Started event, number of updated items for Update event, etc.)

 

In the Script Arguments field it can be reserved words for passed arguments from performed events like $ITEM_PATH$, $ITEM_NAME, $NUM_OF_ITEMS$, etc

Edited by booch
Link to comment
Share on other sites

  • 7 months later...
WilhelmStroker

Is this plugin still being developed? I'm looking for a way to kick off a powershell script that stops Deluge downloads when a stream starts on Emby, and that restarts the downloads when the stream stops. This is fairly easy in Tautulli for Plex.

Link to comment
Share on other sites

  • 6 months later...
toffee_123

Hi, is this still being maintained? I have tried installing the plugin dll, and I can get the config page but it doesn't seem to save my scripts.

Link to comment
Share on other sites

Anthony Musgrove

I'm now writing a new plugin to do this, bare with me.  It will be called Emby ScripterX ... coding it now.

Link to comment
Share on other sites

Anthony Musgrove

So far ...  (Just got to wire it all up!)

 

5e8c842dcd053_EmbyScripterX.png

  • Like 1
Link to comment
Share on other sites

Anthony Musgrove

Coming together nicely;

 

5e8c9427d9e08_embyscripterxlogo.png

 

Media Item
==========
%item.name%
%item.id%
%item.path%
%item.album%
%item.albumid%
%item.mediatype%
%item.originaltitle%
%item.tagline%
%item.overview%
 
Authentication Item  (Success)
===================
%username%
%user.id%
%server.name%
%server.id%
%device.id%
%device.name%
 
Authentication Item  (Fail)
===================
%username%
%user.id%
%device.id%
%device.name%
%password%
%remote.endpoint%
 
Session Item
============
%user.id%
%username%
%device.id%
%device.name%
%server.id%
 
 
 
2020-04-08 00:39:46.881 Info Emby ScripterX: EmbyScripterX : onPlaybackStopped: 1917 - D:\Media\Movies\1917.2019.1080p.BluRay.x264.AAC5.1-[YTS.MX] - Copy - Copy - Copy.mp4 - Anthony - Firefox
2020-04-08 00:39:39.747 Info Emby ScripterX: EmbyScripterX : onPlaybackStart: 1917 - D:\Media\Movies\1917.2019.1080p.BluRay.x264.AAC5.1-[YTS.MX] - Copy - Copy - Copy.mp4 - Anthony - Firefox
 
2020-04-08 00:41:12.619 Info Emby ScripterX: EmbyScripterX : onSessionStarted: Anthony - Chrome
2020-04-08 00:41:12.620 Info Emby ScripterX: EmbyScripterX : onSessionEnded: Anthony - Chrome
 
2020-04-08 00:45:19.347 Info Emby ScripterX: EmbyScripterX : onAuthenticationFailed: Anthony - 0 - 76c273ba-b74f-471d-92d3-0b6a0306da62 - Chrome - <passwordspecified>
2020-04-08 00:46:14.095 Info Emby ScripterX: EmbyScripterX : onAuthenticationSucceeded: Anthony - 451d9307-fc11-43e6-adc1-f016986d8986 -  - 321ed03a69f0474a880b1386b0c8f99d - 76c273ba-b74f-471d-92d3-0b6a0306da62 - Chrome
 
2020-04-08 00:48:21.457 Info Emby ScripterX: EmbyScripterX : onItemAdded: The Simpsons S23X01 2 Maggie Simpson in The Longest Daycare - D:\Media\Movies\The Simpsons S23X01 2 Maggie Simpson in The Longest Daycare.mp4
2020-04-08 00:48:23.473 Info Emby ScripterX: EmbyScripterX : onItemUpdated: The Simpsons S23X01 2 Maggie Simpson in The Longest Daycare - D:\Media\Movies\The Simpsons S23X01 2 Maggie Simpson in The Longest Daycare.mp4
2020-04-08 00:50:51.627 Info Emby ScripterX: EmbyScripterX : onItemRemoved: The Simpsons S23X01 2 Maggie Simpson in The Longest Daycare - D:\Media\Movies\The Simpsons S23X01 2 Maggie Simpson in The Longest Daycare.mp4
 
 
Configuration:
 
5e8c93df9f8c3_embyscripterxconfigandwork
 
Now all I need to do is figure out the best way to run whatever is in the textbox in a worker thread/external thread and then this plugin is fully complete.
Link to comment
Share on other sites

maegibbons

Excellent work!

 

Cant wait to test it!

 

Krs

 

Mark

 

Sent from my SM-N976B using Tapatalk

Link to comment
Share on other sites

Anthony Musgrove

Thank you maegibbons :) It's coming together nicely.  Almost finished.

 

5e8d260c4ae95_configscreen.png

 

 

5e8d261809621_working.png

Link to comment
Share on other sites

  • 3 weeks later...
Anthony Musgrove

Thank you so much for such a warm welcome into this amazing community.

 

Wow, hasn't a lot changed since 8th of April.   You'll now see 'Emby Scripter-X' in your Plugins Catalog under 'General'.  Enjoy, test, make it do amazing things and share it with everyone.  I can't wait to see the creativity that comes out of this.

 

5ea1c5b204a82__cat_thumb.png

 

Some important links:

 

The entire DEV forum thread for this plugin: https://emby.media/community/index.php?/topic/84816-new-plugin-custom-scripting-emby-scripterx/page-1

Website:  https://emby-scripterx.info

GitHub Wiki:  https://github.com/AnthonyMusgrove/Emby-ScripterX/wiki

 

If you find any bugs or issues or have any feature requests, log them in the GitHub Issues section for me, and I'll push through them as I can!

 

Warmest regards as always,

Anthony

  • Like 1
Link to comment
Share on other sites

ginjaninja

thanks for the plugin Anthony,

 

Do you happen to know, if we wanted the invoked script to do some "emby action" is there a published way to send commands to emby  from a common windows scripting interface eg, run Emby scheduled scheduled task "XYZ" "mark item unwatched" "remove playback bookmark"

does emby have a windows executable which takes arguments or is there a easy published way to leverage the api without being a master programmer.

i can just about script with arguments but making an app to send http to emby is somewhat too complicated for me.

 

is it worth submitting a feature request for onwatched (not just played but completed)..is such an event feasible to monitor?

  • Like 1
Link to comment
Share on other sites

Anthony Musgrove

thanks for the plugin Anthony,

 

Do you happen to know, if we wanted the invoked script to do some "emby action" is there a published way to send commands to emby  from a common windows scripting interface eg, run Emby scheduled scheduled task "XYZ" "mark item unwatched" "remove playback bookmark"

does emby have a windows executable which takes arguments or is there a easy published way to leverage the api without being a master programmer.

i can just about script with arguments but making an app to send http to emby is somewhat too complicated for me.

 

is it worth submitting a feature request for onwatched (not just played but completed)..is such an event feasible to monitor?

 

Absolutely!  This gave me an awesome idea, thank you - I've been working on implementing this for a day now, could you please check out the LAST post of my Plugin's DEV thread here: https://emby.media/community/index.php?/topic/84816-new-plugin-custom-scripting-emby-scripterx/

 

And let me know if this is where you're thinking of it heading.  Thank you!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...