Skip to content

Instantly share code, notes, and snippets.

@trumad
Created September 15, 2020 21:58
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 trumad/9775bc999cc2a4fef3b320f9cde2ef1d to your computer and use it in GitHub Desktop.
Save trumad/9775bc999cc2a4fef3b320f9cde2ef1d to your computer and use it in GitHub Desktop.
How to grab videos from patreon posts en masse.
//Enter the following commands in a browser console.
// First, set up a way to click on stuff. just using .click() doesn't seem to work for some reason.
var clickEvent = new MouseEvent("click", {
"view": window,
"bubbles": true,
"cancelable": false
});
// Then load up all the posts. You'll probably need to click "load" a few times to see all of them.
// Then make an array of the play buttons
var array = document.querySelectorAll("button[title='Start playback']")
// Loop through, and click them all
for (var i=0,j = array.length;i<j;i++){
array[i].dispatchEvent(clickEvent);
}
//Then maybe wait a minute or so for all the vids to load & start
//Find all the youtube iframes
var frames = document.querySelectorAll("iframe")
var output = ``;
for (var i=0,j = frames.length;i<j;i++){
output = `${output}
${frames[i].src}
`
}
// If you want to download all of them, copy the output to a text file or something and use
// youtube-dl --batch-file name_of_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment