百度网盘Svip会员破解青春版

修改所有可改的身份信息,修改成超级会员身份,可以使用网站自带的倍速、字幕等功能。

  1. // ==UserScript==
  2. // @name 百度网盘Svip会员破解青春版
  3. // @namespace http://tampermonkey.net/
  4. // @match https://pan.baidu.com/
  5. // @match https://pan.baidu.com/*
  6. // @grant unsafeWindow
  7. // @grant GM_setValue
  8. // @grant GM_getValue
  9. // @grant GM_addStyle
  10. // @grant GM_openInTab
  11. // @run-at document-start
  12. // @noframes
  13. // @require https://lib.baomitu.com/jquery/3.5.1/jquery.min.js
  14. // @require https://lib.baomitu.com/hls.js/latest/hls.js
  15. // @version 1.4.0
  16. // @license GPL
  17. // @author Gwen
  18. // @downloadUrl https://greasyfork.org/scripts/469774-%E7%99%BE%E5%BA%A6%E7%BD%91%E7%9B%98svip%E4%BC%9A%E5%91%98%E7%A0%B4%E8%A7%A3%E9%9D%92%E6%98%A5%E7%89%88/code/%E7%99%BE%E5%BA%A6%E7%BD%91%E7%9B%98Svip%E4%BC%9A%E5%91%98%E7%A0%B4%E8%A7%A3%E9%9D%92%E6%98%A5%E7%89%88.user.js
  19. // @homepageUrl https://greasyfork.org/zh-CN/scripts/469774-%E7%99%BE%E5%BA%A6%E7%BD%91%E7%9B%98svip%E4%BC%9A%E5%91%98%E7%A0%B4%E8%A7%A3%E9%9D%92%E6%98%A5%E7%89%88
  20. // @description 修改所有可改的身份信息,修改成超级会员身份,可以使用网站自带的倍速、字幕等功能。
  21. // ==/UserScript==
  22.  
  23. (function() {
  24. 'use strict';
  25.  
  26. //浏览历史模块,不需要的话删掉以下↓
  27. GM_addStyle(".bdh-button{z-index:10000;font-size:14px;width:60px;height:30px;line-height:30px;text-align:center;color:black;position:absolute;left:calc(20vw);top:10px;cursor:pointer}.bdh-panel{z-index:10000;background:white;position:fixed;left:20px;top:20px;width:390px;border:1px solid #000}.bdh-header{position:relative;height:30px;background:rgb(250, 250, 250);cursor:move}.bdh-close{position:absolute;right:10px;top:0;font-size:19px;cursor:pointer}.bdh-body{min-height:200px;max-height:500px;overflow-y:auto;overflow-x:hidden}.bdh-group{padding:10px;border-bottom:1px solid #d3d3d3}.bdh-group-header{color:gray;font-size:14px;margin-bottom:5px}.bdh-group-item{position:relative;width:100%;height:80px;padding:5px;box-sizing:border-box;border-bottom:1px solid #d3d3d3;cursor:pointer;display:flex}.bdh-group-item.picture{display:inline-block;border-bottom:none;width:80px}.bdh-group-item:nth-last-child(1){border-bottom:none}.bdh-group-item-image{width:70px;height:70px;object-fit:cover;display:inline-block;margin-right:5px}.bdh-group-item-image.video{width:90px}.bdh-group-item-video{position:absolute;left:5px;top:5px;width:90px;height:70px;background-color:rgba(0,0,0,.4)}.bdh-group-item-video-play{position:absolute;top:18px;left:35px;border-width:17px;border-style:solid;border-color:transparent transparent transparent #fff}.bdh-group-item-info{display:inline-block;max-width:280px;min-width:280px;height:70px;position:relative}.bdh-group-item-info.video{display:inline-block;max-width:260px;height:70px;position:relative}.bdh-group-item-info.picture{display:none}.bdh-group-item-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.bdh-group-item-record{position:absolute;left:0;bottom:0;font-size:14px;color:gray}");const bd_history_store={};function createElement(type,className){let d=document.createElement(type);d.className=className;return d}function initPanel(){let panel=createElement("div","bdh-panel");let header=createElement("div","bdh-header");let close=createElement("div","bdh-close");close.innerText="×";let body=createElement("div","bdh-body");header.appendChild(close);panel.appendChild(header);panel.appendChild(body);document.body.appendChild(panel);let lastX=GM_getValue("box_last_x",100);let lastY=GM_getValue("box_last_y",100);panel.style.left=lastX+"px";panel.style.top=lastY+"px";panel.style.display="none";header.addEventListener("mousedown",makeDraggableFunction(panel,false,null,()=>{GM_setValue("box_last_x",parseInt(panel.style.left));GM_setValue("box_last_y",parseInt(panel.style.top))}),false);let showButton=createElement("span","bdh-button");showButton.innerText="浏览历史";document.body.appendChild(showButton);showButton.addEventListener("click",e=>{showButton.style.display="none";panel.style.display="block";body.innerHTML="";getHistory()});close.addEventListener("click",e=>{panel.style.display="none";showButton.style.display="block"})}function makeDraggableFunction(elem,allowMoveOut,exec,callback){let handleMouseDown=function(event){let offsetX=parseInt(elem.style.left);let offsetY=parseInt(elem.style.top);let innerX=event.clientX-offsetX;let innerY=event.clientY-offsetY;if(!!exec){exec()}document.onmousemove=function(event){elem.style.left=event.clientX-innerX+"px";elem.style.top=event.clientY-innerY+"px";if(!allowMoveOut){if(parseInt(elem.style.left)<=0){elem.style.left="0px"}if(parseInt(elem.style.top)<=0){elem.style.top="0px"}if(parseInt(elem.style.left)>=window.innerWidth-parseInt(elem.style.width)){elem.style.left=window.innerWidth-parseInt(elem.style.width)+"px"}if(parseInt(elem.style.top)>=window.innerHeight-parseInt(elem.style.height)){elem.style.top=window.innerHeight-parseInt(elem.style.height)+"px"}}};document.onmouseup=function(){document.onmousemove=null;document.onmouseup=null;if(!!callback){callback()}}};return handleMouseDown}function getHistory(){let url="https://pan.baidu.com/recent/list?";let params={app_id:"250528",vip:"2",version:"11.14.0",queryfree:"0",channel:"iPhone_14.4.2_iPhone11ProMax_chunlei_1099a_wifi",apn_id:"1_0",network_type:"wifi",freeisp:"0",activestatus:"0",time:(new Date).getTime(),clienttype:"1",bgstatus:"1",need_detail:"1"};Object.keys(params).forEach(k=>{console.log(k);url+=k+"="+params[k]+"&"});fetch(url,{method:"GET",credentials:"include",headers:{"Content-Type":"application/json;charset=UTF-8"}}).then(res=>{return res.json()}).then(res=>{console.log("res: ",res);resolveHistory(res.list)})}async function download(fsid){let url=await fetch("https://pan.baidu.com/api/gettemplatevariable?clienttype=0&app_id=250528&web=1&fields=[%22sign1%22,%22sign2%22,%22sign3%22,%22timestamp%22]").then(res=>{return res.json()}).then(a=>{console.log(a);a=a.result;let s=a.sign1,r=a.sign2,c=a.sign3,l=a.timestamp;let u=new Function("return "+a.sign2)();let sign=btoa(u(c,s));let url=`https://pan.baidu.com/api/download?clienttype=0&app_id=250528&web=1
  28. &fidlist=[${fsid}]&type=dlink&vip=2&sign=${encodeURIComponent(sign)}&timestamp=${l}`;return fetch(url).then(res=>res.json()).then(res=>{console.log("下载链接:"+res.dlink[0].dlink);GM_openInTab(res.dlink[0].dlink)})})}function resolveHistory(list){let bdhBody=$(".bdh-body");for(let group of list){console.log(group);let groupElem=$('<div class="bdh-group"></div>');groupElem.append(`<div class="bdh-group-header">
  29. ${formatTime(group.smtime)}&nbsp;&nbsp;${group.clienttype}查看
  30. </div>`);let count=0;for(let item of group.detail){let tag=item.category==1?" video":item.category==3?" picture":"";let itemElem=$(`<div class="bdh-group-item${tag}">
  31. <img class="bdh-group-item-image${tag}" src="${item.thumbs?item.thumbs.url3:""}" alt="无图片">
  32. ${item.category==1?'<div class="bdh-group-item-video"><div class="bdh-group-item-video-play"></div></div>':""}
  33. <div class="bdh-group-item-info${tag}">
  34. <div class="bdh-group-item-title" title="${item.server_filename}">${item.server_filename}</div>
  35. ${item.category==1&&group.view_time?'<div class="bdh-group-item-record">播放至 '+formatViewTime(group.view_time[count])+"/"+formatViewTime(item.duration)+"</div>":""}
  36. </div>
  37. </div>`);itemElem.attr("count",count);groupElem.append(itemElem);itemElem.click(function(e){let url="";let category=item.category;if(category==1){url="https://pan.baidu.com/pfile/video?path="+encodeURIComponent(item.path);GM_openInTab(url)}else if(category==2){console.log(this.getAttribute("count"));download(group.fsids[this.getAttribute("count")])}else if(category==3){download(group.fsids[this.getAttribute("count")])}else if(category==4){url="https://pan.baidu.com/pfile/docview?path="+encodeURIComponent(item.path);GM_openInTab(url)}else if(category==5){}});count++}bdhBody.append(groupElem)}}function formatTime(timestamp){let now=new Date;let nowTime=now.getTime();nowTime/=1e3;if(nowTime-timestamp<60){return"刚刚"}else if(nowTime-timestamp<60*60){return Math.floor((nowTime-timestamp)/60)+"分钟前"}else if(nowTime-timestamp<24*60*60){return Math.floor((nowTime-timestamp)/60/24)+"小时前"}else{let result="";let date=new Date(timestamp*1e3);if(date.getFullYear()!=now.getFullYear()){result+=date.getFullYear()+"-"}let M=date.getMonth()+1;let d=date.getDate();let h=date.getHours()<10?"0"+date.getHours():date.getHours();let m=date.getMinutes()<10?"0"+date.getMinutes():date.getMinutes();let s=date.getSeconds()<10?"0"+date.getSeconds():date.getSeconds();result+=M+"-"+d+" "+h+":"+m+":"+s;return result}}function formatViewTime(time){let h=Math.floor(time/60/24);h=h<10?"0"+h:h;let m=Math.floor(time/60%24);m=m<10?"0"+m:m;let s=Math.floor(time%60);s=s<10?"0"+s:s;return h+":"+m+":"+s}
  38. //浏览历史模块,不需要的话删掉以上↑
  39.  
  40. var store = {
  41. path: null,
  42. adToken: null,
  43. bdstoken: null,
  44. resolutionPattern: /M3U8_AUTO_([0-9]+?)&/,
  45. timePoints: null,
  46. captureHls: null,
  47. shareFilePage: /\/s\/.*?\?fid=.*?/.test(location.href),
  48. originalOpen: null,
  49. newOpen: null,
  50. }
  51. store.path = new URLSearchParams(new URL(location.href).search).get('path');
  52.  
  53. function createElement(tag, clazz, attrs) {
  54. const elem = document.createElement(tag);
  55. elem.className = clazz;
  56. if (attrs) {
  57. for (let key in attrs) {
  58. elem[key] = attrs[key];
  59. }
  60. }
  61. return elem;
  62. }
  63.  
  64. function hookRequest() {
  65. var originalOpen = XMLHttpRequest.prototype.open;
  66. store.originalOpen = originalOpen
  67. XMLHttpRequest.prototype.open = function (method, url) {
  68. if (url.indexOf('/api/loginStatus') != -1) {
  69. this.addEventListener('readystatechange', function() {
  70. if (this.readyState == 4) {
  71. let res = JSON.parse(this.responseText)
  72. res.login_info.vip_type = '21'
  73. res.login_info.vip_identity = '21'
  74. res.login_info.vip_level = 8
  75. res.login_info.vip_point = 99999
  76. res.login_info.username = 'GwenCrackヾ(-_-;)'
  77. store.bdstoken = res.login_info.bdstoken
  78. Object.defineProperty(this, "responseText", {
  79. writable: true,
  80. });
  81. this.responseText = JSON.stringify(res)
  82. }
  83. })
  84. originalOpen.apply(this, arguments);
  85. } else if (url.indexOf('/user/info') != -1) {
  86. this.addEventListener('readystatechange', function() {
  87. if (this.readyState == 4) {
  88. let res = JSON.parse(this.responseText)
  89. res.user_info.is_vip = 1
  90. res.user_info.is_svip = 1
  91. res.user_info.is_plus_buy = 1
  92. Object.defineProperty(this, "responseText", {
  93. writable: true,
  94. });
  95. this.responseText = JSON.stringify(res)
  96. }
  97. })
  98. originalOpen.apply(this, arguments);
  99. } else if (url.indexOf('/membership/user') != -1) {
  100. this.addEventListener('readystatechange', function() {
  101. if (this.readyState == 4) {
  102. let res = JSON.parse(this.responseText)
  103. res.reminder = {
  104. "svip": {
  105. "leftseconds": 9999999999,
  106. "nextState": "normal"
  107. }
  108. }
  109. res.level_info = {
  110. "current_value": 12090,
  111. "current_level": 10,
  112. "history_value": 11830,
  113. "history_level": 10,
  114. "v10_id": "666666",
  115. "last_manual_collection_time": 0
  116. }
  117. res.product_infos = [{
  118. "product_id": "",
  119. "start_time": 1685635199,
  120. "end_time": 1888227199,
  121. "buy_time": 0,
  122. "cluster": "vip",
  123. "detail_cluster": "svip",
  124. "auto_upgrade_to_svip": 0,
  125. "product_name": "svip2_nd",
  126. "status": 0,
  127. "function_num": 0,
  128. "buy_description": "",
  129. "product_description": "",
  130. "cur_svip_type": "month"
  131. }]
  132. res.current_product = {
  133. "cluster": "vip",
  134. "detail_cluster": "svip",
  135. "product_type": "vip2_1m_auto",
  136. "product_id": "12187135090581539740"
  137. }
  138. res.current_product_v2 = {
  139. "cluster": "vip",
  140. "detail_cluster": "svip",
  141. "product_type": "vip2_1m_auto",
  142. "product_id": "12187135090581539740"
  143. }
  144. Object.defineProperty(this, "responseText", {
  145. writable: true,
  146. });
  147. this.responseText = JSON.stringify(res)
  148. }
  149. })
  150. originalOpen.apply(this, arguments);
  151. } else if (url.indexOf('/api/streaming') != -1 && url.indexOf('M3U8_SUBTITLE_SRT') == -1) { //获取视频m3u8接口
  152. let modifiedUrl = url.replace(/vip=2/, 'vip=0')
  153. .replace(/_1080&/, '_720&')
  154. if (store.adToken) {
  155. modifiedUrl += ('&adToken=' + encodeURIComponent(store.adToken))
  156. this.adToken = store.adToken
  157. store.adToken = null
  158. store.m3u8url = modifiedUrl;
  159. originalOpen.call(this, method, modifiedUrl, false);
  160. return
  161. }
  162. originalOpen.call(this, method, modifiedUrl);
  163. this.addEventListener('readystatechange', function() {
  164. if (this.readyState == 4) {
  165. if (this.responseText[0] == '{') {
  166. let res = JSON.parse(this.responseText)
  167. store.adToken = res.adToken
  168. let manualRequest = new XMLHttpRequest();
  169. // let manualUrl = `https://pan.baidu.com/api/streaming?app_id=250528&clienttype=0&channel=chunlei&web=1&isplayer=1&check_blue=1&type=M3U8_AUTO_${store.resolutionPattern.exec(url)[1]}&trans=&vip=0` +
  170. // `&bdstoken=${store.bdstoken||unsafeWindow.locals.bdstoken}&path=${store.path}&jsToken=${unsafeWindow.jsToken}`
  171. let manualUrl = modifiedUrl
  172. console.log(manualUrl)
  173. manualRequest.open(method, manualUrl, false);
  174. manualRequest.send();
  175. Object.defineProperty(this, "status", {
  176. writable: true,
  177. });
  178. this.status = manualRequest.status;
  179. Object.defineProperty(this, "responseText", {
  180. writable: true,
  181. });
  182. this.responseText = manualRequest.responseText;
  183. }
  184. }
  185. })
  186. } else if (url.indexOf('/api/streaming') != -1 && url.indexOf('SUBTITLE_SRT') != -1 && false) {
  187. // this.addEventListener('readystatechange', function() {
  188. // if (this.readyState == 4) {
  189. // let res = this.responseText
  190. // Object.defineProperty(this, "responseText", {
  191. // writable: true,
  192. // });
  193. // this.responseText = res.replace(/https:\/\/.*?\//, 'https://nv0.baidupcs.com/')
  194. // }
  195. // })
  196. originalOpen.apply(this, arguments);
  197. } else if (url.indexOf('/msg/streaming') != -1 || url.indexOf('/share/streaming') != -1) {
  198. this.addEventListener('readystatechange', function() {
  199. if (this.readyState == 4) {
  200. if (this.responseText[0] != '{')
  201. return
  202. let res = JSON.parse(this.responseText)
  203. res.ltime = 0.000001
  204. res.adTime = 0.000001
  205. Object.defineProperty(this, 'responseText', {
  206. writable: true,
  207. })
  208. this.responseText = JSON.stringify(res)
  209. }
  210. })
  211. originalOpen.apply(this, arguments);
  212. } else if (url.indexOf('/aitrans/ppt/get') != -1) {
  213. const parseTimeToSeconds = (timeStr) => {
  214. let [h, m, s] = timeStr.split(":");
  215. return parseInt(h)*60*60 + parseInt(m)*60 + parseInt(s);
  216. }
  217. this.addEventListener('readystatechange', function() {
  218. if (this.readyState == 4) {
  219. console.log("课件:" + this.responseText);
  220. let res = JSON.parse(this.responseText);
  221. console.log(res);
  222. let list = res.data.list;
  223. if (!list || list.length == 0) {
  224. console.error("没有pdf,等待生成或者别生成了");
  225. return;
  226. }
  227. const timePoints = [];
  228. for (let item of list) {
  229. for (let time of item.img_timestamp) {
  230. console.log(time);
  231. timePoints.push(parseTimeToSeconds(time))
  232. }
  233. }
  234. console.log(timePoints)
  235. store.timePoints = timePoints;
  236. showPdf();
  237. }
  238. })
  239. originalOpen.apply(this, arguments);
  240. } else {
  241. originalOpen.apply(this, arguments);
  242. }
  243. }
  244. store.newOpen = XMLHttpRequest.prototype.open;
  245. }
  246.  
  247. function showPdf() {
  248. document.querySelector('.vp-tabs__header').children[2].click()
  249. const doShow = () => {
  250. if (!store.timePoints || store.timePoints.length == 0) {
  251. console.log("正在加载课件时间点...");
  252. setTimeout(doShow, 500);
  253. } else {
  254. const video = document.createElement('video');
  255. const canvas = document.createElement('canvas');
  256. const context = canvas.getContext('2d');
  257. let aiCourse = document.querySelector(".vp-ai-course")
  258. let aiCourseTools = null;
  259. let logText = null;
  260. let reloadBtn = null;
  261. let exportBtn = null;
  262. let imageContainer = document.getElementById("export-image-container")
  263. // if (aiCourse && !aiCourse.querySelector('.vp-ai-course-tools')) {
  264. if (aiCourse) {
  265. aiCourse.innerHTML = ''
  266. aiCourseTools = createElement('div', 'vp-ai-course-tools', {style:'margin-bottom:5px;'})
  267. logText = createElement('span', '', {style:'margin-right:10px;font-size:16px;'})
  268. reloadBtn = createElement('button', '', {innerText: '重新加载', disabled: true, style: 'margin-right:10px;padding: 3px 10px;font-size: 14px;background:#fff;border:1px solid #ccc;cursor:pointer;'});
  269. exportBtn = createElement('button', '', {innerText: '导出', disabled: true, style: 'padding: 3px 10px;font-size: 14px;background:#fff;border:1px solid #ccc;cursor:pointer;'});
  270. reloadBtn.onclick = () => {
  271. if (!reloadBtn.disabled) {
  272. showPdf();
  273. }
  274. }
  275. let exportLock = false;
  276. exportBtn.onclick = () => {
  277. if (!exportBtn.disabled && !exportLock) {
  278. exportLock = true;
  279. logText.innerText = "正在写入pdf"
  280. if (store.captureHls)
  281. store.captureHls.destroy();
  282. store.captureHls = null;
  283. // 导出pdf
  284. const imgs = imageContainer.querySelectorAll('img')
  285. let w = imgs[0].naturalWidth, h = imgs[0].naturalHeight
  286. let pdf = new jspdf.jsPDF('l', 'px', [w, h]);
  287. for (let i = 0; i < imgs.length; i++) {
  288. let img = imgs[i]
  289. pdf.addImage(img.src, 'JPEG', 0, 0, w, h)
  290. pdf.addPage([img.naturalWidth, img.naturalHeight], 'l')
  291. }
  292. const targetPage = pdf.internal.getNumberOfPages()
  293. pdf.deletePage(targetPage)
  294. pdf.save(document.querySelector('.vp-personal-home-layout__video > .vp-toolsbar > .vp-toolsbar__title').title + '.pdf')
  295. logText.innerHTML = '<span style="color:green">导出成功</span>'
  296. // store.timePoints = []
  297. exportLock = false;
  298. }
  299. }
  300. aiCourseTools.appendChild(logText)
  301. aiCourseTools.appendChild(reloadBtn)
  302. aiCourseTools.appendChild(exportBtn)
  303. aiCourse.append(aiCourseTools);
  304. }
  305. if (!imageContainer) {
  306. imageContainer = document.createElement('div')
  307. imageContainer.id = "export-image-container"
  308. imageContainer.style.overflowY = 'auto'
  309. } else {
  310. imageContainer.innerHTML = ''
  311. }
  312. aiCourse.appendChild(imageContainer)
  313.  
  314. //const hls = new Hls();
  315. if (store.captureHls) {
  316. store.captureHls.destroy();
  317. store.captureHls = null;
  318. }
  319. store.captureHls = new Hls();
  320. const hls = store.captureHls;
  321. video.volume = 0
  322.  
  323. hls.on(Hls.Events.MEDIA_ATTACHED, function() {
  324. hls.loadSource(store.m3u8url);
  325. });
  326.  
  327. hls.on(Hls.Events.MANIFEST_PARSED, function() {
  328. video.play();
  329. });
  330.  
  331. hls.on(Hls.Events.ERROR, function (event, data) {
  332. // console.log("HLS ERROR");
  333. // console.log(event, data)
  334. if (data.fatal && data.type == Hls.ErrorTypes.MEDIA_ERROR) {
  335. hls.recoverMediaError();
  336. logText.innerHTML = '<span style="color:red">导出出现异常,尝试恢复</span>'
  337. } else if (data.fatal) {
  338. logText.innerHTML = '<span style="color:red">导出失败,请重试</span>'
  339. reloadBtn.disabled = false;
  340. }
  341. })
  342.  
  343. video.oncanplay = function() {
  344. video.oncanplay = null;
  345. canvas.width = video.videoWidth;
  346. canvas.height = video.videoHeight;
  347. function captureScreenshot(timePoints, index) {
  348. if (index >= timePoints.length) {
  349. // 销毁视频对象
  350. store.captureHls.destroy();
  351. store.captureHls = null;
  352. logText.innerHTML = '加载完成';
  353. reloadBtn.disabled = false;
  354. exportBtn.disabled = false;
  355. return;
  356. }
  357. logText.innerHTML = `加载中(${index+1}/${timePoints.length})`
  358. const time = timePoints[index]
  359. video.pause();
  360. video.currentTime = time;
  361. video.onseeked = function() {
  362. video.onseeked = null;
  363. context.drawImage(video, 0, 0, canvas.width, canvas.height);
  364. const imgDataUrl = canvas.toDataURL('image/jpeg', 1);
  365. const imgWrapper = createElement('div', '', {style:'position:relative;width:100%;height:fit-content;'})
  366. const img = createElement('img', '', {src: imgDataUrl, style: 'width:100%;'});
  367. imgWrapper.append(img)
  368. imageContainer.appendChild(imgWrapper);
  369. imgWrapper.addEventListener('mouseenter', () => {
  370. const imgOverlay = createElement('div', 'img-index-text', {textContent:`${index+1}/${timePoints.length}`, style: "font-size:13px;position:absolute;top:0;left:0;background:black;color:white;padding:5px;border-radius:5px;"});
  371. imgWrapper.appendChild(imgOverlay);
  372. });
  373. imgWrapper.addEventListener('mouseleave', () => {
  374. const imgOverlay = imgWrapper.querySelector('.img-index-text');
  375. imgWrapper.removeChild(imgOverlay);
  376. });
  377. captureScreenshot(timePoints, index+1)
  378. };
  379. }
  380. captureScreenshot(store.timePoints, 0)
  381. };
  382. hls.attachMedia(video);
  383. }
  384. }
  385. if (!unsafeWindow.jspdf) {
  386. let script = document.createElement('script')
  387. script.src = 'https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.1.1/jspdf.umd.min.js'
  388. document.head.appendChild(script)
  389. script.onload = doShow
  390. console.log("正在引入pdf所需js依赖")
  391. } else {
  392. doShow()
  393. }
  394. }
  395.  
  396. hookRequest()
  397. let localsTimer = setInterval(() => {
  398. if (!unsafeWindow.locals) return
  399. clearInterval(localsTimer)
  400. console.log('设置window.locas', unsafeWindow.locals)
  401. let originalSet = unsafeWindow.locals.set
  402. unsafeWindow.locals.set = function(n, t) {
  403. console.log('%c[hook]' + n + ': ' + t, 'color:blue;')
  404. if (['is_vip', 'is_svip'].indexOf(n) != -1) {
  405. t = 1
  406. } else if (n == 'vip_level') {
  407. t = 10
  408. } else if (n == 'v10_id') {
  409. t = '请低调使用,安装后24小时内自行删除'
  410. } else if (n == 'self' && store.shareFilePage) {
  411. t = 1
  412. }
  413. console.log(arguments)
  414. originalSet.apply(this, [n, t])
  415. }
  416. if (unsafeWindow.locals.userInfo) {
  417. unsafeWindow.locals.userInfo.vip_level = 10
  418. unsafeWindow.locals.userInfo.vip_identity = 21
  419. unsafeWindow.locals.userInfo.svip10_id = '请低调使用,安装后24小时内自行删除'
  420. store.shareFilePage && (unsafeWindow.locals.self = 1)
  421. } else if(unsafeWindow.locals.mset) {
  422. unsafeWindow.locals.mset({
  423. 'is_vip': 1,
  424. 'is_svip': 1,
  425. 'vip_level': 10,
  426. 'svip10_id': '请低调使用,安装后24小时内自行删除',
  427. 'show_vip_ad': 0,
  428. })
  429. } else {
  430. unsafeWindow.locals.vip_level = 10
  431. unsafeWindow.locals.svip10_id = '请低调使用,安装后24小时内自行删除'
  432. unsafeWindow.locals.is_vip = 1
  433. unsafeWindow.locals.is_svip = 1
  434. unsafeWindow.locals.is_evip = 0
  435. unsafeWindow.locals.show_vip_ad = 0
  436. store.shareFilePage && (unsafeWindow.locals.self = 1)
  437. }
  438. try {
  439. initPanel()
  440. } catch(e) {}
  441. }, 10)
  442.  
  443. function fixRateChange() {
  444. const buttons = document.querySelectorAll('.vp-video__control-bar--playback-rates button');
  445. if (!buttons || buttons.length == 0) {
  446. return setTimeout(fixRateChange, 300);
  447. }
  448. const read = GM_getValue('read_1.4.0', false);
  449. if (!read) {
  450. alert('脚本仅供交流学习使用,请在24小时内自觉删除此脚本,通过正规渠道购买会员。该版本解决倍速问题,后续脚本不再更新,感谢这一年大家的支持和建议❗')
  451. GM_setValue('read_1.4.0', true);
  452. }
  453. for (const btn of buttons) {
  454. btn.addEventListener('click', () => {
  455. XMLHttpRequest.prototype.open = store.originalOpen;
  456. setTimeout(() => {
  457. XMLHttpRequest.prototype.open = store.newOpen;
  458. }, 100);
  459. })
  460. }
  461. }
  462. fixRateChange();
  463.  
  464.  
  465. })()