视频播放

自用视频播放

  1. // ==UserScript==
  2. // @name 视频播放
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.7
  5. // @description 自用视频播放
  6. // @author rubysiu
  7. // @match *://*.v.qq.com/x/*
  8. // @match *://*.v.youku.com/v_show/*
  9. // @match *://*.iqiyi.com/*
  10. // @match *://*.mgtv.com/*
  11. // @exclude *://www.iqiyi.com/
  12. // @exclude *://www.mgtv.com/
  13. // @icon https://s3.bmp.ovh/imgs/2021/12/ab22ca08387d82f2.jpg
  14. // @grant none
  15. // @license rubysiu
  16. // ==/UserScript==
  17.  
  18. (function() {
  19. 'use strict';
  20. // Your code here...
  21. function toNext(api){
  22. let videoUrl = location.href;
  23. console.log(api)
  24. window.open(`${api}${videoUrl}`,'_blank');
  25. }
  26. let dom = document.createElement("ruby");
  27. let apiList = [{"name":"解析啦","url":"https://api.jiexi.la/?url="},{"name":"OK解析","url":"https://okjx.cc/?url="}]
  28. dom.style.background = "rgb(84 220 140 / 100%)";
  29. dom.style.position = "fixed";
  30. dom.style.padding = "5px";
  31. dom.style.color = "#fff";
  32. dom.style.top = "50%";
  33. dom.style.zIndex = "9999";
  34. dom.style.borderRadius = "0 5px 5px 0";
  35. document.body.appendChild(dom);
  36. let apiListDoma = "";
  37. for (const key in apiList) {
  38. let domDv = document.createElement("div");
  39. domDv.innerText = apiList[key].name
  40. domDv.addEventListener("click",function(){
  41. toNext(`${apiList[key].url}`)
  42. })
  43. dom.appendChild(domDv)
  44. }
  45. })();