The pythonic way to do it:

```py
filetypes = {'opus': 'audio/opus', 'oga': 'audio/ogg', 'mp3': 'audio/mpeg'}
try:
    download_type = filetypes[format]
except KeyError:
    return False