Last active
October 8, 2022 18:11
-
-
Save akiirui/a14f887bd69343889f02f60cfc7ee033 to your computer and use it in GitHub Desktop.
Check YouTube Music like songs status in your playlists.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numAll = 0; | |
let numFine = 0; | |
let numError = 0; | |
let List = []; | |
let ErrorList = []; | |
document | |
.querySelectorAll( | |
"ytmusic-playlist-shelf-renderer > div > ytmusic-responsive-list-item-renderer" | |
) | |
.forEach((element) => { | |
const song = element.querySelector( | |
"ytmusic-like-button-renderer[like-status='LIKE']" | |
); | |
if (!song) { | |
ErrorList.push( | |
element.querySelector( | |
".title.style-scope.ytmusic-responsive-list-item-renderer" | |
).title | |
); | |
numError += 1; | |
} else { | |
numFine += 1; | |
} | |
List.push( | |
element.querySelector( | |
".title.style-scope.ytmusic-responsive-list-item-renderer" | |
).title | |
); | |
numAll += 1; | |
}); | |
console.log("All :", numAll, "\nFine:", numFine, "\nErr :", numError); | |
console.log("Songs:", List); | |
console.log("Error Songs:", ErrorList); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document | |
.querySelectorAll( | |
"ytmusic-playlist-shelf-renderer tp-yt-paper-icon-button[class~='like'][aria-pressed='false']" | |
) | |
.forEach((element, i) => { | |
setTimeout(() => { | |
element.click(); | |
}, 1000 * i); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document | |
.querySelectorAll( | |
"ytmusic-playlist-shelf-renderer tp-yt-paper-icon-button[class~='like'][aria-pressed='true']" | |
) | |
.forEach((element, i) => { | |
setTimeout(() => { | |
element.click(); | |
}, 1000 * i); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment