skyfish 4 Posted April 25 Share Posted April 25 I use ChapterApi add credits chapter, kodi can show the skip credits button, but click it nothing happened. The correct thing is that clicking button, then next Episode play. Link to comment Share on other sites More sharing options...
quickmic 1352 Posted April 26 Share Posted April 26 Correct, it's not finally implemented yet. Not sure if Emby server reports the credit markers, it didn't in the past. How did you generate the credit markers on Emby sever? I never got it working. Link to comment Share on other sites More sharing options...
skyfish 4 Posted April 26 Author Share Posted April 26 (edited) I referred to the plugin at https://github.com/honue/MoviePilot-Plugins/tree/main/plugins/adaptiveintroskip, and used emby webhook method stop play the episodes when credits appear. Upon receiving a message from Emby, the plugin calls ChapterApi to add Credits chapter to the current and following episodes. The attachment is a piece of Python code I wrote that responds to webhook. You might be interested in taking it as a reference. To use this python file, you need add emby webhook first. webhook.py Edited April 26 by skyfish 1 Link to comment Share on other sites More sharing options...
skyfish 4 Posted April 26 Author Share Posted April 26 1 hour ago, quickmic said: Correct, it's not finally implemented yet. Not sure if Emby server reports the credit markers, it didn't in the past. How did you generate the credit markers on Emby sever? I never got it working. I referred to the plugin at https://github.com/honue/MoviePilot-Plugins/tree/main/plugins/adaptiveintroskip, and used emby webhook method stop play the episodes when credits appear. Upon receiving a message from Emby, the plugin calls ChapterApi to add Credits chapter to the current and following episodes. The attachment is a piece of Python code I wrote that responds to webhook. You might be interested in taking it as a reference. To use this python file, you need add emby webhook first. webhook.py 1 Link to comment Share on other sites More sharing options...
quickmic 1352 Posted April 27 Share Posted April 27 (edited) Quote Upon receiving a message from Emby, the plugin calls ChapterApi And how are the chapters labeled? Please send me an example, as this is not an "Emby standard", I need to know what kind of chapter suppose to be parsed as a credit marker. Edited April 27 by quickmic Link to comment Share on other sites More sharing options...
skyfish 4 Posted April 27 Author Share Posted April 27 48 minutes ago, quickmic said: 章节是如何标记的?请给我一个例子,因为这不是“Emby 标准”,我需要知道什么样的章节应该被解析为信用标记。 I modify these code, then the plugin can skip to end when I click the button "skip credits". The plugin can recognize the credits chapter. This is the Credits chapter that ChapterApi plugin added. Hope this can help you! 1 Link to comment Share on other sites More sharing options...
quickmic 1352 Posted April 27 Share Posted April 27 (edited) Thanks, I checked the database sync code and credit markers should be correct. "CreditsStart" is the parser label. Your modification in jump_Credits seems to be correct. I used the wrong seek position. Must be the Runtimeticks, you are right. Some additional checks must be added, RunTimeTicks are not loaded in realtime, otherwise (edge cases) player could crash. def jump_Credits(): if PlayingItem[0].get('RunTimeTicks', 0): xbmc.log(f"EMBY.hooks.player: Skip credits jump {PlayingItem[0]['RunTimeTicks']}", 1) # LOGINFO playerops.Seek(PlayingItem[0]['RunTimeTicks']) globals()["PlayingItem"][0]['PositionTicks'] = PlayingItem[0]['RunTimeTicks'] globals()["SkipCreditsJumpDone"] = True else: xbmc.log("EMBY.hooks.player: Skip credits, invalid RunTimeTicks", 1) # LOGINFO Edited April 27 by quickmic 1 Link to comment Share on other sites More sharing options...
skyfish 4 Posted April 27 Author Share Posted April 27 1 hour ago, quickmic said: And how are the chapters labeled? Please send me an example, as this is not an "Emby standard", I need to know what kind of chapter suppose to be parsed as a credit marker. I discover another problem, when I pause or resume on kodi, it can not recieve emby's webhook msg(pause and unpause). I read the plugin code, then I find the solution. Add the EventName property can recieve msg. Hope this can help you! Link to comment Share on other sites More sharing options...
quickmic 1352 Posted April 27 Share Posted April 27 3 minutes ago, skyfish said: I discover another problem, when I pause or resume on kodi, it can not recieve emby's webhook msg(pause and unpause). I read the plugin code, then I find the solution. Add the EventName property can recieve msg. Hope this can help you! Well, not sure what this "EventName" key actually does. globals()["PlayingItem"][0] is the dict send as sessioninfo to Emby server. Emby should already know what's the state of playback "IsPaused = true/false" however. I'll add the "EventName" as well even makes not really sense to me. 1 Link to comment Share on other sites More sharing options...
quickmic 1352 Posted April 27 Share Posted April 27 (edited) @skyfish You must send the EventName differently, otherwise the "EventName" is persistent in the global var PlayingItem[0] and will be send all the time (even for playback progress etc). e.g. unpause is: globals()["PlayingItem"][0]['IsPaused'] = False PlayingItemEvent = {"EventName": "unpause"} PlayingItemEvent.update(PlayingItem[0]) PlayingItem[4].API.session_progress(PlayingItemEvent) xbmc.log("EMBY.hooks.player: --<[ paused ]", 0) # LOGDEBUG What about volume change, playback start, playback stop, playlist update and progress updates? Does the event name follow any pattern? Edited April 27 by quickmic Link to comment Share on other sites More sharing options...
skyfish 4 Posted April 27 Author Share Posted April 27 (edited) 4 hours ago, quickmic said: @skyfish You must send the EventName differently, otherwise the "EventName" is persistent in the global var PlayingItem[0] and will be send all the time (even for playback progress etc). e.g. unpause is: globals()["PlayingItem"][0]['IsPaused'] = False PlayingItemEvent = {"EventName": "unpause"} PlayingItemEvent.update(PlayingItem[0]) PlayingItem[4].API.session_progress(PlayingItemEvent) xbmc.log("EMBY.hooks.player: --<[ paused ]", 0) # LOGDEBUG What about volume change, playback start, playback stop, playlist update and progress updates? Does the event name follow any pattern? Yes, you are right. I test it, the "pause" and "unpause" event send all the time. The old code my webhook server can not recieve the pause and unpause event, but when I modify code, it always recieve, I will think about it more. Edited April 27 by skyfish 1 Link to comment Share on other sites More sharing options...
skyfish 4 Posted April 27 Author Share Posted April 27 5 hours ago, quickmic said: @skyfish You must send the EventName differently, otherwise the "EventName" is persistent in the global var PlayingItem[0] and will be send all the time (even for playback progress etc). e.g. unpause is: globals()["PlayingItem"][0]['IsPaused'] = False PlayingItemEvent = {"EventName": "unpause"} PlayingItemEvent.update(PlayingItem[0]) PlayingItem[4].API.session_progress(PlayingItemEvent) xbmc.log("EMBY.hooks.player: --<[ paused ]", 0) # LOGDEBUG What about volume change, playback start, playback stop, playlist update and progress updates? Does the event name follow any pattern? globals()["PlayingItem"][0]['IsPaused'] = False tmepparam = PlayingItem[0].copy() tmepparam['EventName'] = "unpause" PlayingItem[4].API.session_progress(tmepparam) I use above code can run correct, do not send event always, only send once. I have another thing, when I use kodi stop vedio playing, webhook can use chapterApi add the credits chapter, the problem is plugin do not update the changed, must close the kodi and restart it, then kodi can update these. How can plugin update the credits chapter when it added? Link to comment Share on other sites More sharing options...
quickmic 1352 Posted April 28 Share Posted April 28 7 hours ago, skyfish said: globals()["PlayingItem"][0]['IsPaused'] = False tmepparam = PlayingItem[0].copy() tmepparam['EventName'] = "unpause" PlayingItem[4].API.session_progress(tmepparam) I use above code can run correct, do not send event always, only send once. I have another thing, when I use kodi stop vedio playing, webhook can use chapterApi add the credits chapter, the problem is plugin do not update the changed, must close the kodi and restart it, then kodi can update these. How can plugin update the credits chapter when it added? Emby must report the change via Websocket. 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