This script operates on a packet dump between a vanilla client and server.
A dump like this can be obtained in various ways - a proxy, my frida tracer, etc.
However you get it, the file provided should have one packet per line, starting with read:
or write:
and ending with a base64-encoded packet (including the packet ID).
A quick example grabbed from one of my old log files:
read:kAHwoMpB4PUgQQAAAD8g17NAAAAAPwAAAAAAAAAA4PUgQQABAg==
write:CQ==
write:CQIBG8KnZSVtdWx0aXBsYXllci5wbGF5ZXIubGVmdAELbWN0ZXN0RHlsYW4AAA==