import tmdbsimple as tmdb

from .mongo_service import MongoService

image_url = 'https://image.tmdb.org/t/p/w600_and_h900_bestv2/'



class MovieService:
    client:MongoService

    def __init__(self):
        print("init")
        tmdb.API_KEY = 'c1410b19f84dbd5744de920c15544316'
        self.client = MongoService()



    def get_film_by_name(self, name):
        search = tmdb.Search()
        response = search.movie(query=name)


        for s in search.results:
            self.client.saveFilm(s)

