Support base64-encoded nested messages #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is not part of the spec, but youtube loves to pass base64 encoded
messages in string fields of other messages. So when a string is
encountered, attempt decoding and recursing into it.
Hope that's understandable, I'm not too familiar with protobuf's terminology. In essence, I'm doing some reversing of youtube's internal
browse_ajax
API, which is littered with this idiosyncrasy. So to decode such a message, I currently have to pass the protobuf-message to your tool, copy-paste the base64-encoded submessage, decode it, and pass it through again (often multiple times).Here's how such a message is displayed currently:
and now with my patch applied:
both times invoked with
echo '4qmFsgJSEhhVQ1Y1dkNpM2pQSmRVUlp3QU9PX0ZOZlEaNkVnWjJhV1JsYjNNWUF5QUFNQUU0QWVvREUwTm5RVk5EWjJsVmFXOWZRVzVoTWtJdFZ6USUzRA=='|base64 -d|./main.py