This is a web application that returns square posters for movies and tv shows. It uses the TMDB API and gets the top part of the poster to a size of 512x512 including a 6-pixels wide border.
The search is based on the name or an id (only IMDB and TMDB currently, for TMDB media type has to be set). If both are given, the id will be checked first and then the name if none was found. An aditional media type
parameter can be passed to filter between movies and tv.
Used mainly with this Kodi addon to give Discord an endpoint for its rich presence feature.
Path | /?name=godfather |
/?name=avatar |
/?name=avatar&type=tv |
/?id=tt0944947 |
---|---|---|---|---|
Result |
Go 1.17 or newer is needed
A TMDB API key is needed in the TMDB_APIKEY
environment variable.
An optional PORT
environment variable can be supplied. Defaults to 8080
The program can be executed with
go run .
# OR
go build .
./square-posters
This repository supports deployment to Heroku and AWS Lambda
The repository can be simply linked to a Heroku application.
For AWS Lambda execute one of the build-aws.sh
or build-aws.ps1
depending on your platform. Then uploaded the resuling main.zip
file to a lambda function.