Skip to content

Commit

Permalink
fix(YouTube - VideoInformation): Channel name not fetched in YouTube …
Browse files Browse the repository at this point in the history
…19.34.42
  • Loading branch information
anddea committed Dec 17, 2024
1 parent 42b6bd5 commit 2e19453
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
val startIndex = if (fromString == true)
matchOrThrow().stringMatches!!.first().index
else
0
val targetReference = getInstruction<ReferenceInstruction>(
indexOfFirstInstructionOrThrow {
indexOfFirstInstructionOrThrow(startIndex) {
val reference = getReference<MethodReference>()
(opcode == Opcode.INVOKE_INTERFACE_RANGE || opcode == Opcode.INVOKE_INTERFACE) &&
reference?.definingClass == PLAYER_RESPONSE_MODEL_CLASS_DESCRIPTOR &&
Expand Down Expand Up @@ -289,7 +293,7 @@ val videoInformationPatch = bytecodePatch(
channelIdMethodCall =
channelIdFingerprint.getPlayerResponseInstruction("Ljava/lang/String;")
channelNameMethodCall =
channelNameFingerprint.getPlayerResponseInstruction("Ljava/lang/String;")
channelNameFingerprint.getPlayerResponseInstruction("Ljava/lang/String;", true)
videoIdMethodCall = videoIdFingerprint.getPlayerResponseInstruction("Ljava/lang/String;")
videoTitleMethodCall =
videoTitleFingerprint.getPlayerResponseInstruction("Ljava/lang/String;")
Expand Down

0 comments on commit 2e19453

Please sign in to comment.