fix(YouTube/VideoInformation): Channel name not fetched in YouTube 19.34.42

This commit is contained in:
inotia00
2024-12-15 14:16:07 +09:00
parent 04b137ddd2
commit 9a962e441e

View File

@ -187,10 +187,14 @@ val videoInformationPatch = bytecodePatch(
} }
} }
fun Pair<String, Fingerprint>.getPlayerResponseInstruction(returnType: String): String { fun Pair<String, Fingerprint>.getPlayerResponseInstruction(returnType: String, fromString: Boolean? = null): String {
methodOrThrow().apply { methodOrThrow().apply {
val startIndex = if (fromString == true)
matchOrThrow().stringMatches!!.first().index
else
0
val targetReference = getInstruction<ReferenceInstruction>( val targetReference = getInstruction<ReferenceInstruction>(
indexOfFirstInstructionOrThrow { indexOfFirstInstructionOrThrow(startIndex) {
val reference = getReference<MethodReference>() val reference = getReference<MethodReference>()
(opcode == Opcode.INVOKE_INTERFACE_RANGE || opcode == Opcode.INVOKE_INTERFACE) && (opcode == Opcode.INVOKE_INTERFACE_RANGE || opcode == Opcode.INVOKE_INTERFACE) &&
reference?.definingClass == PLAYER_RESPONSE_MODEL_CLASS_DESCRIPTOR && reference?.definingClass == PLAYER_RESPONSE_MODEL_CLASS_DESCRIPTOR &&
@ -289,7 +293,7 @@ val videoInformationPatch = bytecodePatch(
channelIdMethodCall = channelIdMethodCall =
channelIdFingerprint.getPlayerResponseInstruction("Ljava/lang/String;") channelIdFingerprint.getPlayerResponseInstruction("Ljava/lang/String;")
channelNameMethodCall = channelNameMethodCall =
channelNameFingerprint.getPlayerResponseInstruction("Ljava/lang/String;") channelNameFingerprint.getPlayerResponseInstruction("Ljava/lang/String;", true)
videoIdMethodCall = videoIdFingerprint.getPlayerResponseInstruction("Ljava/lang/String;") videoIdMethodCall = videoIdFingerprint.getPlayerResponseInstruction("Ljava/lang/String;")
videoTitleMethodCall = videoTitleMethodCall =
videoTitleFingerprint.getPlayerResponseInstruction("Ljava/lang/String;") videoTitleFingerprint.getPlayerResponseInstruction("Ljava/lang/String;")