3 Commits

Author SHA1 Message Date
403c34befd Merge branch 'main' of https://git.fascinated.cc/Fascinated/beatsaber-overlay
All checks were successful
Publish / docker (push) Successful in 2m31s
2023-10-31 11:44:53 +00:00
0185a9ed3e silly mee 2023-10-31 11:44:50 +00:00
47a255e48a fix proxy 2023-10-31 11:44:27 +00:00
7 changed files with 317 additions and 344 deletions

View File

@ -1,10 +1,10 @@
REACT_APP_HTTP_PROXY=https://proxy.fascinated.cc
REACT_APP_HTTP_PROXY=<https://proxy.fascinated.cc>
REACT_APP_SITE_NAME=BeatSaber Overlay
REACT_APP_SITE_TITLE=BeatSaber Overlay - Simple and easy to use BeatSaber overlay
REACT_APP_SITE_DESCRIPTION=ScoreSaber and BeatLeader overlay for Twitch streamers - Elevate your Beat Saber streams with our professional, customizable overlay that displays your real-time scores, rankings, and leaderboard information for your viewers.
REACT_APP_SITE_COLOR=0EBFE9
REACT_APP_SITE_URL=http://localhost:3000
REACT_APP_SITE_URL=<http://localhost:3000>
REDIS_PORT=6379
REDIS_HOST=localhost

View File

@ -35,11 +35,7 @@ export async function getMapData(hash: string): Promise<MapData | undefined> {
}
const before = Date.now();
const response = await axios.get(BEATSAVER_MAP_API.replace("%s", mapHash), {
headers: {
"X-Requested-With": "BeatSaber Overlay",
},
});
const response = await axios.get(BEATSAVER_MAP_API.replace("%s", mapHash));
if (response.status === 404) {
return undefined;
}

View File

@ -3,12 +3,7 @@ import LeaderboardType from "../../consts/LeaderboardType";
export async function getPlayerData(leaderboardType, playerId) {
const data = await axios.get(
LeaderboardType[leaderboardType].ApiUrl.PlayerData.replace("%s", playerId),
{
headers: {
"x-requested-with": "BeatSaber Overlay",
},
}
LeaderboardType[leaderboardType].ApiUrl.PlayerData.replace("%s", playerId)
);
return data;
}

View File

@ -41,12 +41,7 @@ export default async function handler(req, res) {
const before = Date.now();
const reesponse = await axios.get(
WebsiteTypes.BeatLeader.ApiUrl.MapData.replace("%h", mapHash),
{
headers: {
"X-Requested-With": "BeatSaber Overlay",
},
}
WebsiteTypes.BeatLeader.ApiUrl.MapData.replace("%h", mapHash)
);
if (reesponse.status === 404) {
return res.status(404).json({

View File

@ -40,12 +40,7 @@ export default async function handler(req, res) {
WebsiteTypes.ScoreSaber.ApiUrl.MapData.replace("%h", mapHash).replace(
"%d",
diffToScoreSaberDiff(difficulty)
),
{
headers: {
"X-Requested-With": "BeatSaber Overlay",
},
}
)
);
if (response.status === 404) {
return res.status(404).json({

View File

@ -30,11 +30,7 @@ export const usePlayerDataStore = create<PlayerDataState>()((set) => ({
const apiUrl = Utils.getWebsiteApi(
leaderboardType
).ApiUrl.PlayerData.replace("%s", playerId);
const response = await axios.get(apiUrl, {
headers: {
"x-requested-with": "BeatSaber Overlay",
},
});
const response = await axios.get(apiUrl);
if (response.status !== 200) {
return;
}

View File

@ -20,11 +20,7 @@ export default class Utils {
}
static async isLeaderboardValid(url, steamId) {
const response = await axios.get(url.replace("%s", steamId), {
headers: {
"X-Requested-With": "BeatSaber Overlay",
},
});
const response = await axios.get(url.replace("%s", steamId));
if (response.status === 429) {
return true; // Just assume it's true is we are rate limited
}