Created
July 14, 2022 22:30
-
-
Save yazdipour/237e580636861259704bab84df6023b9 to your computer and use it in GitHub Desktop.
Collected Youtube watchlater based on keyword
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
var urls = {}; | |
$('ytd-playlist-video-renderer').each(function (index, value) { | |
var keywords = ["uwp", 'xaml', "xamarin", 'quantum', 'android', 'css', 'tax', 'unity', 'game', 'asp', 'linq', 'graphql', 'c#', 'python', 'canada', 'windows', 'dell']; | |
var hyperlink = $(value).find('a.ytd-playlist-video-renderer')[0]; | |
var videoTitle = hyperlink.innerText.toLowerCase(); | |
// for all keywords in the array | |
for (var i = 0; i < keywords.length; i++) { | |
// if the keyword is in the title | |
if (videoTitle.includes(keywords[i])) { | |
// urls.push(hyperlink.href); | |
urls[videoTitle] = hyperlink.href; | |
} | |
} | |
}); | |
console.log(urls); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment