Jump to content
Anthony Musgrove

New Plugin - Custom Scripting | Emby ScripterX

Recommended Posts

PenkethBoy

For those who might want to test this plugin with Powershell (works with PS5 and PS7(core))

 

I am assuming you are familiar with using Powershell - if not google is your friend - dont want to pollute this thread with PS questions!

 

Zip Containing the script and an example log file

 

PS Test Script.zip

 

Example of how to fill in the options in ScripterX config page

 

5e9f520bc1dfc_Annotation20200421210312.j

 

Note1 - not all the ScripterX variables above are included in " " - depends on the variable - if more than one word/number then include the " " around the variable - if not sure include the " " or experiment :)

Note2 - as powershell.exe and pwsh.exe are on the windows path variable by default you don't need to specify the full path to the exe

Note3 - .exe is not required either - see MediaItemRemoved above

Note4 - don't forget to add -File before the path to the ps1 file.

 

The script above is very basic but will give you a Test.log file in the same location as the script is located. See Test.log file in the zip for example output.

 

Have Fun

  • Like 2

Share this post


Link to post
Share on other sites
Anthony Musgrove

For those who might want to test this plugin with Powershell (works with PS5 and PS7(core))

 

I am assuming you are familiar with using Powershell - if not google is your friend - dont want to pollute this thread with PS questions!

 

Zip Containing the script and an example log file

 

attachicon.gifPS Test Script.zip

 

Example of how to fill in the options in ScripterX config page

 

5e9f520bc1dfc_Annotation20200421210312.j

 

Note1 - not all the ScripterX variables above are included in " " - depends on the variable - if more than one word/number then include the " " around the variable - if not sure include the " " or experiment :)

Note2 - as powershell.exe and pwsh.exe are on the windows path variable by default you don't need to specify the full path to the exe

Note3 - .exe is not required either - see MediaItemRemoved above

Note4 - don't forget to add -File before the path to the ps1 file.

 

The script above is very basic but will give you a Test.log file in the same location as the script is located. See Test.log file in the zip for example output.

 

Have Fun

 

 

You are quite simply an absolute legend mate, thank you so so so much!

 

I'm taking on board everything you've said so far!!

  • Like 1

Share this post


Link to post
Share on other sites
Anthony Musgrove
Posted (edited)

Some more events that we can utilise, input on usability/usefulness/viability is appreciated.  Which should we utilise?

 

Installation Manager:

  • PackageInstallationCancelled
  • PackageInstallationCompleted
  • PackageInstallationFailed
  • PackageInstalling
  • PluginInstalled
  • PluginUninstalled
  • PluginUpdated
 

User Manager:

  • UserCreated
  • UserConfigurationUpdated
  • UserDeleted
  • UserLockedOut
  • UserPasswordChanged
  • UserPolicyUpdated
  • UserUpdated
 

Application Host Manager:

  • ApplicationUpdated
  • HasPendingRestartChanged 
  • HasUpdateAvailableChanged
     
 Collection Manager:
  • CollectionCreated
  • ItemsAddedToCollection
  • ItemsRemovedFromCollection

 Task Manager:
  • TaskExecuting
  • TaskCompleted
Edited by Anthony.Musgrove
  • Like 1

Share this post


Link to post
Share on other sites
PenkethBoy

Ha - well the simple answer would be all of them :)

 

If i had to put them in order for me

 

1. Recording Events (dvr) i mentioned a couple of days ago

2. Task Manager

3.1 Application Host Manager

3.2 Installation Manager

4 User Manager

5 Collection Manager

  • Like 1

Share this post


Link to post
Share on other sites
Anthony Musgrove

Thank you mate, I'm still poking around in the SDK for everything required for accurate DVR monitoring - it's going well.  

I've also repaired the issue relating to %item.library.*% tokens being empty on delete; issue log: https://github.com/AnthonyMusgrove/Emby-ScripterX/issues/2

 

I'll upload the newest version dll to Github now :) It will be 2.1.3

Share this post


Link to post
Share on other sites
Anthony Musgrove

Thank you so much to everyone who has contributed to this plugin so far; especially and by far @@PenkethBoy who has reached far and beyond to ensure success, creating Powershell tutorials, thorough testing and ideas; this plugin is not only my creation but also his.

 

And a very special thank you to @@Luke and @@ebr for allowing me to publish this plugin in the Emby Plugin catalog - which you can now use to install this plugin (it is under the 'General' category).

 

Warmest regards,

Anthony

  • Like 2

Share this post


Link to post
Share on other sites
Spaceboy

Thank you so much to everyone who has contributed to this plugin so far; especially and by far @@PenkethBoy who has reached far and beyond to ensure success, creating Powershell tutorials, thorough testing and ideas; this plugin is not only my creation but also his.

 

And a very special thank you to @@Luke and @@ebr for allowing me to publish this plugin in the Emby Plugin catalog - which you can now use to install this plugin (it is under the 'General' category).

 

Warmest regards,

Anthony

well done all!
  • Like 1

Share this post


Link to post
Share on other sites
Anthony Musgrove
Posted (edited)

Hi guys, I know I've been quiet- but I have been working my butt off on some functionality that was asked of ScripterX that I found would be extremely useful; however I'd like to put it to the Emby Community to get feedback before it's implemented in a BETA release.

 

Proof of concept; Emby Scripter-X API

 

Proposal:   Scripter-X provides a means for the developer to execute various actions based on an event occurring in Emby.  But what if the developer needs to request Emby to do something?  What if the developer needs more information on a specific entity?

 

Here’s where Scripter-X’s Scripting API comes into it.

Configurable values:

Enable/Disable Emby Scripter-X API
Specify Emby Scripter-X API Instance ID (ie, Named Pipe name)

Compatibility

Tested as compatible with both Linux and Windows.
Windows – Powershell Scripting etc
Linux – A small command line utility to read and write from pipes

Security

Up for discussion.  Currently user@password level definitions, however could be discussed further.  The reason for named pipe is that it can only be used on the server host computer, so minimizes security issues of being accessible remotely; only limited commands will be exposed by the API, also preventing any security issues.

 

Protocol so far

 

Packet format:   user@pwd|commandparts|parameters

 

Proposed Commands

APPHOST

apphost:get_app_ver                   - Get Emby Server Version.
apphost:restart                             - Restart Emby Server.
apphost:shutdown                       - Shutdown Emby Server.

 

 

 

DEVICE MANAGER

device:getbyid|deviceId              - Get information about a device.
device:getoptionsbyid|deviceId  - Get device options information about a device.

 

LIBRARY MANAGER

library:getitembyid|itemID – Get an Item by Id

library:getroot – Get the root folder for server libraries

 

LOGGER

logger:info|Message – Add an Info log entry to Emby Server Log

logger:error|Message – Add an Error  log entry to Emby Server Log

logger:debug|Message – Add a Debug log entry to Emby Server Log
 

SESSION MANAGER

session:msg|id|message – Send a message to an active session

session:msgrestart|id – Send restart message to an active session

 

USER MANAGER

user:getbyid|userid– Get user object by id

user:changepwd|params– Change a users password

user:create|params– Create a user

user:delete|params– Delete a user

user:getbyname|name– Get user object by name

user:resetpwd|params– Reset a users password

 

EXAMPLE of this API working in its current implementation

PS D:\scripterx_powershell_named_test> .\test1.ps1
Root Directory: result|library:getroot|C:\Users\Anthony\AppData\Roaming\Emby-Server\programdata\root\default

 

 

 

test1.ps1 powershell script that achieved this:

param ($ComputerName = '.')

$npipeClient = new-object System.IO.Pipes.NamedPipeClientStream($ComputerName, 'scripterx01', [System.IO.Pipes.PipeDirection]::InOut, [System.IO.Pipes.PipeOptions]::None, [System.Security.Principal.TokenImpersonationLevel]::Impersonation)

$pipeReader = $pipeWriter = $null

try {
   $pipeReader = new-object System.IO.StreamReader($npipeClient)
   $pipeWriter = new-object System.IO.StreamWriter($npipeClient)  
   $npipeClient.Connect()
   $pipeWriter.AutoFlush = $true
   $pipeWriter.WriteLine("user@pwd|library:getroot")
   $root_dir = $pipeReader.ReadLine()
   'Root Directory: ' + $root_dir
}

finally {
    $npipeClient.Dispose()
}

We could obviously create a common powershell script for the api client-side to modularize it in your own scripts.

 

Some usecases;

Developer wants to write a script to create a User on request by simply using command line, rather than the Emby Api

 

Developer wants to restart the emby server after a particular action was executed; they can do this within their Action’s called powershell script etc, by invoking the Api and sending a apphost:restart command, etc.

 

Possibilities are limitless, however I’d like to discuss its viability, suitability, functionality, security etc.

Edited by Anthony.Musgrove
  • Like 3

Share this post


Link to post
Share on other sites
Anthony Musgrove
Posted (edited)
API Looking amazing so far; 
 
Output:
PS D:\scripterx_powershell_named_test> .\test1.ps1                                                                     
Result: RESULT|LIBRARY|GETITEMBYID|662~1917~At the height of the First World War, two young British soldiers must cross enemy territory and deliver a message that will stop a deadly attack on hundreds of soldiers.~1917
 
Achieved with:
$pipeWriter.WriteLine("debug@debugpwd|library:getitembyid|662")
 
$api_call_result = $pipeReader.ReadLine()
 
'Result: ' + $api_call_result

 

 

 

 

PS D:\scripterx_powershell_named_test> .\test1.ps1                                                                     

Result: RESULT|APPHOST|GET_APP_VER|4.4.2.0

 

with

 

$pipeWriter.WriteLine("debug@debugpwd|apphost:get_app_ver")

Edited by Anthony.Musgrove

Share this post


Link to post
Share on other sites
PenkethBoy

Anthony

 

For me not sure this is needed as any script that currently gets output from you plugin can do all the above and more - or invoke a series of scripts depending on the event triggered - or invoke another interpreter to do something else etc etc

 

My take is that what you are suggesting is complicated and therefore subject to issues - as i dont follow from a quick look what that powershell script is trying to do

 

"But what if the developer needs to request Emby to do something?  What if the developer needs more information on a specific entity?" - thats what a script can do already

 

For example i have numerous scripts that use the Emby Api - and your plugin will allow me to call them after a specific event

Say i add a new Album to emby - i can capture the itemAdded event (would have to filter out numerous itemadded event as the songs are added- then wait for a period so all songs have been seen by emby) - the script them calls my EmbyAudPlaylist script which updates Artist Playlists - then calls my EmbyGenrePlaylist script to update my Genre Playlists etc etc

Dont need the Plugin to do that for me - actually i would have to write more code - with less control

 

Anyway my 2 pence worth

  • Like 1

Share this post


Link to post
Share on other sites
Anthony Musgrove

Thank you mate, that's what I needed to hear :)

  • Like 1

Share this post


Link to post
Share on other sites
Anthony Musgrove

One more thing, if you check out the custom scripting features in Plex, (plugin) they have configurable conditions too, check out:

 

https://github.com/Tautulli/Tautulli-Wiki/wiki/Custom-Notification-Conditions

 

So for example, on an Action, there could be a dropdown area for 'Conditions' where :-

 

On <event> WHERE <conditions> ... Then run this Action ..

 

for example... onPlaybackStart WHERE Media Item is in particular library etc.

 

What do you think - should I be looking at that too?

 

Thank you again mate :)

Share this post


Link to post
Share on other sites
PenkethBoy

Thank you mate, that's what I needed to hear :)

Sorry should have said - not trying to be negative - just cant see the benefits above what we have now :)

  • Like 1

Share this post


Link to post
Share on other sites
Anthony Musgrove

Sorry should have said - not trying to be negative - just cant see the benefits above what we have now :)

 

Absolutely mate and no negativity taken at all, I really appreciate the feedback because it can steer the development process to where it should be :)

  • Like 1

Share this post


Link to post
Share on other sites
PenkethBoy

One more thing, if you check out the custom scripting features in Plex, (plugin) they have configurable conditions too, check out:

 

https://github.com/Tautulli/Tautulli-Wiki/wiki/Custom-Notification-Conditions

 

So for example, on an Action, there could be a dropdown area for 'Conditions' where :-

 

On <event> WHERE <conditions> ... Then run this Action ..

 

for example... onPlaybackStart WHERE Media Item is in particular library etc.

 

What do you think - should I be looking at that too?

 

Thank you again mate :)

Again i think this is over complicating things and is potentially dangerous (yes a script can be as well - but the user needs more knowledge to be a dumbass) - and added for users who cant do scripts - want a "simple" for them solution - i.e. cant or wont learn.

 

E.g. A user sets up a "command" to do action X - forgets about it - then complains when he cant figure out why action x happens all the time - generate support noise

 

So a suggestion - if you want to add some of the above - put it in a dumbed down version of the plugin - with limited events/feature - as its potentially a powerful/dangerous tool - but you need to consider that 99% of admin users do not know how to script properly - see the trouble people had with the smart playlist plugin thread before they understood how to create complex queries (that plugin still has issues around the demands it makes on the server but thats internal to the plugin)

 

So my (selfish) vote is to finish adding the events to the existing plugin - so its stable and complete - then maybe revisit the additions above (although i dont think i will use them - currently - i might change my mind :)

 

:)

  • Like 1

Share this post


Link to post
Share on other sites
PenkethBoy

Anthony

 

I will write a PS script example of how to call existing scripts - i.e. a single script that ScripterX calls for all events and then calls the other PS scripts that do what is needed for eventX eventY etc - which gives people a clue on how to use the power you have provided etc

 

An Interpreter (master) script - i guess you would call it :)

 

Will do this in the next couple of days

  • Like 1

Share this post


Link to post
Share on other sites
Anthony Musgrove

Thats perfect mate thank you so much :)

 

I've cleaned the official codebase up, and I'm currently continuing to look into Live TV recording, DVR operations.

 

I'm trying to hook into something that I can define as 'onRecordingFinished', It may get to a point where I need to watch the recording folders for file changes yet, I'm still plugging away :)

Share this post


Link to post
Share on other sites
PenkethBoy

there is a post processing event that gets triggered currently to run the Post processing script - so might be an option - or less attractive - monitor the recording directory/directories - but thats a fudge

  • Like 1

Share this post


Link to post
Share on other sites
Anthony Musgrove

there is a post processing event that gets triggered currently to run the Post processing script - so might be an option - or less attractive - monitor the recording directory/directories - but thats a fudge

 

Yup!  thats the one I'm trying to find in the SDK :) Slowly plugging away in the core to find the right connections! 

Share this post


Link to post
Share on other sites
PenkethBoy
Posted (edited)
2020-04-25 14:00:35.868 Debug App: FFProbeProvider reports change to 76034 - F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts
2020-04-25 14:00:35.874 Debug App: Running FFProbeProvider for F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts
2020-04-25 14:00:35.874 Debug App: Running EpisodeNfoProvider for F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts
2020-04-25 14:00:35.875 Debug LibraryMonitor: New file refresher created for F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.nfo
2020-04-25 14:00:36.259 Info Emby ScripterX: onItemUpdated: -EventType "ItemUpdated" -Name "Ford Escort RS2000 Rally Car" -ID "76034" -Type "Episode" -LibName "Recorded Shows" -UpReason "None, MetadataImport"
2020-04-25 14:01:05.877 Debug LibraryMonitor: Timer stopped.
2020-04-25 14:01:05.878 Info LibraryMonitor: Season 12 (F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12) will be refreshed.
2020-04-25 14:01:05.997 Debug App: Refreshing F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts due to date modified change 1587819635 - 1587819665.
2020-04-25 14:01:05.997 Debug App: FFProbeProvider reports change to 76034 - F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts
2020-04-25 14:01:06.018 Debug App: Running FFProbeProvider for F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts
2020-04-25 14:01:06.018 Debug App: Running EpisodeNfoProvider for F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts
2020-04-25 14:01:06.019 Debug LibraryMonitor: New file refresher created for F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.nfo
2020-04-25 14:01:06.536 Info Emby ScripterX: onItemUpdated: -EventType "ItemUpdated" -Name "Ford Escort RS2000 Rally Car" -ID "76034" -Type "Episode" -LibName "Recorded Shows" -UpReason "None, MetadataImport"
2020-04-25 14:01:36.022 Debug LibraryMonitor: Timer stopped.
2020-04-25 14:01:36.025 Info LibraryMonitor: Season 12 (F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12) will be refreshed.
2020-04-25 14:01:36.141 Debug App: Refreshing F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts due to date modified change 1587819665 - 1587819696.
2020-04-25 14:01:36.141 Debug App: FFProbeProvider reports change to 76034 - F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts
2020-04-25 14:01:36.151 Debug App: Running FFProbeProvider for F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts
2020-04-25 14:01:36.151 Debug App: Running EpisodeNfoProvider for F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts
2020-04-25 14:01:36.151 Debug LibraryMonitor: New file refresher created for F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.nfo
2020-04-25 14:01:36.548 Info Emby ScripterX: onItemUpdated: -EventType "ItemUpdated" -Name "Ford Escort RS2000 Rally Car" -ID "76034" -Type "Episode" -LibName "Recorded Shows" -UpReason "None, MetadataImport"
2020-04-25 14:02:06.161 Debug LibraryMonitor: Timer stopped.
2020-04-25 14:02:06.164 Info LibraryMonitor: Season 12 (F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12) will be refreshed.
2020-04-25 14:02:06.277 Debug App: Refreshing F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts due to date modified change 1587819696 - 1587819726.
2020-04-25 14:02:06.277 Debug App: FFProbeProvider reports change to 76034 - F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts
2020-04-25 14:02:06.283 Debug App: Running FFProbeProvider for F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts
2020-04-25 14:02:06.283 Debug App: Running EpisodeNfoProvider for F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts
2020-04-25 14:02:06.283 Debug LibraryMonitor: New file refresher created for F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.nfo
2020-04-25 14:02:06.720 Info Emby ScripterX: onItemUpdated: -EventType "ItemUpdated" -Name "Ford Escort RS2000 Rally Car" -ID "76034" -Type "Episode" -LibName "Recorded Shows" -UpReason "None, MetadataImport"
2020-04-25 14:02:36.293 Debug LibraryMonitor: Timer stopped.
2020-04-25 14:02:36.296 Info LibraryMonitor: Season 12 (F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12) will be refreshed.
2020-04-25 14:02:36.413 Debug App: Refreshing F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts due to date modified change 1587819726 - 1587819756.
2020-04-25 14:02:36.413 Debug App: FFProbeProvider reports change to 76034 - F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts
2020-04-25 14:02:36.423 Debug App: Running FFProbeProvider for F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts
2020-04-25 14:02:36.423 Debug App: Running EpisodeNfoProvider for F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts
2020-04-25 14:02:36.423 Debug LibraryMonitor: New file refresher created for F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.nfo
2020-04-25 14:02:36.823 Info Emby ScripterX: onItemUpdated: -EventType "ItemUpdated" -Name "Ford Escort RS2000 Rally Car" -ID "76034" -Type "Episode" -LibName "Recorded Shows" -UpReason "None, MetadataImport"
2020-04-25 14:03:00.024 Info LiveTV: Recording stopped: F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts
2020-04-25 14:03:00.024 Info MediaSourceManager: Live stream native_aa5f9808f2b91371eef8adfc2200ac27_e5296b45f654e70c6090231b06155dd9 consumer count is now 0
2020-04-25 14:03:00.024 Info MediaSourceManager: Closing live stream 06044cf0e6f93cdae5f285c9ecfaaeb4_01413a525b3a9622ce6fdf19f7dde354_native_aa5f9808f2b91371eef8adfc2200ac27_e5296b45f654e70c6090231b06155dd9
2020-04-25 14:03:00.024 Info SharedHttpPipelineSource: Closing SharedHttpPipelineSource
2020-04-25 14:03:00.024 Debug GraphRunner: PipelinePacketizer: Complete PipeReader
2020-04-25 14:03:00.024 Info MediaSourceManager: Live stream 06044cf0e6f93cdae5f285c9ecfaaeb4_01413a525b3a9622ce6fdf19f7dde354_native_aa5f9808f2b91371eef8adfc2200ac27_e5296b45f654e70c6090231b06155dd9 closed successfully
2020-04-25 14:03:00.024 Debug GraphRunner: PipelinePacketizer: Close input
2020-04-25 14:03:00.024 Debug GraphRunner: PipelinePacketizer: Complete target
2020-04-25 14:03:00.024 Debug GraphRunner: PipelinePacketizer: Exit loop
2020-04-25 14:03:00.025 Debug GraphRunner: Completion wait
2020-04-25 14:03:00.025 Debug GraphRunner: CloseInput
2020-04-25 14:03:00.025 Debug GraphRunner: CloseOutput
2020-04-25 14:03:00.026 Debug SharedHttpPipelineSource: Streaming loop finished
2020-04-25 14:03:00.026 Info SharedHttpPipelineSource: SharedHttpPipelineSource is done streaming.
2020-04-25 14:03:00.026 Info LiveTV: Running recording post processor F:\EmbyPP\pp.bat "F:\EmbyTest\Recordings\Series\Wheeler Dealers (2003)\Season 12\Wheeler Dealers S12E14 Ford Escort RS2000 Rally Car.ts"

The above might help

 

closing live stream or recording stopped

 

Also notice the multiple itemupdated calls as emby sees the file grow!!

Edited by PenkethBoy

Share this post


Link to post
Share on other sites
Anthony Musgrove

BINGO! I found it !

 

2020-04-25 23:35:12.579 Info Emby ScripterX: Attached to LiveTV Service: Emby, type = Emby.LiveTV.EmbyTV
 
2020-04-25 23:35:50.532 Info Emby ScripterX: Recording Ended! Saving Private Ryan
 
2020-04-25 23:35:50.780 Info Emby ScripterX: onItemAdded: ADDED 16416 "Saving Private Ryan" "D:\Media\RecordedSeries\Saving Private Ryan" "Recorded Shows"
 
 
Woohoo! :) This is getting better and better - now to add the Event interface for these functions :)
  • Like 1

Share this post


Link to post
Share on other sites
Anthony Musgrove
Posted (edited)

If anyone has Live TV service on their emby install, can you please test this BETA for me?

 

https://github.com/AnthonyMusgrove/Emby-ScripterX/tree/master/BETA

 

I'm just using a free open TVHeadEnd server but I'm getting errors even playing live TV tonight, so the events aren't working, and %recording.path% is blank - so I'd love to get some feedback on it.

 

The actions page will show two new events - onTVRecordingStart, onTVRecordingEnded, and the parameters/tokens available underneath respective to each of them.. I just can't test it at the moment as my live TV isn't working.  This is purely BETA, not released

 

5ea4565f6a6d7_beta_tv.png

 

 

 

thank you :)

Edited by Anthony.Musgrove

Share this post


Link to post
Share on other sites
Anthony Musgrove

Okay, tested it on my live emby server.

 

root@medius:/home/medius/scripts# tail tvrecording.log
 
TV Recording START for Homestead Rescue to
 
so path is empty.  Hm.  lets see why.

Share this post


Link to post
Share on other sites
Anthony Musgrove

Oh, I see why.  on start, there's no path because theres no recording yet.  On stop theres a path:

 

root@medius:/home/medius/scripts# tail tvrecording.log
 
TV Recording START for Homestead Rescue to
TV Recording STOP for Homestead Rescue to /var/lib/emby/data/livetv/recordings/Homestead
root@medius:/home/medius/scripts#

Share this post


Link to post
Share on other sites
Anthony Musgrove

Yeah baby. TV Recording STOP for Diana to /home/medius/media/recordings/Diana/Diana 2020_04_25_23_26_00.ts

Share this post


Link to post
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...