Streamable Video Download Linker

This script will popup a javascript alert with the streamable video download link when visiting a streamable.com video.

< 脚本Streamable Video Download Linker的反馈

评价:好评 - 脚本运行良好

§
发表于:2021-06-02

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);
}

发表回复

登录以发表回复。