// ==UserScript== // @name 🎬 智能视频解析助手 - 增强版(仅供学习参考) // @namespace https://github.com/video-helper // @version 2.1.0 // @description 专业视频解析工具 | 支持多平台 | 完全免费 | 仅供技术学习交流使用 // @author 智能解析助手 // @match *://*.iqiyi.com/* // @match *://v.qq.com/* // @match *://*.youku.com/* // @match *://*.mgtv.com/* // @match *://*.bilibili.com/* // @match *://*.le.com/* // @match *://*.sohu.com/* // @match *://*.pptv.com/* // @match *://*.1905.com/* // @grant GM_registerMenuCommand // @grant GM_addStyle // @grant GM_notification // @grant GM_getValue // @grant GM_setValue // @grant GM_openInTab // @require https://cdn.jsdelivr.net/npm/sweetalert2@11 // @run-at document-idle // @icon https://cdn.jsdelivr.net/npm/simple-icons@v8/icons/vlc.svg // @supportURL https://github.com/video-helper/issues // @license MIT // ==/UserScript== /** * 视频解析助手 - 增强版 * * 重要法律声明: * 1. 本工具为免费开源项目,仅供个人学习、研究网络技术之用。 * 2. 严禁将本工具用于任何侵犯版权、违反平台服务条款或法律法规的行为。 * 3. 用户应确保其通过本工具观看的任何内容均已获得合法授权。 * 4. 本工具完全免费,开发者不从中获取任何直接或间接收益,不构成任何形式的商业服务或担保。 * 5. 使用本工具及其中集成的任何第三方解析接口所带来的所有风险(包括但不限于安全风险、法律风险)由用户自行承担。 * 6. 开发者不对因使用本工具导致的任何内容合法性、服务可用性、数据安全性问题及由此引发的任何直接、间接或衍生损失承担任何责任。 * 7. 用户使用本工具即视为已阅读、理解并完全同意本声明,并承诺合法合规使用。 */ (function() { 'use strict'; // ==================== 配置管理模块 ==================== const ConfigManager = { // 调试模式开关 DEBUG: false, // 存储键名 STORAGE_KEYS: { AUTO_PLAY: 'video_helper_auto_play', SELECTED_API: 'video_helper_selected_api', CUSTOM_APIS: 'video_helper_custom_apis', SCRIPT_VERSION: 'video_helper_version' }, // 解析接口类型定义 API_TYPES: { EMBEDDED: '1', // 内嵌播放 POPUP_EPISODES: '2', // 弹窗带选集 POPUP_SIMPLE: '3' // 弹窗无选集 }, // 支持的视频平台 SUPPORTED_PLATFORMS: [ { name: '爱奇艺', patterns: ['iqiyi.com'], playerSelectors: ['#player', '.qiyi-player', '.player-container'] }, { name: '腾讯视频', patterns: ['v.qq.com'], playerSelectors: ['#tenvideo_video_player', '.txp_player'] }, { name: '优酷', patterns: ['youku.com'], playerSelectors: ['#player', '.yk-player'] }, { name: '芒果TV', patterns: ['mgtv.com'], playerSelectors: ['#mgtv-player-wrap', '.mgtv-player'] }, { name: '哔哩哔哩', patterns: ['bilibili.com'], playerSelectors: ['#bilibiliPlayer', '.bilibili-player'] }, { name: '乐视', patterns: ['le.com'], playerSelectors: ['#player', '.le-player'] }, { name: '搜狐视频', patterns: ['sohu.com'], playerSelectors: ['#player', '.sohu-player'] }, { name: 'PPTV', patterns: ['pptv.com'], playerSelectors: ['#player', '.pptv-player'] }, { name: '1905电影网', patterns: ['1905.com'], playerSelectors: ['#player', '.vod-player'] } ], // 内置解析接口(去重后的完整列表) BUILTIN_APIS: [ // 内嵌播放 + 弹窗无选集接口 {name: "七哥解析", type: "1,3", url: "https://jx.nnxv.cn/tv.php?url=", recommended: true}, {name: "虾米解析", type: "1,3", url: "https://jx.xmflv.cc/?url=", recommended: true}, {name: "纯净解析", type: "1,2,3", url: "https://im1907.top/?jx="}, {name: "B站解析", type: "1,3", url: "https://jx.jsonplayer.com/player/?url="}, {name: "爱豆解析", type: "1,3", url: "https://jx.aidouer.net/?url="}, {name: "BL解析", type: "1,3", url: "https://vip.bljiex.com/?v="}, {name: "冰豆解析", type: "1,3", url: "https://api.qianqi.net/vip/?url="}, {name: "百域解析", type: "1,3", url: "https://jx.618g.com/?url="}, {name: "CK解析", type: "1,3", url: "https://www.ckplayer.vip/jiexi/?url="}, {name: "CHok解析", type: "1,3", url: "https://www.gai4.com/?url="}, {name: "ckmov解析", type: "1,3", url: "https://www.ckmov.vip/api.php?url="}, {name: "H8解析", type: "1,3", url: "https://www.h8jx.com/jiexi.php?url="}, {name: "JY解析", type: "1,3", url: "https://jx.playerjy.com/?url="}, {name: "解析接口", type: "1,3", url: "https://ckmov.ccyjjd.com/ckmov/?url="}, {name: "解析la", type: "1,3", url: "https://api.jiexi.la/?url="}, {name: "老板解析", type: "1,3", url: "https://vip.laobandq.com/jiexi.php?url="}, {name: "MAO解析", type: "1,3", url: "https://www.mtosz.com/m3u8.php?url="}, {name: "M3U8解析", type: "1,3", url: "https://jx.m3u8.tv/jiexi/?url="}, {name: "诺讯解析", type: "1,3", url: "https://www.nxflv.com/?url="}, {name: "OK解析", type: "1,3", url: "https://okjx.cc/?url="}, {name: "PM解析", type: "1,3", url: "https://www.playm3u8.cn/jiexi.php?url="}, {name: "盘古解析", type: "1,3", url: "https://www.pangujiexi.cc/jiexi.php?url="}, {name: "RDHK解析", type: "1,3", url: "https://jx.rdhk.net/?v="}, {name: "人人迷解析", type: "1,3", url: "https://jx.blbo.cc:4433/?url="}, {name: "思云解析", type: "1,3", url: "https://jx.ap2p.cn/?url="}, {name: "思古解析", type: "1,3", url: "https://jsap.attakids.com/?url="}, {name: "听乐解析", type: "1,3", url: "https://jx.dj6u.com/?url="}, {name: "维多解析", type: "1,3", url: "https://jx.ivito.cn/?url="}, {name: "YT解析", type: "1,3", url: "https://jx.yangtu.top/?url="}, {name: "云端解析", type: "1,3", url: "https://sb.5gseo.net/?url="}, {name: "0523解析", type: "1,3", url: "https://go.yh0523.cn/y.cy?url="}, {name: "17云解析", type: "1,3", url: "https://www.1717yun.com/jx/ty.php?url="}, {name: "180解析", type: "1,3", url: "https://jx.000180.top/jx/?url="}, {name: "4K解析", type: "1,3", url: "https://jx.4kdv.com/?url="}, {name: "8090解析", type: "1,3", url: "https://www.8090g.cn/?url="}, {name: "剖元解析", type: "1,3", url: "https://www.pouyun.com/?url="}, {name: "全民解析", type: "1,3", url: "https://43.240.74.102:4433?url="}, {name: "夜幕解析", type: "1,3", url: "https://www.yemu.xyz/?url="}, // 弹窗播放带选集接口 {name: "im1907(带选集)", type: "2", url: "https://im1907.top/?jx="}, {name: "云析(带选集)", type: "2", url: "https://jx.yparse.com/index.php?url="}, ], // 获取所有可用的解析接口 getAllApis: function() { const uniqueApis = []; const seenUrls = new Set(); // 去重处理 this.BUILTIN_APIS.forEach(api => { if (!seenUrls.has(api.url)) { seenUrls.add(api.url); uniqueApis.push(api); } }); // 合并自定义接口 const customApis = GM_getValue(this.STORAGE_KEYS.CUSTOM_APIS, []); return [...uniqueApis, ...customApis]; }, // 检查当前网站是否支持 isSiteSupported: function() { const hostname = window.location.hostname; return this.SUPPORTED_PLATFORMS.some(platform => platform.patterns.some(pattern => hostname.includes(pattern)) ); }, // 查找视频播放器容器 findVideoContainer: function() { const platform = this.SUPPORTED_PLATFORMS.find(p => p.patterns.some(pattern => window.location.hostname.includes(pattern)) ); if (platform) { for (const selector of platform.playerSelectors) { const container = document.querySelector(selector); if (container) { this.log(`找到视频容器: ${selector}`); return container; } } } // 通用查找 const commonSelectors = [ '#player', '.player', '.video-player', '.player-container', '.video-container', 'video', 'iframe[src*="video"]' ]; for (const selector of commonSelectors) { const container = document.querySelector(selector); if (container) { this.log(`通用找到视频容器: ${selector}`); return container; } } return null; }, // 调试日志 log: function(...args) { if (this.DEBUG) { console.log('[视频解析助手]', ...args); } } }; // ==================== UI管理器模块 ==================== const UIManager = { // 生成唯一的ID generateId: function() { return 'video_helper_' + Math.random().toString(36).substr(2, 9); }, // 注入CSS样式 injectStyles: function() { const styles = ` #video-helper-container { position: fixed; top: 120px; left: 0; z-index: 2147483647; transition: left 0.3s ease; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; } #video-helper-container:hover { left: 0; } .vh-main-icon { width: 40px; height: 40px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 8px 0 0 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: white; font-weight: bold; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); user-select: none; } .vh-main-icon:hover { background: linear-gradient(135deg, #764ba2 0%, #667eea 100%); } .vh-panel { position: absolute; left: 40px; top: 0; width: 420px; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); border-radius: 0 8px 8px 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); overflow: hidden; opacity: 0; transform: translateX(-20px); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: none; } #video-helper-container:hover .vh-panel { opacity: 1; transform: translateX(0); display: block; } .vh-tabs { display: flex; background: #f8f9fa; border-bottom: 1px solid #e9ecef; } .vh-tab { flex: 1; padding: 12px; border: none; background: none; cursor: pointer; font-size: 12px; color: #6c757d; transition: all 0.2s; } .vh-tab.active { color: #667eea; font-weight: 600; border-bottom: 2px solid #667eea; background: white; } .vh-tab-content { padding: 16px; max-height: 400px; overflow-y: auto; } .vh-section-title { color: #667eea; font-weight: 600; font-size: 12px; margin: 12px 0 8px 0; padding-bottom: 4px; border-bottom: 1px solid #e9ecef; } .vh-api-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; } .vh-api-item { padding: 6px 4px; background: white; border: 1px solid #dee2e6; border-radius: 4px; font-size: 11px; text-align: center; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: all 0.2s; } .vh-api-item:hover { border-color: #667eea; color: #667eea; transform: translateY(-1px); } .vh-api-item.selected { border-color: #667eea; color: #667eea; background: #f0f2ff; } .vh-api-item.recommended { border-color: #28a745; } .vh-api-item.recommended:hover { border-color: #218838; } .vh-mode-toggle { color: #667eea; font-size: 10px; cursor: pointer; margin-left: 2px; } .vh-auto-switch { width: 40px; height: 40px; background: #28a745; border-radius: 8px 0 0 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: white; font-weight: bold; font-size: 12px; margin-top: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); } .vh-auto-switch.off { background: #dc3545; } .vh-auto-switch:hover { opacity: 0.9; } .vh-legal-notice { background: #fff3cd; border: 2px solid #ffc107; border-radius: 6px; padding: 12px; margin: 0 0 16px 0; font-size: 11px; color: #856404; text-align: left; } .vh-legal-title { font-weight: bold; font-size: 12px; margin-bottom: 6px; color: #856404; } .vh-legal-text { margin: 4px 0; line-height: 1.4; } .vh-custom-form { padding: 12px; background: #f8f9fa; border-radius: 6px; margin-top: 12px; } .vh-form-title { color: #495057; font-size: 12px; margin-bottom: 8px; } .vh-form-input { width: 100%; padding: 6px 8px; border: 1px solid #ced4da; border-radius: 4px; font-size: 12px; margin-bottom: 8px; } .vh-form-input:focus { outline: none; border-color: #667eea; } .vh-form-select { width: 100%; padding: 6px 8px; border: 1px solid #ced4da; border-radius: 4px; font-size: 12px; margin-bottom: 8px; background: white; } .vh-form-buttons { display: flex; gap: 8px; } .vh-btn { flex: 1; padding: 6px 12px; border: none; border-radius: 4px; font-size: 12px; cursor: pointer; transition: all 0.2s; } .vh-btn-primary { background: #667eea; color: white; } .vh-btn-primary:hover { background: #5a67d8; } .vh-btn-secondary { background: #6c757d; color: white; } .vh-btn-secondary:hover { background: #545b62; } .vh-notice { background: #e7f5ff; border: 1px solid #a5d8ff; border-radius: 4px; padding: 8px; margin: 8px 0; font-size: 11px; color: #1864ab; } .vh-notice-title { font-weight: bold; margin-bottom: 4px; } /* 滚动条样式 */ .vh-tab-content::-webkit-scrollbar { width: 4px; } .vh-tab-content::-webkit-scrollbar-track { background: #f1f1f1; } .vh-tab-content::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 2px; } .vh-tab-content::-webkit-scrollbar-thumb:hover { background: #a8a8a8; } `; GM_addStyle(styles); }, // 创建主界面 createInterface: function(apis) { const containerId = this.generateId(); const container = document.createElement('div'); container.id = containerId; container.innerHTML = this.generateHTML(apis); document.body.appendChild(container); this.bindEvents(container, apis); return container; }, // 生成HTML内容 generateHTML: function(apis) { const simpleApis = apis.filter(api => api.type.includes('1') || api.type.includes('3')); const complexApis = apis.filter(api => api.type.includes('2')); return `
版本:2.1.0
接口数量:${ConfigManager.getAllApis().length}
自动解析:${GM_getValue(ConfigManager.STORAGE_KEYS.AUTO_PLAY) ? '已开启' : '已关闭'}
支持平台:${ConfigManager.SUPPORTED_PLATFORMS.length}个
性质:免费开源,仅供技术学习