Jump to content


Photo

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

automation custom scripts delete movie

  • Please log in to reply
39 replies to this topic

#21 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 157008 posts
  • Local time: 08:23 AM

Posted 04 February 2019 - 10:52 AM

A plugin could provide this feature.
  • Anthony.Musgrove likes this

#22 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4732 posts
  • Local time: 08:23 AM
  • LocationPeterborough, Canada

Posted 04 February 2019 - 12:07 PM

You lead Devs are tricky... tricky. Plugin Architecture has changed again.

 

No more showing <script> tags in html to call the corresponding js files. instead, you are using "__plugin/" in a data-controller attribute. I think.... I hope....



#23 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4732 posts
  • Local time: 08:23 AM
  • LocationPeterborough, Canada

Posted 04 February 2019 - 12:56 PM

Okay, fellas. This is what  I got so far. 

 

 

Attached File  examplescriptorific.png   85.64KB   10 downloads

 

 


  • Zodler and booch like this

#24 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4732 posts
  • Local time: 08:23 AM
  • LocationPeterborough, Canada

Posted 04 February 2019 - 03:17 PM

Okay, got the UI working... Finally... Geesh... Next is to wire up the backend.

I hope process.start works in .netcore...

#25 Zodler OFFLINE  

Zodler

    Advanced Member

  • Members
  • 152 posts
  • Local time: 02:23 PM

Posted 09 February 2019 - 01:37 PM

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?



#26 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4732 posts
  • Local time: 08:23 AM
  • LocationPeterborough, Canada

Posted 09 February 2019 - 04:13 PM

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.


  • Zodler likes this

#27 booch OFFLINE  

booch

    Advanced Member

  • Members
  • 41 posts
  • Local time: 02:23 PM
  • LocationOdessa, Ukraine

Posted 10 February 2019 - 06:13 AM

@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, 10 February 2019 - 06:19 AM.


#28 booch OFFLINE  

booch

    Advanced Member

  • Members
  • 41 posts
  • Local time: 02:23 PM
  • LocationOdessa, Ukraine

Posted 10 February 2019 - 06:18 AM

deleted

Edited by booch, 10 February 2019 - 06:20 AM.


#29 Zodler OFFLINE  

Zodler

    Advanced Member

  • Members
  • 152 posts
  • Local time: 02:23 PM

Posted 11 February 2019 - 08:54 AM

Is there a separate thread for this plugin? I think you should create a thread for it. When will you add the delete event?



#30 WilhelmStroker OFFLINE  

WilhelmStroker

    Advanced Member

  • Members
  • 367 posts
  • Local time: 01:23 PM

Posted 21 September 2019 - 08:34 AM

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.



#31 toffee_123 OFFLINE  

toffee_123

    Member

  • Members
  • 16 posts
  • Local time: 01:23 PM

Posted 07 April 2020 - 07:24 AM

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.



#32 Anthony.Musgrove ONLINE  

Anthony.Musgrove

    Advanced Member

  • Members
  • 237 posts
  • Local time: 10:23 PM
  • LocationNewcastle, NSW, Australia

Posted 07 April 2020 - 09:24 AM

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



#33 Anthony.Musgrove ONLINE  

Anthony.Musgrove

    Advanced Member

  • Members
  • 237 posts
  • Local time: 10:23 PM
  • LocationNewcastle, NSW, Australia

Posted 07 April 2020 - 09:46 AM

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

 

5e8c842dcd053_EmbyScripterX.png


  • Floflobel likes this

#34 Anthony.Musgrove ONLINE  

Anthony.Musgrove

    Advanced Member

  • Members
  • 237 posts
  • Local time: 10:23 PM
  • LocationNewcastle, NSW, Australia

Posted 07 April 2020 - 10:54 AM

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.


#35 maegibbons OFFLINE  

maegibbons

    Advanced Member

  • Members
  • 2891 posts
  • Local time: 01:23 PM
  • LocationLutterworth, England, UK

Posted 07 April 2020 - 11:42 AM

Excellent work!

Cant wait to test it!

Krs

Mark

Sent from my SM-N976B using Tapatalk

#36 Anthony.Musgrove ONLINE  

Anthony.Musgrove

    Advanced Member

  • Members
  • 237 posts
  • Local time: 10:23 PM
  • LocationNewcastle, NSW, Australia

Posted 07 April 2020 - 09:17 PM

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

 

5e8d260c4ae95_configscreen.png

 

 

5e8d261809621_working.png



#37 Anthony.Musgrove ONLINE  

Anthony.Musgrove

    Advanced Member

  • Members
  • 237 posts
  • Local time: 10:23 PM
  • LocationNewcastle, NSW, Australia

Posted 07 April 2020 - 10:54 PM

V1.0.0 (BETA) done.  https://github.com/A.../Emby-ScripterX

 

:)


  • neik likes this

#38 Anthony.Musgrove ONLINE  

Anthony.Musgrove

    Advanced Member

  • Members
  • 237 posts
  • Local time: 10:23 PM
  • LocationNewcastle, NSW, Australia

Posted 23 April 2020 - 12:43 PM

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/c...cripterx/page-1

Website:  https://emby-scripterx.info

GitHub Wiki:  https://github.com/A...-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


  • ginjaninja likes this

#39 ginjaninja OFFLINE  

ginjaninja

    Advanced Member

  • Members
  • 1851 posts
  • Local time: 01:23 PM
  • Locationuk

Posted 23 April 2020 - 02:13 PM

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?


  • Anthony.Musgrove likes this

#40 Anthony.Musgrove ONLINE  

Anthony.Musgrove

    Advanced Member

  • Members
  • 237 posts
  • Local time: 10:23 PM
  • LocationNewcastle, NSW, Australia

Posted 25 April 2020 - 02:44 AM

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/c...emby-scripterx/

 

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







Also tagged with one or more of these keywords: automation, custom scripts, delete movie

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users