From 006b9f1c1ba2e8988c50b685c698a3eb428ea88c Mon Sep 17 00:00:00 2001 From: Obelous <47227283+0belous@users.noreply.github.com> Date: Mon, 23 Feb 2026 08:23:48 +0000 Subject: [PATCH] always use latest jellyfin user agent --- sources.txt | 2 +- update.js | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sources.txt b/sources.txt index 5e4084d..080ba31 100644 --- a/sources.txt +++ b/sources.txt @@ -3,6 +3,7 @@ https://app.lizardbyte.dev/jellyfin-plugin-repo/manifest.json https://github.com/cxfksword/jellyfin-plugin-danmu/releases/download/manifest/manifest.json https://github.com/cxfksword/jellyfin-plugin-metashark/releases/download/manifest/manifest.json https://github.com/lachlandcp/jellyfin-editors-choice-plugin/raw/main/manifest.json +https://intro-skipper.org/manifest.json https://jellyfin-repo.jesseward.com/manifest.json https://kookxiang.github.io/jellyfin-plugin-bangumi/repository.json https://noonamer.github.io/Jellyfin.Plugin.LocalPosters/repository.json @@ -22,7 +23,6 @@ https://raw.githubusercontent.com/G-grbz/Jellyfin-MonWUI-Plugin/main/manifest.js https://raw.githubusercontent.com/GrandguyJS/media-upload-plugin/main/manifest.json https://raw.githubusercontent.com/iankiller77/MyAnimeSync/main/manifest.json https://raw.githubusercontent.com/ImLacy/Jellyfin-CustomLogo/refs/heads/main/manifest.json -https://raw.githubusercontent.com/intro-skipper/manifest/refs/heads/main/10.11/manifest.json https://raw.githubusercontent.com/johnpc/jellyfin-plugin-smart-collections/refs/heads/main/manifest.json https://raw.githubusercontent.com/johnpc/jellyfin-plugin-top-ten/refs/heads/main/manifest.json https://raw.githubusercontent.com/jon4hz/jellyfin-plugin-jellysleep/main/manifest.json diff --git a/update.js b/update.js index 62e1324..63cdf7d 100644 --- a/update.js +++ b/update.js @@ -1,11 +1,20 @@ const fs = require('fs/promises'); const path = require('path'); const crypto = require('crypto'); -const userAgent = "Jellyfin-Server/10.11.4"; // Required for some repositories +let userAgent = "Jellyfin-Server/10.11.4"; // Required for some repositories const imagesDir = path.join(__dirname, 'images'); const imageBaseUrl = 'https://raw.githubusercontent.com/0belous/universal-plugin-repo/refs/heads/main/images/'; +async function getLatestJellyfinVersion() { + const response = await fetch('https://api.github.com/repos/jellyfin/jellyfin/releases/latest', { + headers: { 'User-Agent': 'Node-Fetch' } + }); + if (!response.ok) throw new Error(); + const data = await response.json(); + return data.tag_name.replace('v', ''); +} + async function getSources(){ let sources = []; try { @@ -146,10 +155,10 @@ async function writeManifest(dataToWrite){ console.error('Error writing manifest file:', err); } console.log(`\nSuccessfully created manifest.json with ${dataToWrite.length} total plugins`); - console.log('Manifest updated with new image URLs.'); } async function main() { + userAgent = `Jellyfin-Server/${await getLatestJellyfinVersion()}`; const plugins = await getSources(); await processDescriptions(plugins); await processImages(plugins);