This works perfectly, but the alert link is unorthodox, I added a bit of code to make a link in the bottom bar, with an alert fallback. Its not pretty but it works!
var Dlink = null;
var S = document.getElementsByTagName("script");
for (var x=0; x<S.length; x++) {
if (S[x].getAttribute("id")) {
if (S[x].getAttribute("id").match(/player\-js/) || S[x].getAttribute("id").match(/embed\-js/)) {
var tc = S[x].textContent.toString();
if (tc.length>1) {
var js = tc.split("var videoObject = {")[1].split('"files": ')[1].split("}},")[0] + "}}";
var json = eval(JSON.parse(js));
Dlink = "https:"+json.mp4.url;
break;
}
}}
}
if (!Dlink) return;
var action_bar = document.getElementsByClassName('actions-section')
if (action_bar.length) {
var el = document.createElement('a')
el.innerText = 'Download';
el.style.float = "right";
el.href = Dlink;
action_bar[0].appendChild(el)
} else {
alert(Dlink);
}
This works perfectly, but the alert link is unorthodox, I added a bit of code to make a link in the bottom bar, with an alert fallback. Its not pretty but it works!