Remove deprecated and add proxy server example

This commit is contained in:
pixeltris
2021-04-11 23:46:26 +01:00
parent 8c72911b3b
commit 9ba777406b
30 changed files with 1774 additions and 8438 deletions
+20
View File
@@ -0,0 +1,20 @@
var isChrome = typeof chrome !== "undefined" && typeof browser === "undefined";
var extensionAPI = isChrome ? chrome : browser;
function onBeforeRequest(details) {
const match = /hls\/(\w+)\.m3u8/gim.exec(details.url);
if (match !== null && match.length > 1) {
return {
redirectUrl: `http://127.0.0.1/twitch-m3u8/${match[1]}`
};
} else {
return {
redirectUrl: details.url
};
}
}
extensionAPI.webRequest.onBeforeRequest.addListener(
onBeforeRequest, {
urls: ["https://usher.ttvnw.net/api/channel/hls/*"]
},
["blocking"]
);