This project is a simple REST API for retrieving video information and download links. It serves as an educational representation of the proxy pattern in Golang.
- Go 1.21 or later
Create a .env file in the root directory of the project with the following content:
API_KEY=<your_api_key>
APP_PORT=<port_number>
Replace <your_api_key> with your actual API key and <port_number> with the port number you want to run the server on.
- Clone the repository:
git clone https://github.com/yourusername/yourrepository.git
- Navigate to the project directory:
cd yourrepository
- Install the required dependencies:
go mod tidy
- Load the environment variables:
source .env
- Start the server:
go run cmd/main.go
The server will start listening on the port specified in the .env file.
The following diagram depicts the infrastructure of the application:
- /meta-info?url=<video_url>: Returns the meta information of the video specified by <video_url>.
- /download-links?url=<video_url>: Returns the download links of the video specified by <video_url>. Replace <video_url> with the actual URL of the video you want to query.