def guess_mime_type(url):
(mimetype, _mimeencoding) = mimetypes.guess_type(url)<EOL>if not mimetype:<EOL><INDENT>ext = os.path.splitext(url)[<NUM_LIT:1>]<EOL>mimetype = _MIME_TYPES.get(ext)<EOL>_logger.debug("<STR_LIT>".format(url, mimetype))<EOL><DEDENT>if not mimetype:<EOL><INDENT>mimetype = "<STR_LIT>"<EOL><DEDENT>return mimetype<EOL>
Use the mimetypes module to lookup the type for an extension.

    This function also adds some extensions required for HTML5