Last active
January 27, 2016 19:06
-
-
Save aNNiMON/a9be07cb5eb4e87ef306 to your computer and use it in GitHub Desktop.
ex.ua video links extractor
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 exuaTitle = $('h1').text(); | |
var out = exuaTitle + '\n=================='; | |
$('.list tr').slice(1).each(function(i, e) { | |
var nameRow = $(e).find('a[title]'); | |
var id = nameRow.attr('href').substring(nameRow.attr('href').lastIndexOf('/') + 1); | |
var title = nameRow.attr('title'); | |
var infoRow = $(e).find('td[align=right]'); | |
var md5 = infoRow.find('a').first().text(); | |
var server = infoRow.find('a').last().text(); | |
out += "\n\n" + title; | |
//out += "\nhttp://" + server + ".www.ex.ua/show/" + md5 + "/" + id + "/" + title; | |
out += "\nhttp://" + server + ".www.ex.ua/show/" + md5 + "/" + id + "/" + md5 + ".mp4"; | |
}); | |
saveFile(exuaTitle + "-links.txt", out); | |
})(); | |
function saveFile(filename, data) { | |
var blob = new Blob([data], {type:'text/plain'}); | |
var saveLink = document.createElement("a"); | |
saveLink.download = filename; | |
saveLink.innerHTML = "Save file"; | |
if (window.webkitURL != null) { | |
saveLink.href = window.webkitURL.createObjectURL(blob); | |
} else { | |
saveLink.href = window.URL.createObjectURL(blob); | |
saveLink.onclick = destroyClickedElement; | |
saveLink.style.display = "none"; | |
document.body.appendChild(saveLink); | |
} | |
saveLink.click(); | |
} | |
function destroyClickedElement(event) { | |
document.body.removeChild(event.target); | |
} |
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 saveFile(t,e){var n=new Blob([e],{type:"text/plain"}),i=document.createElement("a");i.download=t,i.innerHTML="Save file",null!=window.webkitURL?i.href=window.webkitURL.createObjectURL(n):(i.href=window.URL.createObjectURL(n),i.onclick=destroyClickedElement,i.style.display="none",document.body.appendChild(i)),i.click()}function destroyClickedElement(t){document.body.removeChild(t.target)}!function(){var t=$("h1").text(),e=t+"\n==================";$(".list tr").slice(1).each(function(t,n){var i=$(n).find("a[title]"),l=i.attr("href").substring(i.attr("href").lastIndexOf("/")+1),a=i.attr("title"),d=$(n).find("td[align=right]"),r=d.find("a").first().text(),o=d.find("a").last().text();e+="\n\n"+a,e+="\nhttp://"+o+".www.ex.ua/show/"+r+"/"+l+"/"+/*a*/r+".mp4"}),saveFile(t+"-links.txt",e)}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment