Forked from Last-Order/gist:43199b7a701fc94e800c2de0ed021f1c
Last active
May 11, 2024 12:34
-
-
Save prinsss/0c7730cdac336dfeddd3f22da6ad08a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Abema 强制 1080p | |
// @description 把其他清晰度的播放列表强制指向1080p | |
// @version 1.1.0 | |
// @run-at document-start | |
// @namespace Violentmonkey Scripts | |
// @match https://abema.tv/* | |
// @grant none | |
// ==/UserScript== | |
const originalFetch = window.fetch | |
window.fetch = (...args) => { | |
const regex = /\/\d+\/playlist\.m3u8/ | |
if (typeof args[0] === 'string' && args[0].match(regex)) { | |
args[0] = args[0].replace(regex, '/1080/playlist.m3u8') | |
console.log(args[0]) | |
} | |
return originalFetch(...args) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment