Updated Authentication methods (markdown)
@@ -54,3 +54,33 @@ Provide your `config.yml` to yt-dlp-webui:
|
|||||||
# or with docker
|
# or with docker
|
||||||
docker exec --rm -d -p 3033:3033 -v <your_config_directory>:/conf ghcr.io/marcopeocchi/yt-dlp-web-ui:latest
|
docker exec --rm -d -p 3033:3033 -v <your_config_directory>:/conf ghcr.io/marcopeocchi/yt-dlp-web-ui:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## API Authentication
|
||||||
|
|
||||||
|
About the API authentication: there's three methods to provide the token:
|
||||||
|
- cookies: cookie named `jwt-yt-dlp-webui`
|
||||||
|
- query params: `?token=yourjwttoken`
|
||||||
|
- headers: `X-Authentication` header
|
||||||
|
|
||||||
|
### How to obtain the token
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -H "Content-Type: application/json" \
|
||||||
|
-X POST \
|
||||||
|
-d '{"username":"ciao","password":"ciaociao"}' \
|
||||||
|
http://localhost:3033/auth/login
|
||||||
|
```
|
||||||
|
where `http://localhost:3033` will be replaced with your ip/hostname.
|
||||||
|
|
||||||
|
The JWT token will be returned in the response.
|
||||||
|
|
||||||
|
### Execute requests with token
|
||||||
|
|
||||||
|
As described before, with token or query params.
|
||||||
|
Here's an example using query params:
|
||||||
|
```
|
||||||
|
curl -H "Content-Type: application/json" \
|
||||||
|
-X POST \
|
||||||
|
-d '{"url": "http://some.video/1"}' \
|
||||||
|
http://localhost:3033/api/v1/exec?token=eyJhbGciOiJIUzI1NiIsInR5cC...
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user