I see two problems with your code, the first is using r.text
to return binary data. Use r.content
instead. The second problem is using decoder.decode
method, which decodes one object and not a packet. Use decoder.decode_packet
instead.
from amfast.decoder import Decoder
decoder = Decoder(amf3=True)
obj = decoder.decode_packet(r.content)
Using Pyamf works as well, using r.content
.