#!/usr/bin/env pypy3

"""
cuei, command line SCTE35 decoder.

( type 'make cli' or 'make pypy3-cli' as root
to install to /usr/local/bin )

use like:

    cat myvideo.ts | cuei

    cuei https://futzu.com/xaa.ts

    cuei myvideo.ts yourvideo.ts someothervideo.ts

    cuei mpegts_dir/*.ts

    cuei '/DBZAAAAAAAA///wBQb+AAAAAABDAkFDVUVJAAAACn//AAApMuAPLXVybjp1dWlkOmFhODViYmI2LTVjNDMtNGI2YS1iZWJiLWVlM2IxM2ViNzk5ORAAAFz7UQA='
"""


import sys
import threefive

if __name__ == "__main__":
    if len(sys.argv) > 1:
        for arg in sys.argv[1:]:
            threefive.decode(arg)

    else:
        threefive.decode(sys.stdin.buffer)
