Anthony Musgrove 220 Posted May 5, 2024 Author Posted May 5, 2024 ISSUE RESOLVED. Please upgrade to v5.0.0.5 (Release) or allow Emby to autoupgrade to v5.0.0.5 (Release). The issue with it automatically upgrading to the "non working version" was due to the fact that Beta Server 4.8 went to Release Server 4.8, so for future reference this has been noted. 1 3
Anthony Musgrove 220 Posted May 9, 2024 Author Posted May 9, 2024 Feature Requests - Bug Fixes - Ideas - Comments - Suggestions Hey fellow Embyians, I'd like to know what you would like to see in upcoming versions of Scripter-X. I'd like to get some feedback from you guys, the valued community members, after all - Scripter-X was initially designed to help you manage and maintain your server/library/functionality using your own customised scripting languages, programs and shell scripts. I'll go through the suggestions and prioritise them based on popularity, development & testing time & the benefit they will bring to the wider Scripter-X community. If I need further information to clarify an idea, comment or suggestion I'll submit a quoted post with your original idea in it. Thank you so much to each and every one of you for your amazing support over the last four years - Emby Scripter-X was officially 'born' on April 8th, 2020, which means it is now just over four years old. The latest Release Version is 5.0.0.5. Kindest regards, Anthony, Developer of Scripter-X I am located in New South Wales, Australia, and my timezone is AUSTRALIAN EASTERN STANDARD TIME (AEST). 1
Anthony Musgrove 220 Posted June 3, 2024 Author Posted June 3, 2024 Just bumping this thread, wondering how many people are still using Scripter X, and what the general consensus is with its usability, functionality, etc
Stan Guiseppe 8 Posted June 4, 2024 Posted June 4, 2024 I am using it regularly as I send GET requests to my wifi dimmers to dim lights for playing movies, pause/unpause etc. Great tool and simpler than trying to work out webhooks with Emby server. 1
scott46953 30 Posted June 4, 2024 Posted June 4, 2024 I want to use it, but right now I'm diagnosing a buffering issue, uninstalled script x and commercial skip plug in... So far the buffering and server pauses have diminished. I would love to go back using scripture x with commercial skip, what can be done about this issue? The only way to stop the buffering with the plugins is to restart the server but at least once sometimes two or three time a day. I would love for there to be some sort of way to be able to commercial skip without the issue of buffering... I would definitely say what the flexibility of scripter x that it should definitely stay. 1
rbjtech 5284 Posted June 4, 2024 Posted June 4, 2024 I use it for Authentication logging. I would probably use it a lot more if I didn't have my own direct API connectivity for all my other emby integration scripts and applications. imo it's a valueable 'middleware' plugin for those that are unfamiliar with the API or Webhooks, but want to 'do stuff' with other applications. What would be good - is for some more 'examples' to be given - copying anothers example is usually a better starting point than a blank sheet Maybe we need a 'Scripter-X Example' section in this sub-forum - or a new topic per Scripter-X example (otherwise it gets bloated with questions and we'll lose having them all together). Something to think about ? 1
ginjaninja 605 Posted June 4, 2024 Posted June 4, 2024 10 hours ago, Anthony Musgrove said: Just bumping this thread, wondering how many people are still using Scripter X, and what the general consensus is with its usability, functionality, etc ScripterX is a useful part of filling in gaps in the functioning of my media system, thank you. The ability to fire off a relevant data payload on events to an external script (rather than a web service) is specific functionality that i dont think the main product exposes. I use it to remove content from 'recommendation collections' after being watched Clearing paused sessions on devices when continuing on another device maybe an option to enable/disable scripts on a script by script rather than event by event basis in the ui would be a nice to have but ive managed so far. 2
Anthony Musgrove 220 Posted June 4, 2024 Author Posted June 4, 2024 Thank you guys so much, this is great feedback. I'll look into each of the suggestions 1
scott46953 30 Posted June 4, 2024 Posted June 4, 2024 (edited) Awesome, is there a way to make new plug in for emby restart? Something automatic so that the server owner can set a time period to Auto restart the server or even a shutdown period,, So that windows can do updates, so that windows don't have to forcefully shut down the server. I feel like the automatic windows updates can cause corruption in the server at some point. So far I feel like I've been lucky. If that plug in exists, I may be able to slide by and do script or x and commercial skip plug-in, I really love it Edited June 4, 2024 by scott46953
Anthony Musgrove 220 Posted June 4, 2024 Author Posted June 4, 2024 (edited) 59 minutes ago, scott46953 said: Awesome, is there a way to make new plug in for emby restart? Something automatic so that the server owner can set a time period to Auto restart the server or even a shutdown period,, So that windows can do updates, so that windows don't have to forcefully shut down the server. I feel like the automatic windows updates can cause corruption in the server at some point. So far I feel like I've been lucky. If that plug in exists, I may be able to slide by and do script or x and commercial skip plug-in, I really love it Hey Scott, Thank you so much for this feedback! You can achieve an automated emby reboot using crontab or microsoft scheduled tasks - I use curl.exe on my windows development PC to restart my dev emby whenever I do a new compile of ScripterX to test the changes; I achieve that by calling: c:\curl\bin\curl.exe -X POST "http://localhost:8096/emby/System/Restart?api_key=my_emby_api_key_here" -H "accept: */*" -d " On linux/unix you can install curl too, and it will work just the same. Just change my_emby_api_key_here to an API key you generate in the API Key section of the emby administration dashboard. So for linux (debian, ubuntu, etc) apt-get install curl ... then crontab -e and add a crontab I hope this helps mate! Edited June 4, 2024 by Anthony Musgrove removed extra quote, added code tag 1
scott46953 30 Posted June 4, 2024 Posted June 4, 2024 Awesome thank you for that, I've been looking for this for a long time.
Oracle 85 Posted June 4, 2024 Posted June 4, 2024 9 hours ago, rbjtech said: I use it for Authentication logging. I would probably use it a lot more if I didn't have my own direct API connectivity for all my other emby integration scripts and applications. imo it's a valueable 'middleware' plugin for those that are unfamiliar with the API or Webhooks, but want to 'do stuff' with other applications. What would be good - is for some more 'examples' to be given - copying anothers example is usually a better starting point than a blank sheet Maybe we need a 'Scripter-X Example' section in this sub-forum - or a new topic per Scripter-X example (otherwise it gets bloated with questions and we'll lose having them all together). Something to think about ? What other integration scripts do you use? Also - seconding the examples.
scott46953 30 Posted June 4, 2024 Posted June 4, 2024 That is all for me, unless you have any good suggestions or examples of something that is popular or awesome to try or use. I would love something to overhaul the emby look and give it some cool changes. Probably not possible but worth a shot.
scott46953 30 Posted June 13, 2024 Posted June 13, 2024 Actually I came up with an idea, since emby server only uses a single thread, is it possible to use the scripture x to call on a program other than emby to do a task? Example, after a recorded program has ended, can scripter x run a program that is compatible with commercial skip to cut out the commercials completely, and then replace the original file with the new file with the commercials removed? I have also thought about sharing the drives/folders locally maybe through 1,000 link Network and having a separate computer or device take on the task. However, my current system is very powerful and should be able to do this task without being noticed on the emby server, Doing this will not rely on emby to repeatedly do the task of commercial skip and will also free up space on all my drives.
SirFoxey 1 Posted June 18, 2024 Posted June 18, 2024 I am only just getting the hang of using the plugin but are loving it and now I have it using it more. The ability to click on the %blah% and have it add where ever the cursor is would be awesome.
SirFoxey 1 Posted June 18, 2024 Posted June 18, 2024 One question I do have, is there a way to have the plugin log everything it does somewhere? As I am trying to debug the scripts I have working perfectly manually but not working once I add them into the plugin. So having a general log would be extremely helpful. No doubt there is already and I have just missed how to turn it on and where to find it.
SirFoxey 1 Posted June 18, 2024 Posted June 18, 2024 3 hours ago, SirFoxey said: One question I do have, is there a way to have the plugin log everything it does somewhere? As I am trying to debug the scripts I have working perfectly manually but not working once I add them into the plugin. So having a general log would be extremely helpful. No doubt there is already and I have just missed how to turn it on and where to find it. What I do not understand is that I can see in the logs the script actioning as per what I have setup but nothing actually runs. I setup up a simple onPlaybackStart action to create a file in /tmp with the episode name and the same onPlaybackStop but neither actually create the file. Can anyone help me work out why it is not working?
rbjtech 5284 Posted June 18, 2024 Posted June 18, 2024 (edited) 35 minutes ago, SirFoxey said: What I do not understand is that I can see in the logs the script actioning as per what I have setup but nothing actually runs. I setup up a simple onPlaybackStart action to create a file in /tmp with the episode name and the same onPlaybackStop but neither actually create the file. Can anyone help me work out why it is not working? Permissions ? Remember a script run by emby/scripter-x is run by the emby account. Maybe show an example of the script ? Example below is Windows - thus you need to load the command with a 'cmd /c' before running a batch script for example. For powershell, then you'd need to run the powershell command instead. For linux, you would need to run bash executable etc and then the bash script. Edited June 18, 2024 by rbjtech
SirFoxey 1 Posted June 18, 2024 Posted June 18, 2024 4 minutes ago, rbjtech said: Permissions ? Remember a script run by emby/scripter-x is run by the emby account. Maybe show an example of the script ? Example below is Windows - thus you need to load the command with a 'cmd /c' before running a batch script for example. For powershell, then you'd need to run the powershell command instead. For linux, you would need to run bash executable etc and then the bash script. The first one was a test as I know any user has permissions for this after the comskip one wasnt working
rbjtech 5284 Posted June 18, 2024 Posted June 18, 2024 1 hour ago, SirFoxey said: The first one was a test as I know any user has permissions for this after the comskip one wasnt working The variables are passed into the script - so I'm not sure why you have other syntax in the 2nd line ? ie /tmp/%item.name% ? you just want %item.name% in the script itself, you then need to use the variable that was passed. In Windows batch - this is %1, not sure what it is in bash. You can pass in as many variables as you want, just seperate them with a space - and increment the number in the script. ie %1, %2, %3 etc etc. So as an example - a couple of lines in the script itself - first line just writes all the variables to a file (log), the second sends some of them as a pushover alert to my phone. echo [%date% %time:~0,8%] AuthFail %1,%2,%3,%4,%5,%6,%7,%8,%9 >> c:\Emby-Server\emby_auth.log curl -s \ --form-string "token=*" \ --form-string "user=*" \ --form-string "sound=alien" \ --form-string "priority=1" \ --form-string "message=EMBY Login Fail USER:%3 IP:%1 EMBYID:%4 PW:%5 DEVICE:%6" \ https://api.pushover.net/1/messages.json
SirFoxey 1 Posted June 18, 2024 Posted June 18, 2024 (edited) 44 minutes ago, rbjtech said: The variables are passed into the script - so I'm not sure why you have other syntax in the 2nd line ? It was to ensure that where the file was written too was a globally accessable location for the test to ensure there was no permission issues, as /tmp/ is a world writable directory to ensure no permission issues. As I cant get anything to run using the Scripter-X tool. I cant even get anything to actually run. I can see it fire off in emby logs 2024-06-18 22:23:00.861 Info Emby ScripterX: 4ffb069e-978d-4451-b780-566a97bddfd5: Executing with substituted tokens: /tmp/One Pot Comfort 2024-06-18 22:23:00.861 Info Emby ScripterX: onPlaybackStart: /tmp/One Pot Comfort Though no file appears in /tmp I am at a complete loss as to why no file named "One Pot Comfort" and it is definately not a permission issue given the /tmp directory is world writable ( drwxrwxrwt ) Edited June 18, 2024 by SirFoxey
rbjtech 5284 Posted June 18, 2024 Posted June 18, 2024 (edited) 1 hour ago, SirFoxey said: It was to ensure that where the file was written too was a globally accessable location for the test to ensure there was no permission issues, as /tmp/ is a world writable directory to ensure no permission issues. As I cant get anything to run using the Scripter-X tool. I cant even get anything to actually run. I can see it fire off in emby logs 2024-06-18 22:23:00.861 Info Emby ScripterX: 4ffb069e-978d-4451-b780-566a97bddfd5: Executing with substituted tokens: /tmp/One Pot Comfort 2024-06-18 22:23:00.861 Info Emby ScripterX: onPlaybackStart: /tmp/One Pot Comfort Though no file appears in /tmp I am at a complete loss as to why no file named "One Pot Comfort" and it is definately not a permission issue given the /tmp directory is world writable ( drwxrwxrwt ) I think you are maybe missing how this is working ? No 'files' are being written - it's passing variables/data as specified to a script as input variables. What those scripts do with the data - is entirely up to you. So if in your case, you wanted to write to a file called /tmp/One Pot Comfort - and it contains the data from %item.name% - then within the script, you would need to redirect the variable to a file. ie - in Windows this would be echo %1 > "c:\tmp\One Pot Comfort" In linux/bash - I suspect it's much the same - except you use "/tmp/One Pot Comfort" Edited June 18, 2024 by rbjtech
SirFoxey 1 Posted June 18, 2024 Posted June 18, 2024 1 hour ago, rbjtech said: I think you are maybe missing how this is working ? No 'files' are being written - it's passing variables/data as specified to a script as input variables. What those scripts do with the data - is entirely up to you. So if in your case, you wanted to write to a file called /tmp/One Pot Comfort - and it contains the data from %item.name% - then within the script, you would need to redirect the variable to a file. ie - in Windows this would be echo %1 > "c:\tmp\One Pot Comfort" In linux/bash - I suspect it's much the same - except you use "/tmp/One Pot Comfort" When you execute the inbuilt linux script touch (/usr/bin/touch) it just creates a empty file named in the location you give it No different than runing echo and it prints what ever you give it. So on the first line above in scripter0x I am running the script called touch and on the second line I am passing it path /tmp and the variable %item.name% (/tmp/%item.name%) If I ran touch without scripter-x and on the linux command line, the command would be /usr/bin/touch /tmp/%item.name% So running that on the command line would create a empty file name "One Pot Comfort" in the location /tmp and doing so manually creates it, but when run through scripter-x nothing appears apart from the lines in the log file showing scripter-x was triggered. Isn't this how scripter-x is meant to work? Give it a command or script in the first line and then on the second give it any extra switches or variables the script on line 1 needs or wants?
rbjtech 5284 Posted June 18, 2024 Posted June 18, 2024 1 hour ago, SirFoxey said: Isn't this how scripter-x is meant to work? Give it a command or script in the first line and then on the second give it any extra switches or variables the script on line 1 needs or wants? You'll need to check with the Author - but no, I don't believe it works like that. Going back to my example the 'Run' part will run whatever you specify - it can contain command line switches if you like - but the key thing is, it's also going to be send all the items in the 2nd line (the %variable% items) as parameters - starting at %1 So any command line switches you add - need to reference these parameters (the %1) NOT the %variable% so the actual command line if I were to write it out for real for the above example would be cmd/c c:\Emby-Server\AuthFail %1 %2 %3 %4 %5 %6 %7 %8 %9 the actual values of %1 - would be %device.remote.ipaddress%, for %2 - would be "%user.id%" etc etc I hope that helps ..
TMCsw 247 Posted June 19, 2024 Posted June 19, 2024 8 hours ago, SirFoxey said: Isn't this how scripter-x is meant to work? You would think so, but I have found that running command lines in ScripterX to be more trouble then it's worth, instead it's much better to launch a shell script... But first you may not be using the right parameters in scripterX: lets' say the following file is being processed "/mnt/rec/TV Series/SD/Alice (1976)/Season 01/Alice (1976) - S01E01 - Pilot.ts" %item.name% or %recording.name% will simply give you: Pilot while %item.path% or %recording.path% will give you the full file path/name: /mnt/rec/TV Series/SD/Alice (1976)/Season 01/Alice (1976) - S01E01 - Pilot.ts but this can/will cause a problem if you don't put the parameter in quotes ("") (as spaces will make it look like many parameter's instead of just one or some characters like "(" will get interpreted as special directives instead of plain characters) so use "%item.path%" or "%recording.path%" to pass the full path/file to the script so try this (or similar): where: /home/tmc/bin/btest (or similar) contains: #!/bin/bash touch /tmp/"$(basename "${1}")" ## OR (but not both as it will just do the same twice) ## touch /tmp/"${1##*/}" Also NOTE: Linux permissions apply as always! And NOTE: the directory /tmp has a sticky bit too! 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now