rafinha 8 Posted May 10, 2021 Share Posted May 10, 2021 Is this still working? I'm trying to send a post to my endpoint using scripterx by @Anthony Musgrove and I don't get anything. Look the image attached. I know I can use the webhooks from emby, but the problem is that emby webhooks, doesn't have an "onMediaItemAdded" option. Anybody know how to use the post option from scripterx ? Thanks Link to comment Share on other sites More sharing options...
ChrisHammond56 4 Posted May 10, 2021 Share Posted May 10, 2021 Working still with my options, but I am using a local BASH/Python script. Link to comment Share on other sites More sharing options...
harrv 88 Posted May 10, 2021 Share Posted May 10, 2021 1 hour ago, rafinha said: Is this still working? I'm trying to send a post to my endpoint using scripterx by @Anthony Musgrove and I don't get anything. Look the image attached. I know I can use the webhooks from emby, but the problem is that emby webhooks, doesn't have an "onMediaItemAdded" option. Anybody know how to use the post option from scripterx ? Thanks Yes, I see at least one problem, and maybe three. A web post requires a payload template, and you haven't specified one. The template is a text file that contains whatever you want to be posted to your web hook. It has variables in it that correspond to the data Scripter-X knows how to resolve for the event. Here is what mine looks like for onMediaItemAddedComplete (which is more useful than onMediaItemAdded assuming you want to take some action when something is actually done being added and not just when something new is detected but has not finished adding yet): { "Event": "scripterx.mediaitem.added.complete", "item.id": "%item.id%", "item.name": "%item.name%", "item.originaltitle": "%item.originaltitle%", "item.tagline": "%item.tagline%", "item.overview": "%item.overview%", "item.type": "%item.type%", "item.productionyear": "%item.productionyear%", "item.isvirtual": "%item.isvirtual%", "item.library.type": "%item.library.type%", "item.library.name": "%item.library.name%", "season.id": "%season.id%", "season.name": "%season.name%", "season.number": "%season.number%", "series.id": "%series.id%", "series.name": "%series.name%", "episode.number": "%episode.number%", "embyServer": { "id": "%server.id%", "name": "%server.name%", "version": "%server.version%", "platform": { "os": "%server.platform.os%", "osVersion": "%server.platform.osver%", "upTime": "%server.platform.uptime%" } }, "scripterx": { "version": { "full": "%scripterx.version%", "major": "%scripterx.version.major%", "minor": "%scripterx.version.minor%", "build": "%scripterx.version.build%", "revision": "%scripterx.version.revision%" } } } I saved that file as MediaItemAddedComplete.json on my Emby server and then when I configured Scripter-X for that event I specified the full path to that template file in the field immediately below the run field. Potential problem #2: Notice that I don't use a where clause. That's because I want to use this same config for all onMediaItemAddedComplete events. You only need a where clause if you want to filter the events based on something in a variable. For example, if I wanted to have different templates or call a different web hook depending on whether it is a movie or a TV episode being added, I would use a where clause for that. I see that you have a where clause, and that it doesn't make much sense. I assume you were trying to use it to specify what you want to be posted, but you need to use a payload template for that, as described above. Potential problem #3: You specifically mentioned the onMediaItemAdded event, but your screenshot shows that you configured the onPlaybackStart event. I will assume that this isn't a problem and that you are actually configuring both events and happened to post a screenshot of onPlaybackStart rather than onMediaItemAdded. I hope this helps! 1 1 Link to comment Share on other sites More sharing options...
rafinha 8 Posted May 10, 2021 Share Posted May 10, 2021 thanks @harrv, this help me a lot, I see how it works \o/. Thanks again Link to comment Share on other sites More sharing options...
abegreen 17 Posted May 25, 2021 Share Posted May 25, 2021 Hi, I wanted to write a simple python script that will be executed by the scripter-x. Whole night I was trying to just make it run. /c notepad.exe is the peek of my accomplishment. Please type me an example of a command to run the .py script. Thank you. Link to comment Share on other sites More sharing options...
abegreen 17 Posted May 29, 2021 Share Posted May 29, 2021 On 5/25/2021 at 6:56 AM, abegreen said: Hi, I wanted to write a simple python script that will be executed by the scripter-x. Whole night I was trying to just make it run. /c notepad.exe is the peek of my accomplishment. Please type me an example of a command to run the .py script. Thank you. /c py e:\embyscripts\script.py Link to comment Share on other sites More sharing options...
Anthony Musgrove 201 Posted September 4, 2021 Author Share Posted September 4, 2021 Hello my beautiful, wonderful friends. I'm in the process of reviving the Scripter-X project; Just trying to get the codebase to compile with the new nuget packages! Shouldn't be long! 1 Link to comment Share on other sites More sharing options...
abegreen 17 Posted September 4, 2021 Share Posted September 4, 2021 Hello there, Please add action "onMediaLiked". I'd like to execute script to move liked files to another library. Thanks. Link to comment Share on other sites More sharing options...
Anthony Musgrove 201 Posted September 5, 2021 Author Share Posted September 5, 2021 22 hours ago, abegreen said: Hello there, Please add action "onMediaLiked". I'd like to execute script to move liked files to another library. Thanks. Hi there abegreen, Thank you for your feature suggestion! I've successfully located the core hooks for the event you've requested, along with a bunch of others. So when I 'favorite' or 'like' a media item, emby signals UserDataSaved, which gives a tonne of functionality along with some variables that I will tokenize. The event will be onUserDataSaved. You'll be able to set a condition where %save.reason% equals 'UpdateUserRating' Then you'll be able to check a token %is.media.favorited.or.liked% which will be True or False. I'll finalise the implementation and release it soon. 'Favorite': 2021-09-05 22:12:09.369 Info Emby ScripterX: UserDataSaved > ItemName=SuperTed, SaveReason=UpdateUserRating, Username=anthony, IsFavoriteOrLiked=True 'Remove Favorite': 2021-09-05 22:12:08.433 Info Emby ScripterX: UserDataSaved > ItemName=SuperTed, SaveReason=UpdateUserRating, Username=anthony, IsFavoriteOrLiked=False 2 Link to comment Share on other sites More sharing options...
abegreen 17 Posted September 5, 2021 Share Posted September 5, 2021 Well, hell yes man. Whenever I make a request that makes perfect sense, developers start laying out some stuck up philosophies and reject. Even users go out of their way to give negative feedbacks. Only through plugins we can make Emby be something more than just a movie player. I guess you are one of the rare examples of normal people in this negative community. Thank you very much. 1 Link to comment Share on other sites More sharing options...
Anthony Musgrove 201 Posted September 5, 2021 Author Share Posted September 5, 2021 So I've implemented this, and it's ready for implementation. This example below will match your criteria of: When a user 'likes' or 'favorites' an item of media (any media). This will be available on the next release. 2 Link to comment Share on other sites More sharing options...
Anthony Musgrove 201 Posted September 5, 2021 Author Share Posted September 5, 2021 (edited) v3.0.5.2 is now live on the catalog, please update to this version to gain this new functionality. Let me know if you come across any issues. Remember also, when you 'like/favorite' an entire TV series, season, etc (where there is a group of media items within it), you'll get an individual onUserDataSaved call for each episode in that series/season/etc Edited September 5, 2021 by Anthony Musgrove 2 Link to comment Share on other sites More sharing options...
Anthony Musgrove 201 Posted September 5, 2021 Author Share Posted September 5, 2021 (edited) Note, make sure you update to 3.0.5.1 (urgent bugfix, nuget decided to update Jint to a beta version which caused absolute havoc, all sorted now in 3.0.5.1) Edited September 5, 2021 by Anthony Musgrove Link to comment Share on other sites More sharing options...
Anthony Musgrove 201 Posted September 5, 2021 Author Share Posted September 5, 2021 And finally, update to version 3.0.5.2, boolean datatype is now processed correctly with conditions. So the following script/yields result: note: you do not need to send %userdata.is.favorite% to the script, because the condition is set to ONLY process this action when %userdata.is.favorite% is true, therefore only processing this script when a user 'favorite/likes' a media item. This is just an example, be as creative as you like/need! and my Scripter-X action configuration is as follows :- 1 1 Link to comment Share on other sites More sharing options...
Anthony Musgrove 201 Posted September 6, 2021 Author Share Posted September 6, 2021 On 29/05/2021 at 17:02, abegreen said: /c py e:\embyscripts\script.py Place the path to your script in the 'script' text box, so e:\embyscripts\script.py and in the interpreter field specify path to your python interpreter Link to comment Share on other sites More sharing options...
Anthony Musgrove 201 Posted September 7, 2021 Author Share Posted September 7, 2021 On 25/05/2021 at 14:56, abegreen said: Hi, I wanted to write a simple python script that will be executed by the scripter-x. Whole night I was trying to just make it run. /c notepad.exe is the peek of my accomplishment. Please type me an example of a command to run the .py script. Thank you. Check out https://wiki.emby-scripterx.com/books/scripting-tutorials/page/media-playback-example-python Link to comment Share on other sites More sharing options...
Benplace 0 Posted September 8, 2021 Share Posted September 8, 2021 I want to accomplish one thing. I am familiar with scripting and can edit some python code but not a python developer. All I would like to do is (On recording end/complete tag that recording with tag "tag name") I just want to tag all of my recordings with the tag "Recorded" Thanks in advance for any help! Link to comment Share on other sites More sharing options...
sward 27 Posted September 10, 2021 Share Posted September 10, 2021 Hello - is there a way to use this tool to get Emby to refresh the recording timers on wake, or on a regular interval? As it stands my HTPC sleeps 14 hrs per day, and when it wakes, all the recording timers are off by 14 hrs, and the only way to update them is to manually restart Emby. 1 Link to comment Share on other sites More sharing options...
Anthony Musgrove 201 Posted September 20, 2021 Author Share Posted September 20, 2021 On 11/09/2021 at 00:00, sward said: Hello - is there a way to use this tool to get Emby to refresh the recording timers on wake, or on a regular interval? As it stands my HTPC sleeps 14 hrs per day, and when it wakes, all the recording timers are off by 14 hrs, and the only way to update them is to manually restart Emby. Let me look into this now for you! Link to comment Share on other sites More sharing options...
maegibbons 1267 Posted September 20, 2021 Share Posted September 20, 2021 (edited) 2 hours ago, Anthony Musgrove said: Let me look into this now for you! Yes. Emby definately needs to restart when it resumes from waking. Timers do not work until emby is restarted. Don't know if this should be done within scripterx or whether @luke needs to code something. But if it can be done in scripterx - why not!! Thanks for looking at it Krs Mark Edited September 20, 2021 by maegibbons Link to comment Share on other sites More sharing options...
Nebarik 7 Posted December 21, 2021 Share Posted December 21, 2021 (edited) Hey I'm having a bit of a time with this. I think my issue is related to Emby being in docker so if anyone else has a similar setup maybe they can offer some insight. First off. Scripter-x does appear to be triggering correctly. using authsuccess as a testing arena and seeing this in my logs: 2021-12-21 09:13:04.021 Info Emby ScripterX: onAuthenticationSuccess: Chrome But the actual script isn't running. Is there any other more indepth logs I can seek out that might help? Using Emby in Docker running on Ubuntu 20.04. Permissions all look correct, same username and rw as anything else Emby deals with. I've ssh'd into the docker container and confirmed it can both see the script file, and run it successfully. (it's just a basic echo to file for now). I'm using my config folder for now, but have also tested it inside my Movies folder too, which has a matching folder path to how it's mounted in docker. Nevermind worked it out. Turns out the script needs to use full paths. instead of echo "something" > result.log it needed to be echo "something" > /config/scripts/result.log bah Edited December 21, 2021 by Nebarik Link to comment Share on other sites More sharing options...
richt 73 Posted February 1, 2022 Share Posted February 1, 2022 Is this plugin still being supported? I went looking for the wiki on how to use the plugin and the link isn't working for me. Looking for some documentation. https://wiki.emby-scripterx.com/ https://www.emby-scripterx.com/ Link to comment Share on other sites More sharing options...
ALdream40K 0 Posted February 2, 2022 Share Posted February 2, 2022 @Anthony Musgrove hi, have you any idea for to change the colour of my stripe led rear my TV by genre (action, adventure...) of the film ? and when is pause? no problem when start or stop playback, the command with web.get works very well. thank you Link to comment Share on other sites More sharing options...
ZSZQ 10 Posted March 15, 2022 Share Posted March 15, 2022 hi!I hope to get your help! "%item.meta.*" Does this parameter support TVDB? How is it right? Thank you! Link to comment Share on other sites More sharing options...
harrv 88 Posted March 16, 2022 Share Posted March 16, 2022 16 hours ago, ZSZQ said: "%item.meta.*" Does this parameter support TVDB? How is it right? I've wondered that too. %item.meta.*% and %series.meta.*% don't resolve to anything, so we'd need to know what to put in place of the asterisk, but I've never seen an example or documentation about it. Has anyone gotten it to work? Anthony? Can you give us an example of how to use these? Link to comment Share on other sites More sharing options...
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