Last active
February 24, 2025 06:59
-
-
Save bugproof/98d634b868b2909b47f84b30cbc2e766 to your computer and use it in GitHub Desktop.
ViolentMonkey script to force original quality on Douyin (Chinese TikTok) without being logged in
This file contains hidden or 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 Stream Quality Override | |
| // @namespace Douyin | |
| // @version 1.0 | |
| // @description Maintains high quality stream URLs | |
| // @match https://live.douyin.com/* | |
| // @grant none | |
| // @run-at document-start | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| const originalFetch = window.fetch; | |
| window.fetch = async (...args) => { | |
| if (args[0].includes('stream-')) { | |
| console.log("Forcing origin quality") | |
| const streamQuality = JSON.parse(__pace_f[7][1]) | |
| console.log(streamQuality) | |
| const origin = streamQuality.data.origin.main.flv.replace("http:", "https:") | |
| console.log(origin) | |
| args[0] = origin | |
| } | |
| const response = await originalFetch(...args); | |
| return response; | |
| }; | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment