From: Philipp Spitzer Date: Wed, 1 Jul 2020 17:31:09 +0000 (+0200) Subject: Add script to decode JSON SDP. X-Git-Url: https://git.toastfreeware.priv.at/toast/stream2beamer.git/commitdiff_plain/5bf7e37df934e30eb11610b8ebcf10c77c6b05af Add script to decode JSON SDP. --- diff --git a/decode-json.py b/decode-json.py new file mode 100755 index 0000000..e5ad717 --- /dev/null +++ b/decode-json.py @@ -0,0 +1,25 @@ +#!/usr/bin/python3 + +import argparse +import json + + +def decode_json_files(json_files): + for json_file in json_files: + print(json_file) + with open(json_file) as fp: + parsed_json = json.load(fp) + sdp = parsed_json['sdp'] + print(sdp) + print() + + +def main(): + parser = argparse.ArgumentParser(description='Decode SDP JSON') + parser.add_argument('json', nargs='+', help='JSON file') + args = parser.parse_args() + decode_json_files(args.json) + + +if __name__=='__main__': + main()