source/io/filter_title.py
def if_title_invalid_symbol_use(title):
    """If the title has an invalid name besides spaces, return True"""
    title_length = len(title)
    if title_length==0: #To prevent out of bounds
        return True

    #Symbols not allowed at all:
    char_blacklist = [ #Characters not possible in a title
        '[',
        ']',
        '<',
        '>',
        '{',
        '}',
        '#', #Could possibly just ignore text after this
    ]
    for elem in title:
        if elem in char_blacklist:
            return True #If any symbol is bad it's all invalid.

    #Symbols not allowed as first character:
    first_char_blacklist = [
        ':',
    ]
    for symbol in first_char_blacklist:
        if symbol==title[0]:
            return True

    #Symbols not allowed as last character:
    last_char_blacklist = [
        ';',
    ]
    for symbol in last_char_blacklist:
        if symbol==title[title_length-1]:
            return True

    #Check for encoded hex:
    if bool(re.search('&#([0-9]{1,5}|x[0-9a-fA-F]{1,4});', title)):
        return True

    #3 or more consecutive tildes not allowed
    if title.find("~~~")!=-1:
        return True

    return False
If the title has an invalid name besides spaces, return True
If the title has an invalid name besides spaces, return True
If the title has an invalid name besides spaces return True
def if_title_invalid_symbol_use(title):
    title_length = len(title)
    if title_length==0: 
        return True
    char_blacklist = [ 
        '[',
        ']',
        '<',
        '>',
        '{',
        '}',
        '#', 
    ]
    for elem in title:
        if elem in char_blacklist:
            return True 
    first_char_blacklist = [
        ':',
    ]
    for symbol in first_char_blacklist:
        if symbol==title[0]:
            return True
    last_char_blacklist = [
        ';',
    ]
    for symbol in last_char_blacklist:
        if symbol==title[title_length-1]:
            return True
    if bool(re.search('&#([0-9]{1,5}|x[0-9a-fA-F]{1,4});', title)):
        return True
    if title.find("~~~")!=-1:
        return True
    return False
def if_title_invalid_symbol_use ( title ) : title_length = len ( title ) if title_length == 0 : return True char_blacklist = [ '[' , ']' , '<' , '>' , '{' , '}' , '#' , ] for elem in title : if elem in char_blacklist : return True first_char_blacklist = [ ':' , ] for symbol in first_char_blacklist : if symbol == title [ 0 ] : return True last_char_blacklist = [ ';' , ] for symbol in last_char_blacklist : if symbol == title [ title_length - 1 ] : return True if bool ( re . search ( '&#([0-9]{1,5}|x[0-9a-fA-F]{1,4});' , title ) ) : return True if title . find ( "~~~" ) != - 1 : return True return False
If the title has an invalid name besides spaces, return True
If the title has an invalid name besides spaces return True
"""If the title has an invalid name besides spaces, return True""" #To prevent out of bounds #Symbols not allowed at all: #Characters not possible in a title #Could possibly just ignore text after this #If any symbol is bad it's all invalid. #Symbols not allowed as first character: #Symbols not allowed as last character: #Check for encoded hex: #3 or more consecutive tildes not allowed
title