Example #1
0
 def getDetails(self, movieId, append = None):
     apiArgs = {'api_key' : self.api_key, 'append_to_response' : append}
     query = API_URL + self.api_media + movieId + "?" + urlencode(apiArgs)
     apiRequest = Request(query, headers=HEADERS)
     result = urlopen(apiRequest).read()
     data = json.loads(result)
     
     genres = self.getGenres(data)
     cast = self.getCast(data)
     
     tempMovie = Movie()
     tempMovie.setId(movieId)
     tempMovie.setTitle(data[self.title])
     tempMovie.setReleaseDate(data[self.date])
     tempMovie.setGenre(genres)
     tempMovie.setCast(cast)
     tempMovie.setPosterPath(data['poster_path'])
     
     return tempMovie