优酷VIP站外解析

替换页内播放器并可以点击vip转跳外部网站播放

  1. // ==UserScript==
  2. // @name 优酷VIP站外解析
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.8
  5. // @description 替换页内播放器并可以点击vip转跳外部网站播放
  6. // @author You
  7. // @include *://m.youku.com/v*
  8. // @include *://m.youku.com/a*
  9. // @include *://v.youku.com/v_*
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. let parsurl = 'https://jx.618g.com/?url='
  16. // let parsurl = 'http://jqaaa.com/jx.php?url='
  17. // 向后插入元素
  18. function insterAfter(newElement, targetElement){
  19. var parent = targetElement.parentNode;
  20. if(parent.lastChild == targetElement){
  21. parent.appendChild(newElement);
  22. }
  23. else{
  24. parent.insertBefore(newElement, targetElement.nextSibling);
  25. }
  26. }
  27. // 替换内video 失败 不能全屏
  28. let time = setInterval(() => {
  29. if (document.querySelector(".vip_info").innerHTML.trim() != '') {
  30. let parent = document.querySelector("#ykPlayer")
  31. let child = parent.querySelector(".youku-film-player")
  32. let child2 = parent.querySelector(".preplay-layer")
  33. let child3 = parent.querySelector(".top_area")
  34. parent.removeChild(child)
  35. parent.removeChild(child2)
  36. let para = document.createElement("iframe")
  37. para.style.width = "100%"
  38. para.style.height = "100%"
  39. para.style.border = "0"
  40. para.src = parsurl + window.location.href
  41. parent.insertBefore(para, child3)
  42. window.clearInterval(time)
  43. }
  44. }, 1000)
  45. // 替换内按钮 失败 乱了
  46. // let parent = document.querySelector(".anthology-content-scroll .anthology-content")
  47. // // let child = document.querySelector(".anthology-content-scroll .anthology-content a:nth-child(" + index + 1 + ")")
  48.  
  49. // let as = document.querySelectorAll(".anthology-content-scroll .anthology-content a")
  50. // let arr = []
  51. // as.forEach((element, index) => {
  52. // arr.push(element)
  53. // })
  54.  
  55. // arr.forEach((element, index) => {
  56. // let el = document.createElement("a")
  57. // el.target = "_blank"
  58. // el.className = "box-item"
  59. // el.href = parsurl + element.getAttribute("href")
  60. // el.innerHTML = index + 1 + "&"
  61.  
  62. // parent.insertBefore(el, element)
  63. // })
  64. // 处理标题
  65. let title = document.querySelector(".thesis-wrap .title-link")
  66. title.style.width = "160px"
  67. // title.style.padding = "0 5px"
  68. // title.style.borderRadius = "3px"
  69. // title.style.backgroundColor = "#00b350"
  70. // title.style.boxShadow = "rgb(0, 179, 80) 0px 0px 20px"
  71. // title.href = parsurl + window.location.href
  72. // title.innerHTML += " 解析"
  73. // title.onmouseover = function(){
  74. // this.style.color = "white"
  75. // }
  76.  
  77. // 删除标题内元素
  78. // let parent = document.querySelector(".normal-title-wrap .thesis-wrap")
  79. // let child = parent.querySelectorAll(".ui-el")
  80. // child.forEach(element => {
  81. // parent.removeChild(element)
  82. // })
  83.  
  84. // 处理标题添加按钮
  85. let el = document.createElement("a")
  86. el.target = "_blank"
  87. el.className = "ui-a"
  88. el.href = parsurl + window.location.href
  89. el.innerHTML = "解析"
  90. el.style.padding = "3px 5px"
  91. el.style.borderRadius = "3px"
  92. el.style.backgroundColor = "#00b350"
  93. el.onmouseover = function(){
  94. this.style.color = "white"
  95. }
  96. insterAfter(el, title)
  97.  
  98. // 添加选择器
  99. let select = document.createElement("select")
  100. // select.className = "ui-el"
  101. select.style.marginRight = "3px"
  102. let optionA = document.createElement("option")
  103. optionA.value = '618g'
  104. optionA.innerHTML = '618g'
  105. let optionB = document.createElement("option")
  106. optionB.value = 'jqaaa'
  107. optionB.innerHTML = 'jqaaa'
  108. select.onchange = function(){
  109. function replaceURL(value){
  110. let titlea = document.querySelector(".thesis-wrap .ui-a")
  111. if (titlea) {
  112. titlea.href = titlea.href.replace(parsurl, value)
  113. }
  114. let as = document.querySelectorAll(".anthology-content-scroll .anthology-content a")
  115. as.forEach((element, index) => {
  116. let mark = element.querySelector(".mark-text a")
  117. if (mark) {
  118. mark.href = mark.href.replace(parsurl, value)
  119. }
  120. })
  121. parsurl = value
  122. }
  123. switch (this.value) {
  124. case '618g':
  125. replaceURL('https://jx.618g.com/?url=')
  126. break;
  127. case 'jqaaa':
  128. replaceURL('http://jqaaa.com/jx.php?url=')
  129. break;
  130. default:
  131. break;
  132. }
  133. proc()
  134. }
  135. select.appendChild(optionA)
  136. select.appendChild(optionB)
  137. insterAfter(select, title)
  138. // 处理标题 集数按钮
  139. let proc = function () {
  140. // 处理所有集数按钮
  141. let as = document.querySelectorAll(".anthology-content-scroll .anthology-content a")
  142. let arr = []
  143. as.forEach((element, index) => {
  144. arr.push(element)
  145. // console.log(element)
  146. })
  147. arr.forEach((element, index) => {
  148. let markBox = element.querySelector(".mark-text-wrap")
  149. let mark = element.querySelector(".mark-text")
  150. if (mark) {
  151. // console.log(mark.innerHTML)
  152. if (mark.innerHTML == "VIP" || mark.innerHTML == "超前点播") {
  153. if (markBox) {
  154. markBox.style.padding = "0"
  155. markBox.style.backgroundColor = "#00b350"
  156. // markBox.style.boxShadow = "rgb(0, 179, 80) 0px 0px 20px"
  157. }
  158. let el = document.createElement("a")
  159. el.target = "_blank"
  160. el.href = parsurl + element.getAttribute("href")
  161. el.innerHTML = "解析"
  162. el.style.padding = "3px"
  163. el.onmouseover = function(){
  164. this.style.color = "white"
  165. }
  166. mark.innerHTML = ""
  167. mark.appendChild(el)
  168. }
  169. }
  170. })
  171. }
  172. proc()
  173. let btn = document.querySelectorAll(".paged-wrap a")
  174. btn.forEach((element, index) => {
  175. element.onclick = function(e){
  176. // console.log(e)
  177. setTimeout(() => {
  178. proc()
  179. }, 300)
  180. }
  181. })
  182. })();

QingJ © 2025

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