Change user agent
This commit is contained in:
1 parent
b1e64427dd
commit
2fa06604a7
4 files changed
+4
-4
No files matched your search
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Session data duration: increased to 14 days, to avoid Innertube errors
|
- Session data duration: increased to 14 days, to avoid Innertube errors
|
||||||
|
- Use iOS user agent in player
|
||||||
|
|
||||||
## [0.40.4] - 2025-06-17
|
## [0.40.4] - 2025-06-17
|
||||||
|
|
||||||
|
|||||||
@@ -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_NAME = "5"
|
||||||
const INNERTUBE_IOS_CLIENT_VERSION = "20.20.5"
|
const INNERTUBE_IOS_CLIENT_VERSION = "20.20.5"
|
||||||
const INNERTUBE_IOS_DEVICE_MODEL = "iPhone16,2"
|
const INNERTUBE_IOS_DEVICE_MODEL = "iPhone16,2"
|
||||||
|
|||||||
@@ -53,7 +53,8 @@ function Init()
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
httpAgent = m.top.getHttpAgent()
|
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
|
#if DEBUG_LOG_VIDEO_QUALITY
|
||||||
m.top.addFields({
|
m.top.addFields({
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ function Init()
|
|||||||
InitializePlayerUi()
|
InitializePlayerUi()
|
||||||
|
|
||||||
httpAgent = m.top.getHttpAgent()
|
httpAgent = m.top.getHttpAgent()
|
||||||
httpAgent.AddHeader("User-Agent", VIDEO_PLAYER_USER_AGENT)
|
httpAgent.AddHeader("User-Agent", INNERTUBE_IOS_USER_AGENT)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function OnNodeReady()
|
function OnNodeReady()
|
||||||
|
|||||||
Reference in new issue
Block a user