Jump to content

Recommended Posts

Posted

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.

quickmic
Posted

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.

Posted (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 by skyfish
  • Like 1
Posted
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

  • Thanks 1
quickmic
Posted (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 by quickmic
Posted
48 minutes ago, quickmic said:

章节是如何标记的?请给我一个例子,因为这不是“Emby 标准”,我需要知道什么样的章节应该被解析为信用标记。

image.thumb.png.661a1d7068db3397a69860f247a65e96.png

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.

image.png.35ed74c9a814edbb6563cbe3d8919b43.png

This is the Credits chapter that ChapterApi plugin added.

Hope this can help you!

  • Thanks 1
quickmic
Posted (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 by quickmic
  • Like 1
Posted
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.

image.thumb.png.4746d5d56bd4bbf75df63d3294a87ac0.png

image.thumb.png.53534e6c62a52cd997445ee32bd44eef.png

Add the EventName property can recieve msg.

Hope this can help you!

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

image.thumb.png.4746d5d56bd4bbf75df63d3294a87ac0.png

image.thumb.png.53534e6c62a52cd997445ee32bd44eef.png

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.

  • Thanks 1
quickmic
Posted (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 by quickmic
Posted (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 by skyfish
  • Like 1
Posted
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?

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

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