您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
跳转原视频源:YouTube、Twitch
// ==UserScript== // @name SKLive 自动跳转 // @version 1.0 // @description 跳转原视频源:YouTube、Twitch // @author yzcjd // @author2 ChatGPT4辅助 // @namespace https://greasyfork.org/users/1171320 // @license MIT // @match https://skknower.com/twitch/* // @match https://sk-knower.com/live* // @run-at document-start // ==/UserScript== (function() { 'use strict'; let host = window.location.host; let pathname = window.location.pathname; let search = window.location.search; // 规则1: skknower.com/twitch/*** → twitch.com/*** if (host === 'skknower.com' && pathname.startsWith('/twitch/')) { let path = pathname.replace(/^\/twitch\//, ''); let targetUrl = 'https://twitch.com/' + path; window.location.replace(targetUrl); } // 规则2: sk-knower.com/live?v=xxx → youtube.com/watch?v=xxx if (host === 'sk-knower.com' && pathname === '/live') { // 从参数中提取 v let params = new URLSearchParams(search); let v = params.get('v'); if (v) { let targetUrl = 'https://www.youtube.com/watch?v=' + v; window.location.replace(targetUrl); } } })();