vip视频解析 - 豆瓣

movie.douban.com 超轻量豆瓣影视在线播放脚本,在豆瓣电影条目页面内直接添加视频播放窗口

  1. // ==UserScript==
  2. // @name vip视频解析 - 豆瓣
  3. // @namespace https://github.com/1771245847
  4. // @version 0.0.2
  5. // @description movie.douban.com 超轻量豆瓣影视在线播放脚本,在豆瓣电影条目页面内直接添加视频播放窗口
  6. // @license MIT
  7. // @author 1771245847
  8. // @match https://movie.douban.com/subject/*
  9. // ==/UserScript==
  10.  
  11. 'use strict';
  12. if (!document.querySelector(".bs")) return;//unplayable
  13.  
  14. const server = "https://www.yemu.xyz/?url=";
  15. const $ = window.jQuery;
  16.  
  17. const div = document.createElement("div");
  18. div.setAttribute("id","fm");
  19. div.setAttribute("style","width: 100%;height:300px;padding-bottom: 15px;");
  20. const x = document.createElement("input");
  21. x.setAttribute("type","button");
  22. x.setAttribute("value"," X ");
  23. x.setAttribute("style","position: relative;float: right;z-index: 2;");
  24. const newItem = document.createElement("iframe");
  25. newItem.setAttribute("id","play");
  26. newItem.setAttribute("name","playf");
  27. newItem.setAttribute("frameborder","0");
  28. newItem.setAttribute("style","width: 100%;height: 300px;");
  29. newItem.setAttribute("allowfullscreen","allowfullscreen");
  30. newItem.setAttribute("security","restricted");
  31. newItem.setAttribute("referrerpolicy","no-referrer");
  32. newItem.setAttribute("style","width: 100%;height: 300px;position: absolute;");
  33.  
  34. let mov = true;
  35. var dp = function (event) {
  36. let self = event.target;
  37. let parentDiv,insert,before,tt;
  38. switch (self.parentNode.nodeName) {
  39. case 'LI':
  40. parentDiv=document.getElementById("mainpic").parentNode.parentNode;
  41. before=document.getElementById("mainpic").parentNode;
  42. insert=div;
  43. div.appendChild(x);
  44. div.appendChild(newItem);
  45. x.addEventListener("click",()=>div.parentNode.removeChild(div));
  46. break;
  47. case 'DIV':
  48. parentDiv=self.parentNode.parentNode;
  49. before=self.parentNode;
  50. insert=newItem;
  51. tt = document.getElementById("eptitle");
  52. if(!tt){
  53. let playtitle = "<h2 id = 'eptitle'>当前播放 第"+self.innerText+"</h2>"
  54. document.querySelector(".cross").outerHTML += playtitle;
  55. }else{
  56. tt.innerText="当前播放 第"+self.innerText;
  57. document.querySelector(".episode-list").querySelectorAll('a').forEach((a)=>a.style.border='');
  58. };
  59. newItem.setAttribute("style", "width: 100%;height: 300px;margin: 0px 0px 7px -13px;");
  60. self.setAttribute("style","border: 1px solid;");
  61. break;
  62. };
  63. parentDiv.insertBefore(insert, before);
  64. };
  65. document.querySelector('.bs').querySelectorAll('li').forEach((a)=>{
  66. a.children[1].innerText=a.children[0].innerText;
  67. a = a.children[0];
  68. a.innerText = "解析播放";
  69. a.setAttribute("style","display: inline-block; text-indent: 20px; background: no-repeat url(https://img3.doubanio.com/f/sns/5741f726dfb46d89eb500ed038833582c9c9dcdb/pics/sns/doulist/ic_play_web@2x.png) left center / 16px;");
  70. if (a.href == "javascript: void 0;") return;
  71. a.href=server+a.href.split('?url=')[1];
  72. a.setAttribute("target","playf");
  73. a.addEventListener("click",dp);
  74. mov = false;
  75. });
  76. if(mov){
  77. document.addEventListener('DOMNodeInserted', function(event) {
  78. if(event.target.className!='play-source') return;
  79. document.querySelector(".episode-list").querySelectorAll('a').forEach((a)=>{
  80. a.href = server+a.href.split('?url=')[1];
  81. a.setAttribute("target","playf");
  82. a.addEventListener("click",dp);
  83. });
  84. });
  85. };
  86.  

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址