Refac remove comment from json

This commit is contained in:
MerlinScheurer 2024-05-13 14:55:48 +02:00
parent 78eff229ea
commit 256ee8c768

View File

@ -1,8 +1,10 @@
# Additional API endpoints
## Login
Return token and user ID for username and password:
**POST** `/api/login/`
```json
{
"username": "tubearchivist",
@ -11,6 +13,7 @@ Return token and user ID for username and password:
```
after successful login returns
```json
{
"token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
@ -19,14 +22,16 @@ after successful login returns
```
## Refresh
**GET** `/api/refresh/`
Parameters:
- **type**: one of *video*, *channel*, *playlist*, optional
- **type**: one of _video_, _channel_, _playlist_, optional
- **id**: item id, optional
without specifying type: return total for all queued items:
```json
{
"total_queued": 2,
@ -36,6 +41,7 @@ without specifying type: return total for all queued items:
```
specify type: return total items queue of this type:
```json
{
"total_queued": 2,
@ -44,7 +50,8 @@ specify type: return total items queue of this type:
}
```
specify type *and* id to get state of item in queue:
specify type _and_ id to get state of item in queue:
```json
{
"total_queued": 2,
@ -60,7 +67,8 @@ Parameter:
- extract_videos: to refresh all videos for channels/playlists, default False
Manually start a refresh task: post list of *video*, *channel*, *playlist* IDs:
Manually start a refresh task: post list of _video_, _channel_, _playlist_ IDs:
```json
{
"video": ["video1", "video2", "video3"],
@ -70,8 +78,10 @@ Manually start a refresh task: post list of *video*, *channel*, *playlist* IDs:
```
## Cookie
Check your youtube cookie settings, *status* turns to `true` if cookie has been validated.
Check your youtube cookie settings, _status_ turns to `true` if cookie has been validated.
**GET** `/api/cookie/`
```json
{
"cookie_enabled": true,
@ -83,6 +93,7 @@ Check your youtube cookie settings, *status* turns to `true` if cookie has been
**POST** `/api/cookie/`
Send empty post request to validate cookie.
```json
{
"cookie_validated": true
@ -91,19 +102,24 @@ Send empty post request to validate cookie.
**PUT** `/api/cookie/`
Send put request containing the cookie as a string:
```json
{
"cookie": "your-cookie-as-string"
}
```
Imports and validates cookie, returns on success:
```json
{
"cookie_import": "done",
"cookie_validated": true
}
```
Or returns status code 400 on failure:
```json
{
"cookie_import": "fail",
@ -112,11 +128,13 @@ Or returns status code 400 on failure:
```
## Search
**GET** `/api/search/?query=<query>`
Returns search results from your query.
## Watched
**POST** `/api/watched/`
Change watched state, where the `id` can be a single video, or channel/playlist to change all videos belonging to that channel/playlist.
@ -129,10 +147,12 @@ Change watched state, where the `id` can be a single video, or channel/playlist
```
## Ping
Validate your connection and authentication with the API
**GET** `/api/ping/`
When valid returns message with user id and TubeArchivist version:
```json
{
"response": "pong",
@ -142,6 +162,7 @@ When valid returns message with user id and TubeArchivist version:
```
## Notification List
Get all current notifications.
**GET** `/api/notification/`
@ -158,10 +179,11 @@ Parameter:
"api-stop": true,
"level": "info",
"id": "1111111-1111-1111-1111-1111111",
"command": false, // false || "STOP" || "KILL"
"command": false,
"messages": ["Task completed successfully"],
"progress": 0.000001
}
]
```
"command" can be false || "STOP" || "KILL".