def main():
    parser_type = input('What type of content do you want to parse (input several numbers, if you want to parse any combination of the possible content): \n 1 - All (Groups/Channel/Users\n 2 - Channels\n 3 - Groups\n 4 - Users\nYour choise: ')[:2].lower()
    work_mode = input('What type of parsing you want to use:\n 1 - Linear parsing\n 2 - Random parsing \n 3 - Mutation parsing \nYour choise: ')[0].lower()
    turbo_mode = input('Turn on turbo mod(y/n): ')[0].lower()
    output = input('What type of output do you want: \n 1 - All output (not False will be only the content, that was choosed to parse)\n 2 - If something found\n 3 - No output\nYour choise: ')[0].lower()
    (alphabet, alphabet1) = alphabets_generator()
    if (work_mode == '1'):
        try:
            open('last_link').read()
            change_start = input('Do you want to change number of letters in link(y/n): ')[0].lower()
            if (change_start == 'y'):
                start_link()
        except:
            print('Initial setup!')
            start_link()
        linear_letter_link_ids_array = last_link_read_linear_address(alphabet, alphabet1)
    if (work_mode == '3'):
        try:
            os.remove('mutated')
        except:
            pass
        mutated_initial_link = input('Input initial word to mutate (length of the word is greater than 5 letters): ').lower()
        mutated_array = mutation_address_generator(mutated_initial_link)
        total_mutated_rows = len(mutated_array)
        print('Total mutation created: ', total_mutated_rows)
        mutated_word_id = 0
    try:
        print('Parser is started!')
        while True:
            if (work_mode == '1'):
                link = linear_address_generator(alphabet, alphabet1, linear_letter_link_ids_array)
                open('last_link', 'w').write(link)
            elif (work_mode == '2'):
                link = random_address_generator(alphabet, alphabet1)
            elif (work_mode == '3'):
                if (total_mutated_rows > (mutated_word_id + 1)):
                    link = mutated_array[mutated_word_id]
                    mutated_word_id += 1
                else:
                    program_exit(link, work_mode)
            url_get_status = get_link(link, output, parser_type)
            if (url_get_status == 'connection_error'):
                program_exit(link, work_mode)
            if (turbo_mode != 'y'):
                time.sleep(1.5)
            else:
                continue
    except KeyboardInterrupt:
        if (work_mode == '3'):
            print('Mutation checking keyboard interupted')
        program_exit(link, work_mode)
def main():
    parser_type = input('What type of content do you want to parse (input several numbers, if you want to parse any combination of the possible content): \n 1 - All (Groups/Channel/Users\n 2 - Channels\n 3 - Groups\n 4 - Users\nYour choise: ')[:2].lower()
    work_mode = input('What type of parsing you want to use:\n 1 - Linear parsing\n 2 - Random parsing \n 3 - Mutation parsing \nYour choise: ')[0].lower()
    turbo_mode = input('Turn on turbo mod(y/n): ')[0].lower()
    output = input('What type of output do you want: \n 1 - All output (not False will be only the content, that was choosed to parse)\n 2 - If something found\n 3 - No output\nYour choise: ')[0].lower()
    (alphabet, alphabet1) = alphabets_generator()
    if (work_mode == '1'):
        try:
            open('last_link').read()
            change_start = input('Do you want to change number of letters in link(y/n): ')[0].lower()
            if (change_start == 'y'):
                start_link()
        except:
            print('Initial setup!')
            start_link()
        linear_letter_link_ids_array = last_link_read_linear_address(alphabet, alphabet1)
    if (work_mode == '3'):
        try:
            os.remove('mutated')
        except:
            pass
        mutated_initial_link = input('Input initial word to mutate (length of the word is greater than 5 letters): ').lower()
        mutated_array = mutation_address_generator(mutated_initial_link)
        total_mutated_rows = len(mutated_array)
        print('Total mutation created: ', total_mutated_rows)
        mutated_word_id = 0
    try:
        print('Parser is started!')
        while True:
            if (work_mode == '1'):
                link = linear_address_generator(alphabet, alphabet1, linear_letter_link_ids_array)
                open('last_link', 'w').write(link)
            elif (work_mode == '2'):
                link = random_address_generator(alphabet, alphabet1)
            elif (work_mode == '3'):
                if (total_mutated_rows > (mutated_word_id + 1)):
                    link = mutated_array[mutated_word_id]
                    mutated_word_id += 1
                else:
                    program_exit(link, work_mode)
            url_get_status = get_link(link, output, parser_type)
            if (url_get_status == 'connection_error'):
                program_exit(link, work_mode)
            if (turbo_mode != 'y'):
                time.sleep(1.5)
            else:
                continue
    except KeyboardInterrupt:
        if (work_mode == '3'):
            print('Mutation checking keyboard interupted')
        program_exit(link, work_mode)