// ==UserScript== // @name 腾讯,爱奇艺,优酷。B站VIP解析+B站下载(乔帅分享) // @namespace http://tampermonkey.net/ // @version 1.9.8 // @description 大家可以实现追剧自由了。如果该脚本对你有用的话,这将是我的莫大荣幸。本人在此承诺,该脚本不会采取任何收费情况。大家可以提一些我力所能及的优化措施。本人将于学业之余,开发更多有趣功能。 // @author 乔帅 // @match *://*/* // @grant GM_openInTab // @grant GM_download // @grant GM_xmlhttpRequest // @require https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js // @license MIT // ==/UserScript== (function() { 'use strict'; // 解析接口列表:显示名+真实地址 const parserList = [ { name: '虾米解析', url: 'https://jx.yparse.com/index.php?url=' }, { name: '云解析1', url: 'https://jx.xmflv.cc/?url=' }, { name: '云解析2', url: 'https://jx.playerjy.com/?url=' }, { name: '高清解析', url: 'https://www.8090g.cn/jiexi/?url=' }, { name: '备用解析', url: 'https://www.ckplayer.vip/jiexi/?url=' } { title: "ckplayer", type: "1", url: "https://www.ckp23lay37uter.vip/jiexi/?url=" }, { title: "M3U8解析", type: "1", url: "https://jx.m3uqae8.tv/jiexi/?url=" }, { title: "夜幕", type: "1", url: "https://www.ye34wdmu.xyz/?url=" }, { title: "8090解析", type: "1", url: "https://www.8y0liu90g.cn/jiexi/?url=" }, { title: "云解析", type: "1", url: "https://ypatr4erse.ik9.cc/index.php?url=" }, { title: 'JY解析', type: "1", url: 'https://jx.we-vip.com/?url=', }, { title: "YT", type: "1", url: "https://jx.yanw2qagtu.top/?url=" }, { title: "⑸号解析", type: "1", url: "https://www.809opl0g.cn/jiexi/?url=" }, { title: "M1907解析", type: "1", url: "https://im19cds07.top/?jx=" }, { title: "咸鱼解析", type: "1", url: "https://jx.xyfzaslv.cc/?url=" }, { title: "极速解析", type: "1", url: "https://jx.2sklj0.cn/player/?url=" }, { title: "qianqi", type: "1", url: "https://api.qi32weanqi.net/vip/?url=" }, { title: "M1907", type: "0", url: "https://z1.im19awqz07.top/?jx=" }, { title: "yparse", type: "0", url: "https://jx.yparswr456se.com/index.php?url=" }, { title: "云解析", type: "1", url: "https://yparawedse.i67k9.cc/index.php?url=" }, { title: "Player-JY", type: "1", url: "https://jx.plavdfe3yerjy.com/?url=" }, { title: "虾米", type: "1", url: "https://jx.xmflw345v.com/?url=" }, { type: "1", url: "https://www.8090.la/8090/?url=", title: "全能vip②" }, { title: "BL", type: "1", url: "https://svip.bljiex.com/?v=" }, { title: "play", type: "1", url: "https://www.playm56yt3u8.cn/jiexi.php?url=" }, { type: "1", url: "https://jx.m3uwrtv8.tv/jiexi/?url=", title: "⑤号接口" }, { title: "8090解析", type: "1", url: "https://www.8090g.cn/jiexi/?url=" }, { title: "yparse", type: "1", url: "https://jx.yparred45rse.com/index.php?url=" }, { title: "综合/B站", type: "1", url: "https://jx.jsonplayer.com/player/?url=" }, { type: "1", url: "https://www.mtosz.com/m3u8.php?url=", title: "Mao解析" }, { type: "1", url: "https://movie.heheda.top/?v=", title: "风影阁" }, { title: "M1907", type: "1", url: "https://z1.im1w3erdx907.top/?&jx=" }, { title: "猪蹄", type: "1", url: "https://jx.iztyy.com/Bei/?url=" }, { title: "BL智能解析", type: "1", url: "https://svip.blji23weex.cc/?v=" }, ]; // 创建缩小版深色悬浮窗,默认右下角 function createFloatWindow() { const style = document.createElement('style'); style.innerHTML = ` #videoToolWindow { position: fixed; /* 默认右下角停靠 */ right: 15px; bottom: 15px; width: 420px; height: 360px; background: #222831; color: #eee; z-index: 999999; border-radius: 10px; box-shadow: 0 0 20px rgba(0,0,0,0.5); font-family: "微软雅黑", sans-serif; overflow: hidden; } #videoToolWindow .drag-bar { width: 100%; height: 28px; background: #393E46; cursor: move; line-height: 28px; padding-left: 12px; box-sizing: border-box; font-weight: bold; font-size: 13px; } #videoToolWindow .close-btn { position: absolute; right: 12px; top: 0; cursor: pointer; color: #ff6b6b; font-size: 16px; } #videoToolWindow input, #videoToolWindow select { background: #393E46; color: #fff; border: 1px solid #4a4f5a; border-radius: 4px; outline: none; padding: 0 6px; } #videoToolWindow button { background: #00adb5; color: #fff; border: none; border-radius: 4px; cursor: pointer; } #videoToolWindow button:hover { opacity: 0.9; } .divider-line { height: 1px; background: #444; margin: 10px 0; } `; document.head.appendChild(style); const win = document.createElement('div'); win.id = 'videoToolWindow'; // 修改按钮布局:5个按钮均分一行 win.innerHTML = `
二合一工具
VIP视频解析
B站1080P下载
抖音号 55090736036(小号) ,帮忙炸个流量呗 ; QQ群:暂时无
`; document.body.appendChild(win); // 窗口拖动 makeDraggable(win); // 关闭按钮 win.querySelector('.close-btn').onclick = () => win.remove(); return win; } // 拖动逻辑 function makeDraggable(el) { const bar = el.querySelector('.drag-bar'); let ox = 0, oy = 0, dragging = false; bar.onmousedown = e => { dragging = true; ox = e.clientX - el.getBoundingClientRect().left; oy = e.clientY - el.getBoundingClientRect().top; }; document.onmousemove = e => { if (!dragging) return; el.style.left = e.clientX - ox + 'px'; el.style.right = 'auto'; el.style.top = e.clientY - oy + 'px'; el.style.bottom = 'auto'; }; document.onmouseup = () => dragging = false; } // 绑定所有事件 function bindEvents(win) { const $ = s => win.querySelector(s); // 清空按钮 $('#vipClear').onclick = () => $('#vipUrl').value = ''; $('#biliClear').onclick = () => $('#biliUrl').value = ''; // 跳转网站(新增金牌影院跳转,7月18新增樱花动漫) $('#toIqiyi').onclick = () => window.open('https://www.iqiyi.com'); $('#toTencent').onclick = () => window.open('https://v.qq.com'); $('#toYouku').onclick = () => window.open('http://www.yinghuadm.co/'); $('#toBilibili').onclick = () => window.open('https://www.bilibili.com'); $('#toGoldCinema').onclick = () => window.open('https://www.ksnnhbj.com/'); $('#toBiliHome').onclick = () => window.open('https://www.bilibili.com'); // VIP解析播放 $('#playVip').onclick = () => { let url = $('#vipUrl').value.trim(); if (!url) return alert('请输入视频链接'); if (!url.startsWith('http')) url = 'https://' + url; const index = $('#parserSelect').value; const parserUrl = parserList[index].url; window.open(parserUrl + encodeURIComponent(url)); }; // 状态更新 function setStatus(text) { $('#status').innerText = '状态:' + text; } // 解析B站视频 async function parseBilibili(url) { const res = await axios.get(url, { headers: { Referer: 'https://www.bilibili.com/' } }); const html = res.data; const match = html.match(/window\.__INITIAL_STATE__=(.*?)(?:\}\;|\);\(function\(\))/); if (!match) return []; const data = JSON.parse(match[1]); const videos = []; const qn = '112'; if (url.includes('/bangumi/play/ep')) { const ep = data.epInfo; videos.push({ title: ep.share_copy, url: `https://api.bilibili.com/x/player/playurl?cid=${ep.cid}&avid=${ep.aid}&qn=${qn}` }); } else if (url.includes('/video/BV')) { const vd = data.videoData; const aid = vd.aid; for (let p of vd.pages) { const title = vd.pages.length > 1 ? p.part : vd.title; videos.push({ title: title, url: `https://api.bilibili.com/x/player/playurl?cid=${p.cid}&avid=${aid}&qn=${qn}` }); } } return videos; } // 下载视频 async function downloadVideo(info) { return new Promise(async resolve => { try { const res = await axios.get(info.url, { headers: { Referer: 'https://www.bilibili.com/' } }); const d = res.data; if (d.code !== 0) return resolve(); let title = info.title.replace(/[\\/:*?"<>|]/g, '') + '.mp4'; GM_download({ url: d.data.durl[0].url, name: title, headers: { Referer: 'https://www.bilibili.com/' }, onload: resolve, onerror: resolve }); } catch (e) { resolve(); } }); } // 开始下载 $('#startDownload').onclick = async () => { const url = $('#biliUrl').value.trim(); if (!url) return alert('请输入B站链接'); setStatus('正在解析...'); try { const list = await parseBilibili(url); if (!list.length) { setStatus('解析失败'); return alert('解析失败,检查链接'); } setStatus(`准备下载${list.length}个视频`); for (let item of list) await downloadVideo(item); setStatus('全部下载完成'); alert('B站视频下载完成!'); } catch (e) { setStatus('解析出错'); } }; } // 初始化启动 const win = createFloatWindow(); bindEvents(win); })(); setTimeout(()=>{ // 1. 创建遮罩层 let mask = document.createElement('div'); mask.id = 'dyMask'; mask.style.cssText = ` position:fixed;top:0;left:0;right:0;bottom:0; background:rgba(0,0,0,0.7);display:none; z-index:999999;justify-content:center;align-items:center; `; // 2. 创建弹窗盒子 let pop = document.createElement('div'); pop.style.cssText = ` background:#fff;padding:20px;border-radius:12px;text-align:center; `; // 3. 二维码图片(抖音个人二维码,会失效,这里现在是空框架,该功能不能用) let img = document.createElement('img'); img.width = 220; img.height = 220; img.src = 'https://p3-flow-image-sign.douyinpic.com/tos-cn-i-3jw0lfl0wq/3d111001110c4108990736036~tplv-3jw0lfl0wq-image.image'; img.style.borderRadius = '8px'; // 4. 提示文字 let tip = document.createElement('p'); tip.innerText = '扫码关注乱码哥'; tip.style.marginTop = '12px'; tip.style.color = '#666'; // 5. 组装弹窗 pop.appendChild(img); pop.appendChild(tip); mask.appendChild(pop); document.body.appendChild(mask); // 6. 点击灰色背景关闭弹窗 mask.onclick = () => mask.style.display = 'none'; // 7. 给抖音号绑定点击事件 let num = document.getElementById('dyNum'); if(num){ num.onclick = () => { mask.style.display = 'flex'; } } }, 800);