Use the working Mac Chrome/122 User-Agent for Viaplay on server and all clients.

This commit is contained in:
Jos Vooges | STH 2026-09-28 20:48:48 +02:00
parent 4c2ede91e0
commit 19aa0853a3
9 changed files with 13 additions and 13 deletions

View file

@ -192,7 +192,7 @@ fun buildTvPlayer(context: Context): ExoPlayer {
/** Gedeelde HTTP-client voor HLS-segmenten (connectie-hergebruik). */ /** Gedeelde HTTP-client voor HLS-segmenten (connectie-hergebruik). */
private const val VIAPLAY_BROWSER_UA = private const val VIAPLAY_BROWSER_UA =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"
private fun isViaplayCdnHost(host: String): Boolean = private fun isViaplayCdnHost(host: String): Boolean =
host.contains("viaplay", ignoreCase = true) host.contains("viaplay", ignoreCase = true)

View file

@ -201,7 +201,7 @@ fun buildTvPlayer(context: Context, audioPassthrough: Boolean = false): ExoPlaye
/** Gedeelde HTTP-client voor HLS-segmenten (connectie-hergebruik). */ /** Gedeelde HTTP-client voor HLS-segmenten (connectie-hergebruik). */
private const val VIAPLAY_BROWSER_UA = private const val VIAPLAY_BROWSER_UA =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"
private fun isViaplayCdnHost(host: String): Boolean = private fun isViaplayCdnHost(host: String): Boolean =
host.contains("viaplay", ignoreCase = true) host.contains("viaplay", ignoreCase = true)

View file

@ -345,7 +345,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 66; CURRENT_PROJECT_VERSION = 67;
DEVELOPMENT_TEAM = X25NYX3K49; DEVELOPMENT_TEAM = X25NYX3K49;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;
@ -360,7 +360,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks" "@executable_path/Frameworks"
); );
MARKETING_VERSION = 0.5.53; MARKETING_VERSION = 0.5.54;
OTHER_LDFLAGS = ("$(inherited)", "-ObjC"); OTHER_LDFLAGS = ("$(inherited)", "-ObjC");
PRODUCT_BUNDLE_IDENTIFIER = nl.vonas.mediacluster.ios; PRODUCT_BUNDLE_IDENTIFIER = nl.vonas.mediacluster.ios;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
@ -378,7 +378,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 66; CURRENT_PROJECT_VERSION = 67;
DEVELOPMENT_TEAM = X25NYX3K49; DEVELOPMENT_TEAM = X25NYX3K49;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;
@ -393,7 +393,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks" "@executable_path/Frameworks"
); );
MARKETING_VERSION = 0.5.53; MARKETING_VERSION = 0.5.54;
OTHER_LDFLAGS = ("$(inherited)", "-ObjC"); OTHER_LDFLAGS = ("$(inherited)", "-ObjC");
PRODUCT_BUNDLE_IDENTIFIER = nl.vonas.mediacluster.ios; PRODUCT_BUNDLE_IDENTIFIER = nl.vonas.mediacluster.ios;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";

View file

@ -1050,7 +1050,7 @@ final class ClearKeyDashProxy {
let host = url.host?.lowercased() ?? "" let host = url.host?.lowercased() ?? ""
if host.contains("viaplay") { if host.contains("viaplay") {
req.setValue( req.setValue(
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",
forHTTPHeaderField: "User-Agent" forHTTPHeaderField: "User-Agent"
) )
req.setValue("https://viaplay.com/", forHTTPHeaderField: "Referer") req.setValue("https://viaplay.com/", forHTTPHeaderField: "Referer")

View file

@ -460,7 +460,7 @@ final class VLCPlayerController: NSObject, ObservableObject, VLCMediaPlayerDeleg
media.addOption(":freetype-rel-fontsize=\(subtitleRelFontSize)") media.addOption(":freetype-rel-fontsize=\(subtitleRelFontSize)")
let viaplay = url.host?.localizedCaseInsensitiveContains("viaplay") == true let viaplay = url.host?.localizedCaseInsensitiveContains("viaplay") == true
if viaplay && !viaLocalProxy { if viaplay && !viaLocalProxy {
media.addOption(":http-user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36") media.addOption(":http-user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36")
media.addOption(":http-referrer=https://viaplay.com/") media.addOption(":http-referrer=https://viaplay.com/")
} else { } else {
media.addOption(":http-user-agent=VLC/3.0.21 LibVLC/3.0.21") media.addOption(":http-user-agent=VLC/3.0.21 LibVLC/3.0.21")

View file

@ -96,7 +96,7 @@ struct SettingsScreen: View {
Section("Info") { Section("Info") {
LabeledContent("App", value: "VMC iOS") LabeledContent("App", value: "VMC iOS")
LabeledContent("Versie", value: "0.5.53") LabeledContent("Versie", value: "0.5.54")
LabeledContent("Live TV", value: app.iptvEnabled ? "Aan" : "Uit") LabeledContent("Live TV", value: app.iptvEnabled ? "Aan" : "Uit")
LabeledContent("Events", value: app.eventsEnabled ? "Aan" : "Uit") LabeledContent("Events", value: app.eventsEnabled ? "Aan" : "Uit")
} }

View file

@ -22,7 +22,7 @@ final class VLCPlayerController: NSObject, ObservableObject, VLCMediaPlayerDeleg
private static func applyCdnHeaders(to media: VLCMedia, url: URL) { private static func applyCdnHeaders(to media: VLCMedia, url: URL) {
if url.host?.localizedCaseInsensitiveContains("viaplay") == true { if url.host?.localizedCaseInsensitiveContains("viaplay") == true {
media.addOption(":http-user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36") media.addOption(":http-user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36")
media.addOption(":http-referrer=https://viaplay.com/") media.addOption(":http-referrer=https://viaplay.com/")
} }
} }

View file

@ -3,9 +3,9 @@ import type { ViaplayAccountCreds } from "./accounts";
import { toMediaGuid } from "./accounts"; import { toMediaGuid } from "./accounts";
import { inventoryFromNames, pickPlayCookies, type CookieInventory } from "./cookies"; import { inventoryFromNames, pickPlayCookies, type CookieInventory } from "./cookies";
/** Zelfde UA als het werkende livescript (viaplay3.py). Edge/153 + sec-ch-ua gaf Don't go. */ /** Zelfde UA als de werkende losse MPD-speler (Mac Chrome/122). */
export const VIAPLAY_USER_AGENT = export const VIAPLAY_USER_AGENT =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36"; "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36";
export type ViaplayPlayResult = { export type ViaplayPlayResult = {
mediaGuid: string; mediaGuid: string;

View file

@ -384,7 +384,7 @@
var ua = "Mozilla/5.0 (SMART-TV; Linux; Tizen 6.0) AppleWebKit/537.36"; var ua = "Mozilla/5.0 (SMART-TV; Linux; Tizen 6.0) AppleWebKit/537.36";
if (/viaplay/i.test(url)) { if (/viaplay/i.test(url)) {
ua = ua =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36"; "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36";
} }
webapis.avplay.setStreamingProperty("USER_AGENT", ua); webapis.avplay.setStreamingProperty("USER_AGENT", ua);
} catch (e2) {} } catch (e2) {}