[YouTube] Access first element if array size is one

Fixes a regression, where if the challenge data array size was one, the second element
would be accessed, leading to a crash.
This was introduced when porting the challenge parsing from JS to
Kotlin.

Ref: 10943c587c
This commit is contained in:
FineFindus 2025-04-02 22:14:01 +02:00
parent d55485730c
commit de384b8c24

View file

@ -17,7 +17,7 @@ fun parseChallengeData(rawChallengeData: String): String {
val descrambled = descramble(scrambled.getString(1))
JsonParser.array().from(descrambled)
} else {
scrambled.getArray(1)
scrambled.getArray(0)
}
val messageId = challengeData.getString(0)