From 1e8bdcddd88407d1c45e7cdba1eee8f22d2478fa Mon Sep 17 00:00:00 2001 From: Aetherinox Date: Tue, 8 Apr 2025 01:44:17 -0700 Subject: [PATCH] fix: add header-encoding env variable to fix gzip compression for jellyfin xml grab If gzip compression is enabled for the tvapp2 webserver, this may cause Jellyfin to fail when fetching newest xml guide data. to correct this, we create an env variable which allows us to disable gzip compression for `Accept-Encoding` --- Dockerfile | 1 + tvapp2/index.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f4118d01..f3972ee3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -70,6 +70,7 @@ ENV DIR_RUN=/usr/bin/app ENV URL_REPO="https://git.binaryninja.net/binaryninja/" ENV WEB_IP="0.0.0.0" ENV WEB_PORT=4124 +ENV WEB_ENCODING="deflate, br" ENV STREAM_QUALITY="hd" ENV FILE_URL="urls.txt" ENV FILE_M3U="playlist.m3u8" diff --git a/tvapp2/index.js b/tvapp2/index.js index a83daf4d..4932bba3 100755 --- a/tvapp2/index.js +++ b/tvapp2/index.js @@ -73,6 +73,7 @@ const envFileURL = process.env.FILE_URL || 'urls.txt'; const envFileM3U = process.env.FILE_M3U || 'playlist.m3u8'; const envFileXML = process.env.FILE_EPG || 'xmltv.xml'; const envFileTAR = process.env.FILE_TAR || 'xmltv.xml.gz'; +const envWebEncoding = process.env.WEB_ENCODING || 'deflate, br'; const LOG_LEVEL = process.env.LOG_LEVEL || 10; /* @@ -480,7 +481,7 @@ async function fetchRemote( url ) mod .get( url, { headers: { - 'Accept-Encoding': 'gzip, deflate, br' + 'Accept-Encoding': envWebEncoding } }, ( resp ) => {