Jump to content

New Plugin - Custom Scripting | Emby ScripterX


Anthony Musgrove

Recommended Posts

ChrisHammond56

Not sure if this the correct post location, but I am having issues in installing the examplepackage on a Synology DS918+ running Emby Server 4 on the host (not Docker). I click to install package via ZIP and the interface does nothing. I have attached the Emby Log (if usefull). I noticed that the testing has not been done on Synology, so this may be new?

 

embyserver.7z

Link to comment
Share on other sites

If this is about installing Emby Server you would want to post this in the Synology section of the website as that will assure that other Synology users and devs see it.

If this is about the Custom Scripting Plugin then this is the correct place.

Can you be more specific what your problem is if custom scripting plugin is the issue, otherwise make a post and give more information as to your problem in the Synology section.

Thanks

Edited by cayars
Link to comment
Share on other sites

ChrisHammond56

Thanks for the reply.

I suppose I should clarify. I have a Synology DS918+ running Emby native (not in a Docker). I have that all working. I installed the Scripter-X via the Plugins option within Emby management GUI. I then attempted to install the ScripterXExamplePackage.zip (from the git repository) via the 'install from zip' option within the Scripter-X Packages page of the plugin settings. I click 'browse' and choose the example file. The filename then appears in the 'select filename to ....' field and then when I click 'Install Now' , the plugin reverts to the 'Browse' in the 'select file....' field. It has not added any scripts as all the events are displaying '0' and the 'Installed Packages' count is also '0'

 

Link to comment
Share on other sites

PenkethBoy

permission issue perhaps on the zip file?

if not could be a bug so you will have to wait for Anthony to return to confirm

Link to comment
Share on other sites

  • 4 weeks later...

Can this send POST commands and replace the built-in Webhooks (which is nearly useless)?

Need more robust triggers for Emby like Tautulli has for Plex.  Looking for solution to automating lighting and such for Home Theater / Home Automation.

thx

Link to comment
Share on other sites

PenkethBoy

indirectly - yes

once an event is triggered - then your script can do a POST/GET etc via the emby api

Link to comment
Share on other sites

45 minutes ago, PenkethBoy said:

indirectly - yes

once an event is triggered - then your script can do a POST/GET etc via the emby api

Hoping @Anthony Musgrove  can include a feature to directly send POST commands that include criteria his plugin already uses. Emby's API exposes POST too.  Having separate scripts that need to read/parse and then send POST is a tedious. 😞   Emby's lack of easy integration for home theater and home automation may push me to Plex.

Link to comment
Share on other sites

PenkethBoy

dont think its anymore tedious to do as once done it will just work with a script

if you got to plex enjoy them mining your data :)

  • Like 1
Link to comment
Share on other sites

17 minutes ago, PenkethBoy said:

dont think its anymore tedious to do as once done it will just work with a script

if you got to plex enjoy them mining your data :)

Do you have an example script that pulls in the Emby variables and sends an HTTP POST?  

far as plex mining data for what I watch... dont care. My kids like How to Train Your Dragon and several other show. I'm not making $ from that...if they do, good for them.

Link to comment
Share on other sites

PenkethBoy

If you are Ok using Powershell 

See my post at top of page 4 of this thread and see the zip file for a very basic example

to get powershell to POST/GET say from emby then add a line or two in the IF/Else statement that uses 

Invoke-WebRequest

$MediaUrl = "https://api.themoviedb.org/3/movie/" + $Media.ProviderIds.TMDB +"/videos?api_key=3050c3154e008161700ca5406f69d0b8&language=en-US"
$TMDBResult = Invoke-WebRequest -Uri $MediaUrl -Method Get

$TMDBResult = $TMDBResult.Content | ConvertFrom-Json

if you set $Media.ProviderIds.TMDB to 1271 then it will return data on the "300" movie from TMDB

Info will be in the $TMDBResult variable so you could access $TMDBResult.Results to get a list of Trailers/Extras for the movie once its converted from JSON

To send a POST to any API change the -Method to POST and you will need to return suitably encoded content if the url does not have all the info

$Result = Invoke-Webrequest -uri $MediaUrl -Method POST -Body ($EmbyData | ConvertTo-Json) -ContentType "application/json; charset=utf-8"

# Where $EmbyData is a Powershell object that gets converted to valid JSON as the body of the webrequest POST

that should get you started - the rest you should be able to find via google

Link to comment
Share on other sites

5 hours ago, PenkethBoy said:

If you are Ok using Powershell 

See my post at top of page 4 of this thread and see the zip file for a very basic example

to get powershell to POST/GET say from emby then add a line or two in the IF/Else statement that uses 

Invoke-WebRequest


$MediaUrl = "https://api.themoviedb.org/3/movie/" + $Media.ProviderIds.TMDB +"/videos?api_key=3050c3154e008161700ca5406f69d0b8&language=en-US"
$TMDBResult = Invoke-WebRequest -Uri $MediaUrl -Method Get

$TMDBResult = $TMDBResult.Content | ConvertFrom-Json

if you set $Media.ProviderIds.TMDB to 1271 then it will return data on the "300" movie from TMDB

Info will be in the $TMDBResult variable so you could access $TMDBResult.Results to get a list of Trailers/Extras for the movie once its converted from JSON

To send a POST to any API change the -Method to POST and you will need to return suitably encoded content if the url does not have all the info


$Result = Invoke-Webrequest -uri $MediaUrl -Method POST -Body ($EmbyData | ConvertTo-Json) -ContentType "application/json; charset=utf-8"

# Where $EmbyData is a Powershell object that gets converted to valid JSON as the body of the webrequest POST

that should get you started - the rest you should be able to find via google

Thx but I havent done any real coding in 25 yrs... and this looks like a time sink if I try to get this working.

If Anthony adds the ability to send POST I'll use his plugin. If not, I may just switch to Plex. I'm installing Tautulli right now to look it over.

Link to comment
Share on other sites

PenkethBoy

Ok fine

but you are going to have to code at some point as thats what Anthony's plugin is about - i.e. it exposes ways to control Emby (and other things) and is not a one stop shop you want it to be

if it was it would not be as powerful as it is

But its not for the novice coder that wants it done for them either

Have fun

Link to comment
Share on other sites

ginjaninja

just getting back into scripter-X after a couple of months off

feature request: as well as being able to turn entire events on and off, i would find it useful to be able to temporarily disable an individual action/row within an event,

eg i have 2 onplayblackstart events configured and i would like to turn one off temporarily whilst testing/developing.

 

maybe someone is aware of a quick workaround for this?

Link to comment
Share on other sites

Didn't know that.  Yea, much higher potential as in an emergency you can't always take all the precautions you might do in a doctors office.

Link to comment
Share on other sites

  • 1 month later...
Tocinillo

Hi!

I'm trying to use scripterX with Pi4 (and aarch64 kernel) but doesn't work. I tried with simply bash script in the "on playback start" and nothing...doesn't work.

The same with my Synology works like a charm.

Any ideas?

Link to comment
Share on other sites

Tocinillo
On 10/7/2020 at 9:22 PM, PenkethBoy said:

is one server mono based and one dot netcore?

One is synology ds918+, the other raspberry pi 4 aarch64 firmware.

 

Link to comment
Share on other sites

PenkethBoy

ok are you using the x64 syno emby server

what version of emby server are you running on the syno?

Link to comment
Share on other sites

PenkethBoy

So pi4 and syno are on different versions (by cpu architecture) of emby stable server

so there is an issue with .netcore on ri4 or you do have differences in your setup etc

@Luke would have to comment on that

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...