Skip to content

Instantly share code, notes, and snippets.

@erikccoder
Created October 3, 2015 19:15
Show Gist options
  • Save erikccoder/e3915e737214736c381a to your computer and use it in GitHub Desktop.
Save erikccoder/e3915e737214736c381a to your computer and use it in GitHub Desktop.
Kodi_bookmarklet.js
var videos = document.querySelectorAll("video");
if(videos.length<1){ alert("no video found!"); return;
}
var i=0;
var src = prompt("playIt? " + i + "/" + videos.length, videos[i].src);
if(src == null){ alert("no src found"); return;
}
var url ='http:\/\/192.168.0.107:8080\/jsonrpc?request={"jsonrpc":\"2.0\",\"id\":\"1\",\"method\":\"Player.Open\",\"params\":{\"item\":{\"file\":\"'+src+'\"}}}';
window.location = decodeURIComponent(url);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment