- GIT
- (either) Make and Docker
- (or) A local version of python 3.11 with PDM and a Redis server
- Private API credentials
-
Clone the project on your server and, if outside of Docker, run
pdm install
. -
Store your private API credentials in
.secrets/dailymotion_api_credentials.json
with the following format:{ "DAILYMOTION_API_KEY_ID": "<client_id>", "DAILYMOTION_API_KEY_SECRET": "<client_secret>" }
Run make up
on the server.
Note: you need a Redis server. You can start one by launching make up-redis
but it requires Make and Docker.
Launch bin/refresh-access-token-cache.sh
in a seperate terminal, or as a daemon.
Then run bin/start-api.sh
.
From your client browse to
http://<your-server-ip>:8000/stream-urls?video_id=<video_id>&video_formats=<format1<,format2>>
The Stream URLs Server gets the end-user IP address from the HTTP request made by the latter.
It can also read the IP address as an additional query string parameter: &client_ip=<client_ip>
.
HLS stream urls may not work locally due to CORS