Last active
June 28, 2024 21:16
-
-
Save kirb/5840276 to your computer and use it in GitHub Desktop.
Download all WWDC videos and PDFs
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
/** | |
* Download all WWDC videos and PDFs | |
* by kirb <http://hbang.ws> / GPLv3 licensed <http://hbang.ws/s/gpl> | |
* | |
* Go to <https://developer.apple.com/wwdc/videos> and run this in your JavaScript console | |
* (option-cmd-i on OS X; F12 on Windows) | |
* | |
* Set hd = true if you want HD videos instead of SD (WARNING: will use a large amount of data) | |
* | |
* Make sure wget is installed too - it isn't by default for most OSes. You could also change | |
* wget to curl (included with OS X) and -O to -o, if that's how you roll. | |
*/ | |
var hd = false, | |
videos = "", | |
pdfs = ""; | |
[].forEach.call(document.querySelectorAll("li.session"), function(session) { | |
[].forEach.call(session.querySelectorAll("a[href$='.mov?dl=1'][href*='_" + (hd ? "hd" : "sd") + "_'], a[href$='.pdf?dl=1']"), function(link) { | |
var command = "wget '" + link.href + "' -O \"Session " + session.id.replace(/^([0-9]+)-.*$/, "$1") + " - " + session.querySelector(".title").innerText + "." + link.href.replace(/^.*\.([a-z]+)\?dl=1$/, "$1") + "\"; "; | |
if (/\.pdf\?dl=1$/.test(link.href)) { | |
pdfs += command; | |
} else { | |
videos += command; | |
} | |
}); | |
}); | |
document.body.innerText = videos + pdfs; | |
alert("Done. Copy and paste the commands on this page and have fun watching the WWDC awesomeness."); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment