Exemplo n.º 1
0
def popular_list():
    ids_popular = []
    popular_titles = movie.popular()
    for p in popular_titles:
        id_popular = omdb_parse.title_search(p.title)[0]
        ids_popular.append(id_popular)
    return ids_popular
def handle_text_messages(message):
    if message.text == '⬅️':
        my_list.set_to_prev_elem(message)
    if message.text == '➡️':
        my_list.set_to_next_elem(message)
    if message.text == 'Further info':
        my_list.send_info_2(message)
    if message.text == 'Back to main info':
        my_list.send_info_1(message, 'existing')

    if '/movie_title' in message.text:
        query = message.text[13:]
        id_list = omdb_parse.title_search(query)
        my_list.set_list(id_list)
        my_list.start_to_show(message)

    if '/movie_title_year' in message.text:
        query = message.text[17:]
        id_list = omdb_parse.title_year_search(query, query)
        my_list.set_list(id_list)
        my_list.start_to_show(message)

    if 'popular_now' in message.text:
        id_list_popular = tmdb_reccomendator.popular_list()
        #print(id_list_popular)
        my_list.set_list(id_list_popular)
        my_list.start_to_show(message)
Exemplo n.º 3
0
def top_war_list():
    ids = []
    mov = discover.discover_movies({
        'sort_by': 'popularity.desc',
        'genre_ids': [10752]
    })
    for i in mov:
        id = omdb_parse.title_search(mov.title)[0]
        ids.append(id)
    return ids
Exemplo n.º 4
0
def top_scifi_list():
    ids = []
    mov = discover.discover_movies({
        'sort_by': 'popularity.desc',
        'genre_ids': [878]
    })
    for i in mov:
        id = omdb_parse.title_search(str(i))
        ids.append(id)
    return ids
Exemplo n.º 5
0
def top_family_list():
    ids = []
    mov = discover.discover_movies({
        'sort_by': 'popularity.desc',
        'genre_ids': [10751]
    })
    for i in range(20):
        id = omdb_parse.title_search(mov[i])
        ids.append(id)
    print(ids)
    return ids
def movie_title_search(message):
    query = message.text[13:]
    id_list = omdb_parse.title_search(query)
    my_list.set_list(id_list)
    my_list.start_to_show(message)