How to use the filetype.types.append function in filetype

To help you get started, we’ve selected a few filetype examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nicfit / eyeD3 / eyed3 / mimetype.py View on Github external
class M3u(filetype.Type):
    """Implements the m3u playlist matcher."""
    MIME = "audio/x-mpegurl"
    EXTENSION = "m3u"

    def __init__(self):
        super().__init__(mime=self.__class__.MIME, extension=self.__class__.EXTENSION)

    def match(self, buf):
        return len(buf) > 6 and buf.startswith(b"#EXTM3U")


# Not using `add_type()`, to append
filetype.types.append(Mp2x())
filetype.types.append(M3u())
filetype.types.append(Mp3Invalids())
github nicfit / eyeD3 / eyed3 / mimetype.py View on Github external
class M3u(filetype.Type):
    """Implements the m3u playlist matcher."""
    MIME = "audio/x-mpegurl"
    EXTENSION = "m3u"

    def __init__(self):
        super().__init__(mime=self.__class__.MIME, extension=self.__class__.EXTENSION)

    def match(self, buf):
        return len(buf) > 6 and buf.startswith(b"#EXTM3U")


# Not using `add_type()`, to append
filetype.types.append(Mp2x())
filetype.types.append(M3u())
filetype.types.append(Mp3Invalids())
github nicfit / eyeD3 / eyed3 / mimetype.py View on Github external
class M3u(filetype.Type):
    """Implements the m3u playlist matcher."""
    MIME = "audio/x-mpegurl"
    EXTENSION = "m3u"

    def __init__(self):
        super().__init__(mime=self.__class__.MIME, extension=self.__class__.EXTENSION)

    def match(self, buf):
        return len(buf) > 6 and buf.startswith(b"#EXTM3U")


# Not using `add_type()`, to append
filetype.types.append(Mp2x())
filetype.types.append(M3u())
filetype.types.append(Mp3Invalids())