magic-wormhole/bin/receive_text.py
2015-02-11 01:04:37 -08:00

13 lines
271 B
Python

import sys, json
from .transcribe import Receiver
APPID = "lothar.com/wormhole/text-xfer"
# we're receiving
code = sys.argv[1]
blob = b""
r = Receiver(APPID, blob, code)
them_bytes = r.get_data()
them_d = json.loads(them_bytes.decode("utf-8"))
print(them_d["message"])