Merge pull request #594 from cyrildtm/fixLikeUpdated

Fix like numbers re-format
This commit is contained in:
Dmitrii Selivanov authored and GitHub committed 2022-07-20 00:06:45 +02:00
commit f4e5591f66
4 files changed
+30 -5

No files matched your search

+2 -2
View File
@@ -153,10 +153,10 @@ function getLikeCountFromButton() {
if (isShorts()) {
//Youtube Shorts don't work with this query. It's not nessecary; we can skip it and still see the results.
//It should be possible to fix this function, but it's not critical to showing the dislike count.
return 0;
return false;
}
let likesStr = getLikeButton()
.querySelector("button")
.querySelector("yt-formatted-string#text")
.getAttribute("aria-label")
.replace(/\D/g, "");
return likesStr.length > 0 ? parseInt(likesStr) : false;