mirror of
https://github.com/younesaassila/ttv-lol-pro.git
synced 2025-05-23 18:16:27 +02:00
🔖 Release version 2.2.1
This commit is contained in:
commit
44e31a1e87
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "ttv-lol-pro",
|
"name": "ttv-lol-pro",
|
||||||
"version": "2.2.0",
|
"version": "2.2.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ttv-lol-pro",
|
"name": "ttv-lol-pro",
|
||||||
"version": "2.2.0",
|
"version": "2.2.1",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bowser": "^2.11.0",
|
"bowser": "^2.11.0",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ttv-lol-pro",
|
"name": "ttv-lol-pro",
|
||||||
"version": "2.2.0",
|
"version": "2.2.1",
|
||||||
"description": "TTV LOL PRO removes most livestream ads from Twitch.",
|
"description": "TTV LOL PRO removes most livestream ads from Twitch.",
|
||||||
"@parcel/bundler-default": {
|
"@parcel/bundler-default": {
|
||||||
"minBundles": 10000000,
|
"minBundles": 10000000,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "TTV LOL PRO",
|
"name": "TTV LOL PRO",
|
||||||
"description": "TTV LOL PRO removes most livestream ads from Twitch.",
|
"description": "TTV LOL PRO removes most livestream ads from Twitch.",
|
||||||
"version": "2.2.0",
|
"version": "2.2.1",
|
||||||
"background": {
|
"background": {
|
||||||
"service_worker": "background/background.ts",
|
"service_worker": "background/background.ts",
|
||||||
"type": "module"
|
"type": "module"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "TTV LOL PRO",
|
"name": "TTV LOL PRO",
|
||||||
"description": "TTV LOL PRO removes most livestream ads from Twitch.",
|
"description": "TTV LOL PRO removes most livestream ads from Twitch.",
|
||||||
"version": "2.2.0",
|
"version": "2.2.1",
|
||||||
"background": {
|
"background": {
|
||||||
"scripts": ["background/background.ts"],
|
"scripts": ["background/background.ts"],
|
||||||
"persistent": false
|
"persistent": false
|
||||||
|
@ -92,6 +92,7 @@
|
|||||||
<label for="anonymous-mode-checkbox">
|
<label for="anonymous-mode-checkbox">
|
||||||
Redact my passport information
|
Redact my passport information
|
||||||
</label>
|
</label>
|
||||||
|
<span class="tag">Recommended</span>
|
||||||
<br />
|
<br />
|
||||||
<small>
|
<small>
|
||||||
Watch streams as if you were logged out. This option removes
|
Watch streams as if you were logged out. This option removes
|
||||||
|
@ -28,7 +28,7 @@ export function getFetch(options: FetchOptions): typeof fetch {
|
|||||||
if (options.shouldWaitForStore) {
|
if (options.shouldWaitForStore) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
options.shouldWaitForStore = false;
|
options.shouldWaitForStore = false;
|
||||||
}, 3000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
return async function fetch(
|
return async function fetch(
|
||||||
@ -87,15 +87,35 @@ export function getFetch(options: FetchOptions): typeof fetch {
|
|||||||
console.debug(
|
console.debug(
|
||||||
"[TTV LOL PRO] 🥅 Caught GraphQL PlaybackAccessToken_Template request. Flagging…"
|
"[TTV LOL PRO] 🥅 Caught GraphQL PlaybackAccessToken_Template request. Flagging…"
|
||||||
);
|
);
|
||||||
|
|
||||||
while (options.shouldWaitForStore) await sleep(100);
|
while (options.shouldWaitForStore) await sleep(100);
|
||||||
if (options.state?.anonymousMode) {
|
let graphQlBody = null;
|
||||||
console.log("[TTV LOL PRO] ❓ Acting as anonymous user");
|
try {
|
||||||
setHeaderToMap(headersMap, "Authorization", "undefined");
|
graphQlBody = JSON.parse(requestBody);
|
||||||
removeHeaderFromMap(headersMap, "Client-Session-Id");
|
} catch {}
|
||||||
removeHeaderFromMap(headersMap, "Client-Version");
|
const channelName = graphQlBody?.variables?.login as string | undefined;
|
||||||
setHeaderToMap(headersMap, "Device-ID", generateRandomString(32));
|
const whitelistedChannelsLower = options.state?.whitelistedChannels.map(
|
||||||
removeHeaderFromMap(headersMap, "Sec-GPC");
|
channel => channel.toLowerCase()
|
||||||
removeHeaderFromMap(headersMap, "X-Device-Id");
|
);
|
||||||
|
const isWhitelisted =
|
||||||
|
channelName != null &&
|
||||||
|
whitelistedChannelsLower != null &&
|
||||||
|
whitelistedChannelsLower.includes(channelName.toLowerCase());
|
||||||
|
|
||||||
|
if (options.state?.anonymousMode === true) {
|
||||||
|
if (!isWhitelisted) {
|
||||||
|
console.log("[TTV LOL PRO] 🕵️ Anonymous mode is enabled.");
|
||||||
|
setHeaderToMap(headersMap, "Authorization", "undefined");
|
||||||
|
removeHeaderFromMap(headersMap, "Client-Session-Id");
|
||||||
|
removeHeaderFromMap(headersMap, "Client-Version");
|
||||||
|
setHeaderToMap(headersMap, "Device-ID", generateRandomString(32));
|
||||||
|
removeHeaderFromMap(headersMap, "Sec-GPC");
|
||||||
|
removeHeaderFromMap(headersMap, "X-Device-Id");
|
||||||
|
} else {
|
||||||
|
console.log(
|
||||||
|
"[TTV LOL PRO] 🕵️✋ Anonymous mode is enabled but channel is whitelisted."
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
flagRequest(headersMap);
|
flagRequest(headersMap);
|
||||||
} else if (
|
} else if (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user