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