I keep encountering the same error when attempting to automate video publishing on PeerTube using Python. Can anyone help me troubleshoot this

I don’t know Python, but i think it is because you don’t attach a MIME type to your videofile field.

See here, for a similar issue in NodeJS: Best way to upload 30k videos? - #24 par GregRc

This seems to be done in the script mentionned by Chocobozzz, using this function:

    def get_file(path):
        mimetypes.init()
        return (basename(path), open(abspath(path), 'rb'),
                mimetypes.types_map[splitext(path)[1]])