AnthonyBloomer / tmdbv3api

A lightweight Python library for The Movie Database (TMDb) API. The TMDb API is a resource for developers to integrate movie, TV show and cast data along with posters or movie fan art.
http://anthonybloomer.github.io/tmdbv3api/.
220 stars 51 forks source link

Why sometimes I have the title and sometimes no #98

Closed Impre-visible closed 2 years ago

Impre-visible commented 2 years ago

Why on certains movie i have the title and the cover, and on other i have nothing ? image

Impre-visible commented 2 years ago

there is the code


def home():
    print(type(movie))
    vu = "\\\\Freebox_Server\\disque dur\\Vidéos\\Vu"
    films = os.listdir(vu)
    print(films)

    for film in films:  
        search = movie.search(film)
        file_title = film.title()
        original_file_title = file_title
        size = len(file_title)
        file_title = file_title[:size - 4]
        for res in search:
            movie_title = (res.title)
            movie_cover_path = (res.poster_path)
            cover_full_path = (f"https://image.tmdb.org/t/p/original/{movie_cover_path}")
            print("Titre : "+movie_title)
            print("Cover :", cover_full_path)
        print(file_title)
        print('\\\\Freebox_Server\\disque dur\\Vidéos\\Vu\\'+ original_file_title)
        print("---------------------------------")

    return render_template('index.html', films=films, titre=movie_title, cover=cover_full_path)```