I'm working on an application that needs to scan files from 3rd parties and process them. Sometimes these are compressed, so I've created a function that checks the file extension (tar.gz, gz, zip) and uncompresses accordingly. Some of the .zip files return this error: NotImplementedError: compression type 12 (bzip2).
Is there a better way for me to identify the the compression type other than the file extension?