diff --git a/CHANGELOG.md b/CHANGELOG.md index 56eda70b..b8ece0e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Session data duration: increased to 14 days, to avoid Innertube errors +- Use iOS user agent in player ## [0.40.4] - 2025-06-17 diff --git a/playlet-lib/src/components/Services/Innertube/Constants.bs b/playlet-lib/src/components/Services/Innertube/Constants.bs index 1024f9b5..06dfdcb1 100644 --- a/playlet-lib/src/components/Services/Innertube/Constants.bs +++ b/playlet-lib/src/components/Services/Innertube/Constants.bs @@ -1,5 +1,3 @@ -const VIDEO_PLAYER_USER_AGENT = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0" - const INNERTUBE_IOS_CLIENT_NAME = "5" const INNERTUBE_IOS_CLIENT_VERSION = "20.20.5" const INNERTUBE_IOS_DEVICE_MODEL = "iPhone16,2" diff --git a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs index 569027b4..f1242c37 100644 --- a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs +++ b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs @@ -53,7 +53,8 @@ function Init() end if httpAgent = m.top.getHttpAgent() - httpAgent.AddHeader("User-Agent", VIDEO_PLAYER_USER_AGENT) + ' TODO:P2 user agent should not be hardcoded, it should be part of video metadata + httpAgent.AddHeader("User-Agent", INNERTUBE_IOS_USER_AGENT) #if DEBUG_LOG_VIDEO_QUALITY m.top.addFields({ diff --git a/playlet-lib/src/components/VideoPlayerDev/VideoPlayerDev.bs b/playlet-lib/src/components/VideoPlayerDev/VideoPlayerDev.bs index 9e33256c..bcab6667 100644 --- a/playlet-lib/src/components/VideoPlayerDev/VideoPlayerDev.bs +++ b/playlet-lib/src/components/VideoPlayerDev/VideoPlayerDev.bs @@ -17,7 +17,7 @@ function Init() InitializePlayerUi() httpAgent = m.top.getHttpAgent() - httpAgent.AddHeader("User-Agent", VIDEO_PLAYER_USER_AGENT) + httpAgent.AddHeader("User-Agent", INNERTUBE_IOS_USER_AGENT) end function function OnNodeReady()