diff options
| author | RblSb <msrblsb@gmail.com> | 2025-08-14 02:53:59 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2025-08-15 07:03:17 +0300 |
| commit | e01ed5f5431551f8b159b4fd491c670efeca57ee (patch) | |
| tree | 78737545fd27cce482cbfdd059aa72fe52ecc515 /src | |
| parent | 6b97957566fa8a01b7fa37fb735de19ee442c297 (diff) | |
Prefer original audio tracks
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/HttpServer.hx | 1 | ||||
| -rw-r--r-- | src/server/cache/YoutubeCache.hx | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/server/HttpServer.hx b/src/server/HttpServer.hx index 4f283a4..f6fb27f 100644 --- a/src/server/HttpServer.hx +++ b/src/server/HttpServer.hx @@ -391,6 +391,7 @@ class HttpServer { final matchVarString = ~/\${([A-z_]+)}/g; function localizeHtml(data:String, lang:String):String { + if (!data.contains("<!-- localization-template -->")) return data; if (lang != null && matchLang.match(lang)) { lang = matchLang.matched(0); } else lang = "en"; diff --git a/src/server/cache/YoutubeCache.hx b/src/server/cache/YoutubeCache.hx index cb3d954..5b94bbb 100644 --- a/src/server/cache/YoutubeCache.hx +++ b/src/server/cache/YoutubeCache.hx @@ -85,7 +85,11 @@ class YoutubeCache { function onGetInfo(info:VideoInfo):Void { trace('Get info with ${info.formats.length} formats'); - var aformats = info.formats.filter(f -> f.acodec != "none" && f.vcodec == "none"); + var aformats = info.formats.filter(f -> f.acodec != "none" + && f.vcodec == "none" && f.format_note?.contains("original")); + if (aformats.length == 0) { + aformats = info.formats.filter(f -> f.acodec != "none" && f.vcodec == "none"); + } if (aformats.length == 0) { aformats = info.formats.filter(f -> f.acodec != "none"); } @@ -136,6 +140,7 @@ class YoutubeCache { output: '${cache.cacheDir}/$inVideoName', remuxVideo: "mp4", cookies: useCookies ? getCookiesPathOrNull() : null, + forceIpv4: true, onProgress: p -> { final isFinished = p.status == "finished"; var ratio = if (isFinished) { |
