HatScripts / youtube-auto-liker

A userscript that automatically likes 👍 each video you watch on YouTube ▶️
68 stars 15 forks source link

Fix getting subscribe button status #23

Closed BleakBluets closed 1 year ago

BleakBluets commented 1 year ago

Currently, isSubscribed() is unable to find the subscribe button because the <tp-yt-paper-button> tag and subscribed attribute no longer exist. This fix instead looks for the subscribe-button-hidden attribute on the <ytd-subscribe-button-renderer> tag.

BleakBluets commented 1 year ago

This change was tested on Firefox 112.0b3, Windows 10 22H2, Violent Monkey 2.14.0.

I tested it on videos for which I was subscribed and videos which I'm unsubscribed, but I did not test playlists or shorts. As far as I can tell, the subscribe-button-hidden attribute only appears in order to hide the subscribe button for users that are already subscribed, but its name implies that there might be other reasons to hide the subscribe button.

I could not find any other attributes or classes on descendants of #subscribe-button that would indicate whether or not a user is subscribed.

HatScripts commented 1 year ago

Thank you for this. Merged! 🚀