Closed pezz closed 2 months ago
Works fine for me and I have seen logs from other people showing that is working fine for them as well.
Will need a debug log to see why it doesn't seem to work for you
Ok cool, I'll get some more info tomorrow.
I have noticed a similar issue. Not consistently though. Most of the times it works OK but only in some cases it doesn't mark a video as watched. I only seem to notice it in the following situations:
In both cases, when it finishes playing the video, it may or may not be marked as watched.
Notable detail: If it is not marked as watched after playing, using the "w" keyboard shortcut to mark it watched does not work. It can only be marked as watched from the context menu in these cases. It's only been a minor inconvenience for me.
I'll see if I can reproduce and generate debug logs later today.
I had one instance again. Had a video that stalled and stopped playing and resumed watching a few minutes later. It did not get marked as watched. However, I was able to mark it as watched with the 'w' key this time. kodi.log Hope this debug log helps!
Hope this debug log helps!
@Fludizz - yes it does, thanks. Even without the log, the description of what you are doing (resuming, using w
key, etc.) and what you observed (w
sometimes does nothing, but does work from context menu) provides enough detail to understand the problem.
However your issue may be different to the OP's, as the original provided details are less clear and seem to indicate a more general issue. @pezz - can you clarify a bit more?
Apologies, I was going to provide a debug log but there's a lot of information in it that I don't want shared (info about library, searches etc).
@pezz - without a log can't do much. There is nothing specific to v7.0.6 that could cause this as far as I can see.
Are you skipping/seeking or using something like SponsorBlock?
FWIW I don't need a full log, just the section from when you start playback to when it stops. You should see something like this in the log, need everything in the middle and inclusive of these lines:
2024-05-07 09:45:04.359 T:12172 debug <general>: [plugin.video.youtube] PlayerMonitorThread[<VIDEO_ID>]: Starting
2024-05-07 09:45:04.359 T:12172 debug <general>: [plugin.video.youtube] send_notification: |PlaybackStarted| -> |{'video_id': '<VIDEO_ID>', 'channel_id': '<CHANNEL_ID>', 'status': {'unlisted': False, 'private': False, 'crawlable': True, 'family_safe': False, 'live': False}}|
2024-05-07 09:45:04.460 T:10084 debug <general>: [plugin.video.youtube] onNotification: |unhandled method| -> |Other.PlaybackStarted|
...
2024-05-07 09:45:14.371 T:10084 debug <general>: [plugin.video.youtube] onNotification: |unhandled method| -> |Other.PlaybackStopped|
Not sure what SponsorBlock is, so no, I'm not using it.
It doesn't matter if I seek or leave the playback alone, it never sets watched status.
Also, I tried "refresh after playback" as well and it made no difference.
Here's a log, I included some of the lines after the stopped event in case they're relevant. https://gist.github.com/pezz/fe4b9fc1cec31241b33e68d2624a4dbc
In that log you opened then immediately stopped the video. Is the expectation that this should mark the video as watched? Did it do this before? It should not have.
Can you get a log of where you play a video to the end and it doesn't get set as watched? Can skip to a few seconds before the end, then allow the video to play to the end.
In that log I started a single video and let it play to the end (there's only one start and stop section).
I'll do it again.
This looks pretty wrong I guess? It seems I start a video and it immediately notifies that it has ended?
Here I started playing one video, let it play for a bit (much more than a second), stopped it, then started a second video.
% grep PlayerMonitorThread kodi.log
2024-05-07 15:06:32.692 T:11681 debug <general>: [plugin.video.youtube] PlayerMonitorThread[CjE2biiE3Ro]: Starting
2024-05-07 15:06:32.693 T:11681 debug <general>: [plugin.video.youtube] PlayerMonitorThread[CjE2biiE3Ro]: Stop event set
2024-05-07 15:06:32.724 T:11681 debug <general>: [plugin.video.youtube] PlayerMonitorThread[CjE2biiE3Ro]: End event set
2024-05-07 15:07:19.748 T:11644 debug <general>: [plugin.video.youtube] PlayerMonitorThread[CjE2biiE3Ro]: clean up
2024-05-07 15:07:27.478 T:11738 debug <general>: [plugin.video.youtube] PlayerMonitorThread[4KRom9XnFa4]: Starting
2024-05-07 15:07:27.479 T:11738 debug <general>: [plugin.video.youtube] PlayerMonitorThread[4KRom9XnFa4]: Stop event set
2024-05-07 15:07:27.513 T:11738 debug <general>: [plugin.video.youtube] PlayerMonitorThread[4KRom9XnFa4]: End event set```
Yep, not what should happen at all. I cannot replicate or even explain why it would happen.
Can you grep for [plugin.video.youtube]
instead of PlayerMonitorThread
? Too much stuff missing to understand what is happening.
I grepped out a few things, my grep is at the top. Hope it helps.
https://gist.github.com/pezz/31510d0eac0a5f05ba34e8942fd82cbf
P.S. This was a new run and I only played a single video.
Two more things:
while not self.abort_now():
self._context.log_debug(f'{playing_file = }') # Extra logging
try:
current_file = player.getPlayingFile()
self.current_time = player.getTime()
self.total_time = player.getTotalTime()
except RuntimeError:
self.stop()
break
self._context.log_debug(f'{current_file = }') # Extra logging
grep '\[plugin.video.youtube\]|EXCEPTION' kodi.log | grep -v Converting | grep -v googlevideo | grep -v youtube.api
Pretty sure I've done this right, there's two huge googlevideo URLs, not sure if they contain my API info or not, but this is what that extra code seems to produce, if there's an arg in there that you want let me know.
% grep '\[plugin.video.youtube\]' kodi.log | grep -i _file
2024-05-07 19:12:17.258 T:30112 debug <general>: [plugin.video.youtube] playing_file = 'https://<googlevideo>
2024-05-07 19:12:17.258 T:30112 debug <general>: [plugin.video.youtube] current_file = 'https://<googlevideo>
Unfortunately there is not much point in adding the extra logging if you aren't willing to share it.
Anyway I have worked around what I think the problem may be, and it should be fixed in the next beta.
If you are still having problems with the next beta release then you can provide an update, but without at least a complete section of the log I won't be willing to investigate further to determine the underlying root cause. Too much guess work with just the bits and pieces of the logs provided.
Yeah fair enough. If there was part of the URL that you were interested in I would've provided it. I'm just wary of what info is encoded in the entire thing.
Will close this and stop the noise.
Cheers.
I can understand the need to avoid sharing PII, but it means that you will need to deal with some friction at times.
Like I said the next beta should avoid the problem, even if the root cause is not addressed: https://github.com/anxdpanic/plugin.video.youtube/pull/740
@pezz - https://github.com/anxdpanic/plugin.video.youtube/releases/tag/v7.0.7%2Bbeta.1 is available. Can see if it fixes this issue.
@Fludizz - this beta release should also improve the issue you identified, but they won't be properly fixed until the next beta.
@MoojMidge This is much better, I need to test with a few more videos / give it more tries, as I think it's a bit hit-and-miss as sometimes it's not setting the status properly at the end of some vids, but I need to do much more testing.
Saving the played position when stopping a video part of the way through is also working.
Kodi not exiting properly is still an issue on this version too.
Also, I've noticed occasionally I get a notification from the addon that says something like "Error 98: port already in use" or similar.
Also, I've noticed occasionally I get a notification from the addon that says something like "Error 98: port already in use" or similar.
You could have saved me a lot of time by letting me know this earlier - it is the root cause of your entire issue. This is why logs are important. Tried to make some changes that may fix this in the next beta.
Kodi not exiting properly is still an issue on this version too.
Can you clarify? You previously indicated the following:
I noticed this as well with 7.0.5 after recent upgrades. None of the 7.0.6.x versions do this on my system.
Is it actually the other way around? Kodi was exiting properly using Arch and Python v3.12 with v7.0.5 of this plugin, but not in any more recent version?
I think it's a bit hit-and-miss as sometimes it's not setting the status properly at the end of some vids, but I need to do much more testing.
I am not aware of anything other than seeking/skipping that can cause the Kodi video player to not properly identify the video progress, and that should now be resolved (if not in the current beta, then in the next beta). If you identify any other scenario where the watched status doesn't update, let me know.
@Fludizz - this beta release should also improve the issue you identified, but they won't be properly fixed until the next beta.
I've again had some instances where it didn't mark a video as watched. Having the refresh option toggled like you suggested didn't make a difference unfortunately. Will try to get a debug log.
I've again had some instances where it didn't mark a video as watched.
This was with normal playback? Not seeking or skipping to the end?
Having the refresh option toggled like you suggested didn't make a difference unfortunately.
This will only help if the correct resume/watched information was saved but just not displayed in time. What does the w
key do, when you see a video not being marked as watched now?
Will try to get a debug log.
That will really help, thanks.
It was a video I stopped and watched later with "Resume from w
and had to use the context menu.
I frequently seek through video's (to skip the sponsored segments) and that does not appear to trigger the issue.
I've tried to force the issue but it hasn't happend again yet. But then again, it already didn't happen a lot to begin with.
Just to confirm this is with v7.0.7+beta.1? See if there is any difference with v7.0.7+beta.2
Yes, this was after updating to 7.0.7+beta.1 I have updated i to 7.0.7+beta.2 now and will report back if I can reproduce.
I have not seen any occurrences since updating to beta.2 - It seems resolved. Thanks @MoojMidge :)
Thanks for confirming
Context
Please provide any relevant information about your setup
Expected Behavior
After watching a video it should be set to watched.
Current Behavior
After watching a video it is not set to watched / have the tick.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Log
Please include a complete debug log.
Would a log help here? It's easily observed behaviour.
Happy to provide if so.
Additional Information
Only using local playback history, not updating YouTube.