-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latest watchmarker version broke YouTube watched badge detection #114
Comments
Actually scratch that last part. I was doing that in a personal container and watchmarker apparently isn't compatible with multi-account containers? edit: Also means these conditions probably won't work in private windows as well in Firefox. Doing it without any containers, the "opened in the browser" and "appears in browser history" conditions do work, but "official Youtube watched badge" still doesn't despite showing YT progressbars. |
I just logged in, then it showed the progress bar underneath videos I watched when logged in, and it successfully added them to the Watchmarker's watch history. I then logged out and all the progress bars disappeared (the Watchmarker correctly kept marking videos from it's history database as watched). I am under the impression that Youtube doesn't show the progress indicator unless you are logged in, so I am not sure what is going on. 🤔 What has changed in the recent update is the mechanism of how Youtube's progress indicator is being used. That is, in the old version of the Watchmarker it was being inferred from the DOM but there were false positives due to race conditions (Polymer will reuse a DOM elements, update a video title to that of a new video but not remove the progress indicator yet, then the Watchmarker may discover the updated DOM element before Polymer completed the update and removed the progress indicator). The new version monitors the network traffic instead to fix this ( Considering your excellent previous contributions to the Watchmarker, you are probably skilled enough to debug what is going on. I would do it myself but I haven't been able to replicate this behavior on my end yet. The relevant code is this and this. Maybe adding a |
Hmm, I'll try to look into it but it'll have to be later. The easiest thing to do would be a "revert" of sorts, where the old method is still available perhaps under an option. Glancing into the linked new code, the usage of |
I am not sure why the old approach would work for your case, something else seems off. If they have a progress indicator then that needs to be in the traffic somewhere and it should be picket up by the new mechanism. 🤔
Thanks for the heads-up! We can add that script to this one instead. The only reason I am using
I am still sitting this one out for as long as possible (hopefully forever). Forcing all developers to sink an exceptional amount of time into the migration just to crack down on adblocking isn't a game that I want to participate in. |
Well I noticed this issue because it DID work before. At least on Chrome, and given my image above, should've also worked on Firefox. If the YT watch progressbars aren't appearing for you when logged out, I suspect it's one of those Youtube A/B testing experiments that are specific to your "account" (even when logged out, YT assigns some sort of persistent session via cookies for you) |
Good guess regarding the A/B testing. 👍 To achieve the behavior that you expect, we could add another mechanism to detect whether a video is being watched: intercept the network traffic for video playback. If we notice that a video is being watched we mark it as such. This could replace the current mechanism for "Mark a video as watched once it has been opened in the browser." altogether. |
I thought about something like that. But I'm worried about the cases where the video doesn't autoplay (disabled by an extension, or in an embed with autoplay disabled) and YT prefetches video data but doesn't actually play it yet. YouTube itself doesn't consider the video watched yet, so it shouldn't be marked as watched in this case. There must be some other mechanism in play that YouTube uses to recognize actual playback rather than just fetching video data. |
I think the YT watched badge detection is broken even when logged in. I thought it was working before but that was actually just the YT watch history detection eventually marking the videos as watched. |
Can confirm broken even when logged in. Have to perform a Sync from options page for it to detect watched status. |
Not sure why this is happening for you folks, works just fine for me. Below is Firefox on the left and Chromium on the right, both having the Watchmarker installed. When I watch a video on the left and refresh the page on the right it gets marked and vice versa. That can only happen through the badge detection. Not sure how I can reproduce the behavior you are experiencing to debug this. 🤔 2024-01-06.14-37-48.mp4 |
The badge detection may work on channel pages (and maybe home and subscription pages), but it's not working for playlist/queue entries for me. And I think in earlier testing it also didn't work on recommendation entries. |
I just made some modifications, does the attached version improve things? Make sure to backup your database before you try. |
The new version looks for the player telling Youtube how much of the video has been watched. If the video is not muted and more than one minute has passed then the extension considers the video as watched. Maybe the "1 minute" condition didn't hold true in your test? And yeah, I should improve logging.
That's exactly it and it is very frustrating not to be able to intercept the body. After all, I can do it myself in a janky way, so why not provide the feature out of the box in the browser extension interface. 🤷 |
Unfortunately not, the |
By the way, hooking into youtube-watchmarker/background.js Lines 1905 to 1949 in 81ddf26
|
Oh, the 1 min thing was for the new watchtime detector. That does work in my testing. Though the 1 min requirement shouldn't be there. In my experience, the moment there's any actual playback (presumably the first watchtime request), it counts as watched and the watched badge appears for it. There are also many videos that are shorter than 1 minute, notably all the #shorts crap.
Well that sucks. I wonder how Tampermonkey and other userscript managers do this, since I've intercepted XHR just fine in YT userscripts before. |
I reduced the 1 minute requirement to 3 seconds, feel free to give the attached versions a try.
Good question. I also wonder whether other extensions are preventing the Watchmarker's hooks (since they work fine for me). |
The YT watchtime detection does work, but 3 seconds is still insufficient for extremely short videos. For example, top result for "1 second video" for me: https://www.youtube.com/watch?v=MvsAesQ-4zA YT badge detection still doesn't work for me. I'm going to try this later on chrome when I have time, since firefox devtools isn't showing me the injected code so I can't even try figuring out if the injected code is actually working. |
Was not able to test the xpi versions in this thread, but latest update 4.6.1 seems to be working as expected upon initial testing. |
Version:
4.5.1 Chrome extension
Steps to reproduce:
Update: Seems to be broken even when logged in.
Expected result:
The videos except maybe the last all become marked as watched by Watchmarker. The last may not be marked since it doesn't show the Youtube watched badge yet (until adding another video to the queue).
Actual result:
None of the videos are registered as marked by you
There are other ways to reproduce, since YT recommendations and playlist items with YT watched badge also no longer register as watched in Watchmarker.
I believe the culprit is something has changed that removed or broke the usage of
youtubeEnsure
messages from YT-page-injected code.The text was updated successfully, but these errors were encountered: