Skip to content

Instantly share code, notes, and snippets.

@lyoshenka
Last active December 10, 2015 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lyoshenka/4407493 to your computer and use it in GitHub Desktop.
Save lyoshenka/4407493 to your computer and use it in GitHub Desktop.
Collect list of YouTube favorites as a JSON string. Run this code in your Javascript console while at https://www.youtube.com/my_favorites
all = {}; $('#vm-playlist-video-list-ol li').each(function(){
var self = $(this),
id = self.attr('id').substring(9),
title = self.find('a.vm-video-title-content').text(),
url = self.find('a.vm-video-title-content').attr('href').split('&',1),
user = self.find('a.yt-user-name').text(),
time = self.find('.video-time').text();
all[id] = {
id: id,
user: user,
time: time,
url: url.toString(),
title: title
};
}); console.log(JSON.stringify(all));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment