Created
September 15, 2020 21:58
-
-
Save trumad/9775bc999cc2a4fef3b320f9cde2ef1d to your computer and use it in GitHub Desktop.
How to grab videos from patreon posts en masse.
This file contains 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
//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