Last active
December 18, 2015 13:39
-
-
Save BerndGoldschmidt/5791654 to your computer and use it in GitHub Desktop.
Improved version, including:
- HD
- sorted list for easier track choosing like 6*.(pdf|mov) => only media track (Safari, Webkit, iBooks, …)
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
(function() { | |
var ps = document.getElementsByTagName("p"); | |
var sd = []; | |
var hd = []; | |
var pdf = []; | |
for (var i = 0; i < ps.length; i++) { | |
var p = ps[i]; | |
if (p.getAttribute("class") == "download") { | |
var as = p.getElementsByTagName("a"); | |
for (var j = 0; j < as.length; j++) { | |
var a = as[j]; | |
if (a.innerText == 'SD') { | |
sd.push(a.href); | |
} else if (a.innerText == 'PDF') { | |
pdf.push(a.href); | |
} else if (a.innerText == 'HD') { | |
hd.push(a.href); | |
} | |
} | |
} | |
} | |
console.log("sd: " + sd.length + ":\n" + sd.sort().join("\n")); | |
console.log("hd: " + hd.length + ":\n" + hd.sort().join("\n")); | |
console.log("pdf: " + pdf.length + ":\n" + pdf.sort().join("\n")); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment