Created
June 3, 2024 05:41
-
-
Save emnopal/f1fb4ceb4d4dadf4ea879df6798611a2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| const foo = document.getElementsByTagName('ytmusic-responsive-list-item-renderer'); | |
| const musicObj = {} | |
| for (let i = 0; i < foo.length; i++){ | |
| let newObj = foo[i]; | |
| let otherObj = newObj.getElementsByTagName('yt-formatted-string'); | |
| for (let j = 0; j < otherObj.length; j++){ | |
| let a = otherObj[j]; | |
| let aObj = a.getElementsByTagName('a'); | |
| let aObjGHTML = aObj[0]; | |
| if (aObjGHTML){ | |
| if (aObjGHTML.href.includes('watch')) { | |
| // console.log(aObjGHTML) | |
| musicObj[aObjGHTML.innerHTML] = aObjGHTML.href | |
| } | |
| } | |
| } | |
| } | |
| console.log(musicObj) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment