Skip to content

Instantly share code, notes, and snippets.

@Bestulo
Created December 19, 2020 11:34
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 Bestulo/1c0b436fccce7b0e9716211d31d6e0f6 to your computer and use it in GitHub Desktop.
Save Bestulo/1c0b436fccce7b0e9716211d31d6e0f6 to your computer and use it in GitHub Desktop.
// Works for a max of 50 entries
// Needs to inject jQuery first so you can use .map (Reddit uses Jquery Slim which can't map)
// Just copy and paste the contents of minified jQuery into console, then $ = jQuery
// https://code.jquery.com/jquery-3.5.1.min.js
const idarr = []
$(".entry a.title").map((a, b) => idarr.push(/youtu(?:.*\/v\/|.*v\=|\.be\/)([A-Za-z0-9_\-]{11})/.exec($(b).attr('href'))[1]))
console.log('https://www.youtube.com/watch_videos?video_ids=' + idarr.join(','))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment