From 07409045a02a4ebb7549f062a1a6790f552ddcf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shadowsun=E2=84=A2?= <12494967+CattoGamer@users.noreply.github.com> Date: Thu, 29 Aug 2024 01:46:39 +0200 Subject: [PATCH] don't use blacklisted headers on the client --- .../gamemode/modules/theater/services/sh_base.lua | 5 ++++- .../gamemode/modules/theater/services/sh_youtube.lua | 5 +---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/workshop/gamemodes/cinema_modded/gamemode/modules/theater/services/sh_base.lua b/workshop/gamemodes/cinema_modded/gamemode/modules/theater/services/sh_base.lua index 6a4645b..88d53d3 100644 --- a/workshop/gamemodes/cinema_modded/gamemode/modules/theater/services/sh_base.lua +++ b/workshop/gamemodes/cinema_modded/gamemode/modules/theater/services/sh_base.lua @@ -28,11 +28,14 @@ end local HttpHeaders = { ["Cache-Control"] = "no-cache", -- ["Connection"] = "keep-alive", - ["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.7.8254.20 Safari/537.36" } function SERVICE:Fetch( url, onReceive, onFailure, headers ) + if SERVER then + HttpHeaders["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.7.8254.20 Safari/537.36" + end + local request = { url = url, method = "GET", diff --git a/workshop/gamemodes/cinema_modded/gamemode/modules/theater/services/sh_youtube.lua b/workshop/gamemodes/cinema_modded/gamemode/modules/theater/services/sh_youtube.lua index 8c0c616..57500fa 100644 --- a/workshop/gamemodes/cinema_modded/gamemode/modules/theater/services/sh_youtube.lua +++ b/workshop/gamemodes/cinema_modded/gamemode/modules/theater/services/sh_youtube.lua @@ -293,10 +293,7 @@ do print("[Invidious API]: " .. message) end - http.Fetch("https://api.invidious.io/instances.json?sort_by=type,users", onSuccess, onFailure, { - ["Accept-Encoding"] = "gzip, deflate", - ["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36", - }) + http.Fetch("https://api.invidious.io/instances.json?sort_by=type,users", onSuccess, onFailure, {}) end fetchInstances()