// ==UserScript== // @name 破解王免费vip观看 // @name:zh-TW 破解王免费vip观看 // @namespace 18x_vip_video_free_see // @version 0.49 // @description 来不及解释了,快上车!!! // @description:zh-TW 來不及解釋了,快上車!!! // @author w2f // @include /^https://(www|h5).kmkk\d+\.com/videoContent/.*?$/ // @include /^https://www.hx\w+\.com.+$/ // @match https://*.com/play/video/* // @match https://*.com/smallVideo/* // @include /^1http(s)?:\/\/(www|h5)\.fi11\w+\.com\/play\/video/ // @include /^1http(s)?:\/\/(www|h5)\.\w+\.(com|cn)\/play\/video/ // @include /^1http(s)?:\/\/(www|h5)\.fi11\w+\.com\/smallVideo\/.*?/ // @match https://madou.bet/* // @match https://*.com/index // @match https://*.com/new // @match https://*.com/channel/videoList* // @match https://*.com/tags* // @match https://*.com/rankList // @match https://madou.tv/* // @match https://afkv28.com/* // @match https://afkv29.com/* // @match https://afkv30.com/* // @match https://*/videos/* // @match https://9sex.com/index/movie/play/id/*.html // @match https://*/index/movie/play/id/* // @ 91TV // @match https://kdt29.com/* // @match https://kqcd81.com/* // @match https://uzep49.com/* // @match https://vuxt30.com/* // @ 猫咪 // @match https://*/vip/index.html // @match https://*/vip/list-*.html // @match https://*/index/home.html // @include /https:\/\/www\.(\w+)\.com\/page\/vip/ // @include /^https:\/\/(.*)\.xyz\/(pc|h5)\/index\.html/ // @match https://alltv268.com/* // @include /^https://alltv\w+\.com.*$/ // @icon https://sy3wmh.xyz/pc/favicon.ico // @license MIT // @grant none // @require https://greasyfork.org/scripts/476730-ajaxhooker-2/code/ajaxHooker_2.js?version=1259979 // @run-at document-body // ==/UserScript== (function () { 'use strict'; /* none 如果不使用 unsafeWindow ,快猫手机端,含羞草pc端会播放失败,原因未知。 原因:通过 @require 加载的hls提示找不到,通过import_js导入ok */ let err_cnt = 0; function import_js(src) { let script = document.createElement('script'); script.src = src; document.head.appendChild(script); } import_js("https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"); import_js("https://cdnjs.cloudflare.com/ajax/libs/hls.js/1.1.5/hls.min.js"); let not_need_dplayer = location.href.match("https://theav.*?.com/videos/") != null || //avporn location.href.match("https://the.*?.fun/videos/") != null || // location.href.match("/play/video/") != null;//含羞草不再需要加载dplayer if (!not_need_dplayer) { import_js("https://cdnjs.cloudflare.com/ajax/libs/dplayer/1.26.0/DPlayer.min.js"); } ajaxHooker.protect(); ajaxHooker.filter([ {type: 'xhr', url: '/videos/getPreUrl', method: 'POST', async: true},//含羞草预览 ]); ajaxHooker.hook(request => { if (request.url.indexOf('/videos/getPreUrl') > -1 ) { request.response = async res => { console.log("hooked!!! responseText ====>",JSON.parse(res.responseText)); res.responseText = await modifyResponse(res.responseText); }; } }); async function modifyResponse(responseText){ let rspjson = await JSON.parse(responseText); rspjson.data.url = rspjson.data.url.replace(/start=\d+\&end=\d+\&/,""); console.log("fixed url====>",rspjson.data.url); localStorage.setItem("real_video_url", rspjson.data.url); return await JSON.stringify(rspjson); } let today = new Date().toLocaleDateString(); let min = new Date().getMinutes(); let chat = `更新维护不易,若脚本有帮助到你,请忽随意传播,感谢支持!`; function show_support_author() { var secondsLeft = 5; var mydiv = document.createElement('div'); mydiv.innerHTML = `

${chat}(${secondsLeft}s后自动关闭)

`; document.querySelector("head").after(mydiv); var interval = setInterval(function() { secondsLeft--; var xxx = document.querySelector("#my_add_div_support_author p");if(xxx) xxx.innerText = `${chat}(${secondsLeft}s后自动关闭)`; if (secondsLeft <= 0) { var yyy = document.querySelector("#my_add_div_support_author"); if(yyy) yyy.parentNode.removeChild(yyy); clearInterval(interval); } }, 1000); } /* 函数功能:显示视频地址,及提示信息. 参数说明:videoUrl:视频地址 dizhi: 地址显示位置 flag:是否强制刷新 */ function show_videoUrl(videoUrl,dizhi, flag = 0) { var xxx = document.querySelector("#my_add_dizhi"); if(flag==0 && xxx){ return 0; } if (xxx) xxx.parentNode.removeChild(xxx); var mydiv = document.createElement('div'); /* mydiv.innerHTML = `

视频解析完成,正在加载中,使用愉快!

`; dizhi?.after(mydiv); */ return 1; } /* 函数功能:加载Dplayer播放视频。 参数说明:videoUrl:视频地址 el:播放器加载位置 dizhi: 地址显示位置 flag:是否强制刷新 */ function play_video(videoUrl, el, dizhi, flag = 0) { if (!videoUrl || !el || !dizhi) throw new Error(`部分参数无效,视频地址:${videoUrl}、播放器位置:${el}、提示位置:${dizhi}`); let ret = show_videoUrl(videoUrl,dizhi,flag); if(ret == 0){ return 0; } if (window.dp) { window.dp.pause() window.dp.destroy() window.dp = null; } /* 2. 新增播放器 */ window.dp = new DPlayer({ element: el, autoplay: true, theme: '#FADFA3', loop: true, lang: 'zh', screenshot: true, hotkey: true, preload: 'auto', video: { url: videoUrl, type: 'hls' } }); /* 3. 设置播放器浮动显示,并添加一个具有上边距的兄弟div避免覆盖下面的内容 */ //el.classList.add("my_add_header"); //el.style += "z-index: 999;top: 0;"; el.style.position = 'sticky'; el.style.zIndex = '999'; el.style.top = '0'; var xxx = document.querySelector("#my_add_sibling"); if(!xxx){ var sibling = document.createElement('div'); sibling.id = "my_add_sibling"; //sibling.style.marginTop = el.offsetHeight + 'px'; // 设置兄弟元素的顶部边距 el.after(sibling); } } /* 函数功能:同上,可切换清晰度 */ function play_video2(videoUrl, videoUrl2, videoUrl3, videoUrl4, el, dizhi) { /* 1. 显示地址 */ var mydiv = document.createElement('div'); mydiv.innerHTML = `
注意:部分视频只360P,切换后无法播放说明不存在高清晰度版本!!!视频地址:

360P:${videoUrl}

480P:${videoUrl2}

720P:${videoUrl3}

1080P:${videoUrl4}

问题反馈 or 支持作者请【点击此处】,使用愉快!

`; dizhi && dizhi.after(mydiv); /* 2. 新增播放器 */ window.dp = new DPlayer({ element: el, autoplay: true, theme: '#FADFA3', loop: true, lang: 'zh', screenshot: true, hotkey: true, preload: 'auto', video: { quality: [ { name: '360P', url: videoUrl, type: 'hls', }, { name: '480P', url: videoUrl2, type: 'hls', }, { name: '720P', url: videoUrl3, type: 'hls', }, { name: '1080P', url: videoUrl4, type: 'hls', }, ], defaultQuality: 0, } }); } /* 函数功能:在界面上显示程序错误,便于分析 */ function show_err_log(err) { err && console.log(err); err_cnt++; if (err_cnt == 10) { //err_cnt = 0; var mydiv = document.createElement('div'); mydiv.innerHTML = `
解析出错,1.检查是否登录!2.请仔细阅读【脚本说明】查看是否支持你的平台组合, 如需帮助请复制以下内容到脚本评论区,等候作者处理! 请加上使用的平台组合,如:chrome + tampermonkey 。

错误信息:${err || "尝试多次仍然未获取到地址,可能是网站已更新..."}

操作系统:${navigator.platform}

浏览器:${navigator.userAgent}

当前地址:${location.href}

`; document.querySelector("head").after(mydiv); clearInterval(my_timer); } } function do_login(){ let phone = JSON.parse(localStorage.getItem('move-client-user-info'))?.user?.user_info?.phone; let event = document.createEvent('HTMLEvents'); event.initEvent("input", true, true); if(phone){ /* 自动登录 */ let account = document.querySelectorAll('input.van-field__control')[0]; account.value = phone; account.dispatchEvent(event); let password = document.querySelectorAll('input.van-field__control')[1]; password.value = "123456"; password.dispatchEvent(event); document.querySelector('button[type=submit]').click(); }else{ /* 自动注册 */ document.querySelector('div.login_1_2_1')?.click(); let account = document.querySelectorAll('input.van-field__control')[0]; account.value = ["130", "131", "132", "133", "135", "137", "138", "170", "187", "189"][ Math.floor(10 * Math.random())] + Math.floor(Math.random() * 100000000); account.dispatchEvent(event); let password = document.querySelectorAll('input.van-field__control')[1]; password.value = "123456"; password.dispatchEvent(event); let password2 = document.querySelectorAll('input.van-field__control')[2]; password2.value = "123456"; password2.dispatchEvent(event); document.querySelector('button[type=submit]').click(); } } let flag = 0; let last_videoUrl = null; function get_videourl() { let videoUrl = null, videoUrl2 = null, videoUrl3 = null, videoUrl4 = null; let el = null; let dizhi = null; let player = null; let shikan = null; let ads = null; try { if (!not_need_dplayer && typeof(DPlayer)!= 'function' ) { /* DPlayer还未加载完毕时就解析完视频地址,会导致播放时报错ReferenceError: DPlayer is not defined */ console.log("正在加载DPlayer..."); return; } /* 猫咪vip */ else if (location.href.match(/https:\/\/www\.(\w+)\.com\/page\/vip/) != null) { var nodelist = document.querySelectorAll("div.content-item"); nodelist?.forEach( (item,idx,arr) => { var xxx = document.querySelector(`#my_add_dizhi${idx}`); if (xxx) { xxx.parentNode.removeChild(xxx); } var videourl = item.querySelector("a.video-pic")?.href?.replace("/vip/play-","/shipin/detail-"); if (videourl) { var mydiv = document.createElement('div'); mydiv.innerHTML = `

✔点此访问

`; item.after(mydiv); } } ); //console.log("[猫咪]视频页面,未获取到地址,继续尝试..."); //切换下一页网址不变,无法刷新,故不能停止定时器 } // 快猫app pc (vip精选err,其他ok) else if (location.href.match("https://.*?.xyz/pc/index.html*") != null) { var nodelist = document.querySelectorAll("#app div.box div.video_img"); nodelist?.forEach( (item,idx,arr) => { var xxx = document.querySelector(`#my_add_dizhi${idx}`); if (xxx) { xxx.parentNode.removeChild(xxx); } var videourl = item.querySelector("div > img")?.src?.split('cover')[2]?.split('.')[0]; if (videourl) { var mydiv = document.createElement('div'); mydiv.innerHTML = `

✔点此访问

`; item.after(mydiv); } } ); //切换下一页网址不变,无法刷新,故不能停止定时器 } // 快猫app h5 (全部ok) else if (location.href.match("https://.*?.xyz/h5/index.html*") != null) { nodelist = document.querySelectorAll("div.imgbox div div.vue-waterfall-column>div"); nodelist?.forEach( (item,idx,arr) => { var xxx = document.querySelector(`#my_add_dizhi${idx}`); if (xxx) { xxx.parentNode.removeChild(xxx); } var videourl = item.querySelector("img")?.src?.split('cover')[2]?.split('.')[0]; if (videourl) { var mydiv = document.createElement('div'); mydiv.innerHTML = `

✔点此访问

`; item.after(mydiv); } } ); //切换下一页网址不变,无法刷新,故不能停止定时器 } // all av //todo else if (location.href.match("https://alltv.*?.com/") != null) { document.querySelectorAll("div.video-list-unit-media")?.forEach( (item,idx,arr) => { var xxx = document.querySelector(`#my_add_dizhi${idx}`); if (xxx) { xxx.parentNode.removeChild(xxx); } var videourl = item.querySelector("div > img")?.src?.split('cover')[2]?.split('.')[0]; if (videourl) { var mydiv = document.createElement('div'); mydiv.innerHTML = `

✔点此访问

`; item.after(mydiv); } } ); //切换下一页网址不变,无法刷新,故不能停止定时器 } /* 9sex */ else if (location.href.match("https://.*?/index/movie/play/id/") != null) { player = document.querySelector("#dplayer"); dizhi = document.body.innerHTML.match("movies/(.*?)_preview.jpg.txt")[1].split('/');/* $("script").text() */ /* 1.点击试看(不需要) */ if (player && dizhi && flag == 0) { /* 2.解析真实地址 */ videoUrl = `https://ms3.bca834d60257.com/${dizhi[0]}/${dizhi[1]}/360P/${dizhi[2]}_360P.m3u8`; console.log("真实地址:", videoUrl); videoUrl2 = `https://ms3.bca834d60257.com/${dizhi[0]}/${dizhi[1]}/480P/${dizhi[2]}_480P.m3u8`; console.log("真实地址2:", videoUrl2); videoUrl3 = `https://ms3.bca834d60257.com/${dizhi[0]}/${dizhi[1]}/720P/${dizhi[2]}_720P.m3u8`; console.log("真实地址3:", videoUrl3); videoUrl4 = `https://ms3.bca834d60257.com/${dizhi[0]}/${dizhi[1]}/1080P/${dizhi[2]}_1080P.m3u8`; console.log("真实地址4:", videoUrl4); /* 3.vip视频需要移除登录框 */ ads = document.querySelector("#login-tip-modal"); if (ads) ads.parentNode.removeChild(ads); ads = document.querySelector(".vip-tip-modal"); if (ads) ads.parentNode.removeChild(ads); /* 4.播放正片 */ play_video2(videoUrl, videoUrl2, videoUrl3, videoUrl4, player, document.querySelector("div.notice")); flag = 1; } else if (flag == 1) { /* 3.1 免费视频需要加载播放后移除广告 */ ads = document.querySelector(".pause-ad-imgbox"); if (ads) ads.parentNode.removeChild(ads); /* 5.停止定时器 */ clearInterval(my_timer); } else { console.log("[9sex]视频页面,未获取到地址,继续尝试..."); } } /* 皇家会所 */ else if (location.href.match("https://www.hjhs.*?/videos/") != null) { player = document.querySelector("#dplayer"); /* 1.点击试看(不需要) */ if (player && window.api?.quality?.url) { /* 2.解析真实地址 */ videoUrl = window.api.quality.url.replace("suo.", "").replace("_suo", ""); console.log("真实地址:", videoUrl); /* 3.移除广告 */ /* 4.播放正片 */ play_video(videoUrl, player, document.querySelector("div.headline")); /* 5.停止定时器 */ clearInterval(my_timer); } else { console.log("[皇家会所]视频页面,未获取到地址,继续尝试..."); } } // The AV Pron,兼容手机 + PC else if (location.href.match("https://theav.*?.com/videos/") != null || location.href.match("https://the.*?.fun/videos/") != null ) { // 2.解析真实地址 //已知缺陷: 可能网站存在限制,控制台中player.api("hls")有值,但脚本获取为null 。只有使用 unsafeWindow.player.api("hls")能获取到 , //但由于userscript不支持unsafeWindow,故safari浏览器+userscript无效。改为从