austencm / youtube-auto-like

Chrome extension that automatically likes videos from your subscribed channels.
MIT License
164 stars 53 forks source link

Youtube Design Update - fix needed #106

Closed StephanSteinert closed 2 years ago

StephanSteinert commented 2 years ago

Liking not working anymore probably due a design change.

Source Code Video Ct3IMbt958A.txt


Log

YouTube Auto Like v2.7.1 Fri May 13 2022 User agent: { "browser": { "name": "Chrome", "version": "101.0.4951.54" }, "os": { "name": "Windows", "version": "NT 10.0", "versionName": "10" }, "platform": { "type": "desktop" }, "engine": { "name": "Blink" } } navigated: https://www.youtube.com/ loading options... ...options loaded ({ "disabled": false, "like_what": "all", "like_when": "percent", "like_when_minutes": "2", "like_when_percent": "50" })

liker started waiting for video.. .

wthueb commented 2 years ago

Looks like it's yt-icon instead of yt-icon-button. Not sure why YouTube would make that change, but alas.

Edit: just kidding. Looks like they changed #menu-container to #menu.

MCM-Math commented 2 years ago

I'm wondering if austencm would still be working on this, and/or someone else could maintain their own update for this extension.

StephanSteinert commented 2 years ago

I changed the queryselector:

const r = document.querySelector("#menu #top-level-buttons-computed > ytd-toggle-button-renderer:first-child yt-icon-button"),
i = document.querySelector("#menu #top-level-buttons-computed > ytd-toggle-button-renderer:nth-child(2) yt-icon-button");

and it works for me so far. Meeds more testing and a proper merge request. Replace the content.js with the attached file if yu trust me. I also uncompressed the code so you can audit it.

content.js.txt

austencm commented 2 years ago

It's still working for me, which makes me think this is more A/B testing by youtube. But I'll go ahead and merge @wthueb's PR regardless.