AceStream links open TV Video streaming links in browser

Replaces acestream:// with 127.0.0.1:6878/webui/player/

  1. // ==UserScript==
  2. // @name AceStream links open TV Video streaming links in browser
  3. // @namespace https://github.com/ARTEMISPETROV
  4. // @description Replaces acestream:// with 127.0.0.1:6878/webui/player/
  5. // @include http://*
  6. // @include https://*
  7. // @version 1.1
  8. // @author Artem Petrov <petrovartem@protonmail.com> ( https://github.com/ARTEMISPETROV)
  9. // @source https://github.com/ARTEMISPETROV/AceStream-Player-Watch-streaming-TV-Video-in-browser-Userscript.git
  10. // @license MIT
  11. // @grant GM_getValue
  12. // ==/UserScript==
  13.  
  14. var url1,url2;
  15. url1 = ['acestream://'];
  16. url2 = ['127.0.0.1:6878/webui/player/'];
  17. url3 = ['?autoplay=true'];
  18. var a, links;
  19. var tmp="a";
  20. var p,q;
  21. links = document.getElementsByTagName('a');
  22. for (var i = 0; i < links.length; i++) {
  23. a = links[i];
  24. for(var j=0;j<url1.length; j++)
  25. {
  26. tmp = a.href+"" ;
  27. if(tmp.indexOf(url1[j]) != -1)
  28. {
  29. p=tmp.indexOf(url1[j]) ;
  30. q="http://";
  31. q = q + url2[j] + tmp.substring(p+url1[j].length,tmp.length)+ url3;
  32. a.href=q ;
  33. }
  34. }
  35. }