This repository provides a proxy API server for The Movie Database (TMDb). Due to IP bans from ISPs in India, TMDb's API services may be inaccessible to Indian users. This proxy server allows you to access TMDb data seamlessly.
GET /v1/tmdb/v1/tmdb maps to =====> https://api.themoviedb.org/
| Header | Description |
|---|---|
X-WPROXY-KEY string |
Required. All requests made via proxy must contain a X-WPROXY-KEY |
X-WPROXY-KEYcan be configured in.envfile.
Go: Make sure you have Go installed. You can download it from golang.org.
Clone the project
git clone https://github.com/thewolmer/tmdb-proxy-api-serverGo to the project directory
cd tmdb-proxy-api-serverInstall dependencies
go mod tidyCreate a .env file and put WPROXY-KEY in it
echo 'X-WPROXY-KEY=secret_key' > .envRun the server
go run cmd/main.goNote: Running this proxy API server locally might not work if you're in India, as your IP address could still be subject to the same restrictions imposed on TMDb. For optimal results, deploy this server to a cloud provider or hosting service outside of India. This will help ensure that your requests are routed through an IP address that is not affected by the IP ban.
To add additional routes for TMDb, add a function in the controllers/proxy.go file:
func ExampleProxy(c *gin.Context) {
proxy := utils.CreateReverseProxy("https://api.example.com", "/v1/example")
proxy.ServeHTTP(c.Writer, c.Request)
}next, modify the main() function in cmd/main.go to add our controller
func main() {
// Previous Code
...
// Add proxy route
r.Any("/v1/example/*proxyPath", controllers.ExampleProxy)
...
// Previous Code
}This will add new route /v1/example mapped to api/example.com
Deploy this server for free on Render
-
Create an account on Render
-
Add a new Web Service
-
Choose your repo from the list
-
Add build command
go build -tags netgo -ldflags '-s -w' -o bin/main ./cmd
- Add run command
./bin/main- Add environment variables
- Deploy 🚀
Client: //
Server: Go, Gin
- Retelimits
Feel free to contribute to this project by opening issues, submitting pull requests, or providing feedback.
Here are some related links
