@staticmethod
def _get_checksum(checksum, expected='md5'):
    """Return the checksum if the type is the expected."""
    checksum = checksum.split(':')
    if checksum[0] != expected or len(checksum) != 2:
        raise AttributeError('Checksum format is not correct.')
    else:
        return checksum[1]
