Jump to content

New Plugin - Custom Scripting | Emby ScripterX


Anthony Musgrove

Recommended Posts

Anthony Musgrove

alright, I have the dev environment working perfectly - I noticed @maegibbonsyou're using the beta version of emby server (v4.8.0.45).  I'll still have the two branches, the release version and the beta version.  I'm going to finalise the release version and focus on the beta version for the upcoming releases (v4.8+). 

 

I'll tidy up v4.7* and then have v4.8* supported.  Shouldn't take long though.  

 

❤️ 

  • Thanks 1
Link to comment
Share on other sites

Anthony Musgrove

No worries at all!  Just thought I'd give a little update.  This is an interesting one, first cab off the rank! :)  Going through and testing everything now in the beta, the new version of Emby Scripter-X for the beta channel will start at v5.0.0.

 

So any ScripterX dlls with version below v5.0.0 will not work on the beta channel, and any 4.8* version of Emby Media Server.

 

Time to dig in and get the elbows dirty.

 

image.thumb.png.f018257e5e53fb541a28aef9da9d1da0.png

Link to comment
Share on other sites

Anthony Musgrove

Fixed that issue, Device Name when using Edge is "Microsoft Edge Windows"; Auth Fail: "Microsoft Edge Windows" attempted to authenticate using username anthony and password awsdfgasdfg 

 

:) Okay, now time to start testing these other things ..

Link to comment
Share on other sites

Anthony Musgrove

If those of you who are using the Emby Server Beta Channel release v4.8+, could you please begin testing the new v5.0.0.0 beta release, you can download it manually for now at: https://github.com/AnthonyMusgrove/Emby-ScripterX/tree/master/Beta


Shortly it will be available in the official Emby Plugin Catalog under 'Beta'.

Feel free to post any bugs/errors/issues here as well initially as I know there may be issues with compiling this against the newest 4.8* beta core libraries.

warmest regards as always,

Anthony

Link to comment
Share on other sites

maegibbons

Hi

Unfortunately I am away from home so testing anything outside the catalog at the moment is an issue.

 

Will just have to wait for catalog appearance or the weekend.  Whichever comes 1st!!

 

Krs

Mark

Link to comment
Share on other sites

Anthony Musgrove

Just going through the new Core and adding additional/new event hooks.  Noticed Network manager (nice!), and added onNetworkRemoteAddressChanged with plans to also add onNetworkChanged as well,

 

image.thumb.png.2aac028935896c6a4e3992adee32031e.png

 

I think this could come in handy :)

I've also found Activity Manager, which exposes EntryCreated, so will look into this one a bit more and definitely add some functionality for this too!

So excited to bring the next version out!  Just waiting for password reset to submit to official catalog!

Kindest regards,

Anthony

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Anthony Musgrove

Hey all my beautiful followers, 

Please note - we're back in business.  You'll now see the latest version of Emby Scripter-X (5.0.0.1) in the Official Emby Plugin Catalog, it is a Beta release, requires Beta Server Version (4.8+)

 

Please test, and report any issues you may come across, I'll be triaging and addressing any issues momentarily!

 

Kindest regards,

Anthony

 

image.png.d9664b238625e5d118640cb51e0137a4.png

  • Thanks 1
Link to comment
Share on other sites

Anthony Musgrove

And just as a note, with the revamp & continuation, rebranding from the old logo, thumbnail and website.  Bare with me, but it will be much more uniform and clean.

Catalog Thumbnail

image.png.b9342339b775471dfaf603caa47beeb5.png

 

Website

image.png.d942b55acd483843091b04fff3f12d48.png

 

Progressive work will include a) fully comprehensive and complete documentation, b) a proper online package search feature, c) a contributors logon area, d) a simple, easy to follow quick start guide for Windows, Linux, Mac, etc, e) feature request system, + more.

   

  • Like 1
Link to comment
Share on other sites

rbjtech

@Anthony Musgrove- Thanks for getting this Plugin refreshed 👍

I now have my emby authorisation audit log working again (I write all auth to a seperate log file).   Not sure why emby doesn't do this out the box tbh.

I disabled this plugin during the Emby vulnerability breeches, just to limit exposure (I didn't get breeched myself), as I believe it may have been used for unwanted functionality.

On that note - is there any way to disable the 'Packages' feature - as to me, that still concerns me from a potentially unwanted code execution point of view ?

Thanks !

Edited by rbjtech
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Anthony Musgrove
5 hours ago, rbjtech said:

@Anthony Musgrove- Thanks for getting this Plugin refreshed 👍

I now have my emby authorisation audit log working again (I write all auth to a seperate log file).   Not sure why emby doesn't do this out the box tbh.

I disabled this plugin during the Emby vulnerability breeches, just to limit exposure (I didn't get breeched myself), as I believe it may have been used for unwanted functionality.

On that note - is there any way to disable the 'Packages' feature - as to me, that still concerns me from a potentially unwanted code execution point of view ?

Thanks !

Hey @rbjtech

Thank you so much for this feedback.  Yes I will be cleaning this plugin up a lot soon, such that packages will be a separate plugin altogether.

 

Kindest regards,

Anthony

  • Thanks 1
Link to comment
Share on other sites

  • 4 weeks later...
eduardopventura
On 3/2/2023 at 1:00 AM, jdotero said:

Hi Anthony!  Fantastic job on the plugin.  I recently noticed that one of my OnPlayBackStart Actions that is supposed to trigger a bash script stopped working.  I don't know when it stopped but it was some time ago.  Perhaps an upgrade broke something and I didn't read the change logs very well.  Any how, the bash script takes some input variables (as shown in the screen capture that is attached) and then performs some logic to determine whether or not it should dim the lighting in the media room.   As stated, this no longer seems to work.  Oddly, when looking through all the logs, even with the debugging turned on, I see no reference to ScripterX trying to run the bash script.  It is almost like it doesn't see the OnPlayBackStart item.  I have tried deleting it and recreating it.  No luck.  The bash script is 755 so all users can run it,  but again, I don't even think ScripterX is trying to run it.  I even tried adding a simple "touch file" command so that a text file should be generated every time it runs.  On the command line, from the machine with the emby server, the script runs and touches the file as expected.  But through EmbyScripter X it does not.  Another reason I don't think the script is even being called. Any suggestions to what I can try next?  Hopefully you see something obvious in the attached screenshot.  Again great job on this!  Wish I had your skills. 

scripterx_screenshot.png

Did you find a solution?

Link to comment
Share on other sites

rbjtech
18 minutes ago, eduardopventura said:

Did you find a solution?

Remember it is the 'emby' account that runs Scripter-X - so any permissions to bash and the associated script/paths etc all need to be allowed from that account.

Running the script sucessfully from the command line may not necessarily have the same permissions.

For me - On the latest beta, Scripter-X (using Windows) appears to be working fine but I'm using the Auth functions, not the Playback ones.

@Anthony Musgrove

Edited by rbjtech
Link to comment
Share on other sites

eduardopventura
On 12/7/2023 at 12:11 PM, rbjtech said:

Remember it is the 'emby' account that runs Scripter-X - so any permissions to bash and the associated script/paths etc all need to be allowed from that account.

Running the script sucessfully from the command line may not necessarily have the same permissions.

For me - On the latest beta, Scripter-X (using Windows) appears to be working fine but I'm using the Auth functions, not the Playback ones.

@Anthony Musgrove

Just to post an answer here, maybe it can help someone too.
THANK YOU VERY MUCH!
I'm just a newbie trying new things hehehe. It takes me a little time to sort out the permissions.
Now using emby on unraid inside a docker container, I created a folder for the scripts and mapped it to the container. The folder must be at least 755 99:users and the scripts must be .sh 755 99:users too, I found that if left root:root or any group other than users it didn't work.
In Scripter-X using OnNewMediaAdd, Auth and Playback functions working perfectly now, in the script executor just choose "macro" and put /bin/sh, for the parameters I had to use " " for names that contain spaces, I don't know if this is the case for others too

 

@Anthony MusgroveI don't know if I'm too dump but I found it difficult to find some basic things in git, for example how to select /bin/sh, but other than that, thanks for the plugin and the excellent work.

Link to comment
Share on other sites

  • 3 weeks later...
Julian87

I just installed Version 5.0.0.1 from the Plugin Library, but it doesn't seem to work with Version 4.8.0.65 beta

I can't do anything right now.

grafik.thumb.png.dfc75819572e1159dedc9885dc471b54.png

Edited by Julian87
Link to comment
Share on other sites

Anthony Musgrove
7 minutes ago, Julian87 said:

I just installed Version 5.0.0.1 from the Plugin Library, but it doesn't seem to work with Version 4.8.0.65 beta

I can't do anything right now.

grafik.thumb.png.dfc75819572e1159dedc9885dc471b54.png

attempting to replicate now, please stand by :) 

Link to comment
Share on other sites

Anthony Musgrove

Ah yes, lets see whats going on here.  Something to do with javascript I think

Link to comment
Share on other sites

Anthony Musgrove

there's a bunch of these, perhaps this is the issue.  @Lukehas much changed in the way plugin configuration interfaces are rendered/routed?  It seems anything javascript isn't working, ChangeLog is blank, etc too.

 

appRouter - processing path: /web#!/configurationpage, isBack: undefined

Link to comment
Share on other sites

Anthony Musgrove

Something is oddly broken, and no errors are in the console.

So taking for example, the 'ChangeLog' on the 'Help' tab in ScripterX simply loads a textbox, then uses an ajax call to 'get' the contents of the changelog file;

 

$('.ScripterXHelpPage').on('pageinit', function (event) {

	var page = this;
	get_changelog(page);

}).on('pageshow', function (event) {

    Dashboard.showLoadingMsg();
    var page = this;
    Dashboard.hideLoadingMsg();

});

 

So in the get_changelog function, I add an alert

function get_changelog(page)
{
	alert('Called get_changelog()');
	var changelog_container = page.querySelector('#changeLogContainer');
	ApiClient.getChangeLog().then(function(changelog_data) { changelog_container.innerHTML = changelog_data; });
}

 

That alert is never called, the function isn't called.  Something javascript-y has changed and it doesn't like it. :)

Hopefully Luke and the dev team can shed some light on it and I'll get it sorted out asap.  Until then, I am still poking around to try to find the cause/error/issue

 

Link to comment
Share on other sites

Anthony Musgrove

Not even the main functions calling?

                }).on('pageshow', function (event) {

                    alert('Page Show for HELP!');

                    Dashboard.showLoadingMsg();
                    var page = this;
                    Dashboard.hideLoadingMsg();

                });

 

Link to comment
Share on other sites

Anthony Musgrove

Has to be something to do with the new tabs system, still investigating.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Anthony Musgrove

Will be onto this soon guys, fairly confident I can fix it quickly

  • Like 1
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...