Created
June 3, 2024 05:41
-
-
Save emnopal/f1fb4ceb4d4dadf4ea879df6798611a2 to your computer and use it in GitHub Desktop.
Revisions
-
emnopal renamed this gist
Jun 3, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
emnopal created this gist
Jun 3, 2024 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ 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)