update api docs

This commit is contained in:
wukko 2023-09-23 12:07:24 +06:00
parent 4448ebe1e3
commit bfc453fdc4

View file

@ -14,73 +14,59 @@ Request Body Type: ``application/json``<br>
Response Body Type: ``application/json`` Response Body Type: ``application/json``
### Request Body Variables ### Request Body Variables
| key | type | variables | default | description | | key | type | variables | default | description |
|:--------------------|:--------|:----------------------------------|:----------|:-------------------------------------------------------------------------------| |:--------------------|:------------|:----------------------------------|:----------|:-------------------------------------------------------------------------------|
| ``url`` | string | Sharable URL encoded as URI | ``null`` | **Must** be included in every request. | | ``url`` | ``string`` | Sharable URL encoded as URI | ``null`` | **Must** be included in every request. |
| ``vCodec`` | string | ``h264 / av1 / vp9`` | ``h264`` | Applies only to YouTube downloads. ``h264`` is recommended for phones. | | ``vCodec`` | ``string`` | ``h264 / av1 / vp9`` | ``h264`` | Applies only to YouTube downloads. ``h264`` is recommended for phones. |
| ``vQuality`` | string | ``144 / ... / 2160 / max`` | ``720`` | ``720`` quality is recommended for phones. | | ``vQuality`` | ``string`` | ``144 / ... / 2160 / max`` | ``720`` | ``720`` quality is recommended for phones. |
| ``aFormat`` | string | ``best / mp3 / ogg / wav / opus`` | ``mp3`` | | | ``aFormat`` | ``string`` | ``best / mp3 / ogg / wav / opus`` | ``mp3`` | |
| ``isAudioOnly`` | boolean | ``true / false`` | ``false`` | | | ``isAudioOnly`` | ``boolean`` | ``true / false`` | ``false`` | |
| ``isNoTTWatermark`` | boolean | ``true / false`` | ``false`` | Changes whether downloaded TikTok videos have watermarks. | | ``isNoTTWatermark`` | ``boolean`` | ``true / false`` | ``false`` | Changes whether downloaded TikTok videos have watermarks. |
| ``isTTFullAudio`` | boolean | ``true / false`` | ``false`` | Enables download of original sound used in a TikTok video. | | ``isTTFullAudio`` | ``boolean`` | ``true / false`` | ``false`` | Enables download of original sound used in a TikTok video. |
| ``isAudioMuted`` | boolean | ``true / false`` | ``false`` | Disables audio track in video downloads. | | ``isAudioMuted`` | ``boolean`` | ``true / false`` | ``false`` | Disables audio track in video downloads. |
| ``dubLang`` | boolean | ``true / false`` | ``false`` | Backend uses Accept-Language for YouTube video audio tracks when ``true``. | | ``dubLang`` | ``boolean`` | ``true / false`` | ``false`` | Backend uses Accept-Language for YouTube video audio tracks when ``true``. |
| ``disableMetadata`` | boolean | ``true / false`` | ``false`` | Disables file metadata when set to ``true``. | | ``disableMetadata`` | ``boolean`` | ``true / false`` | ``false`` | Disables file metadata when set to ``true``. |
### Response Body Variables ### Response Body Variables
| key | type | variables | | key | type | variables |
|:-----------|:-------|:--------------------------------------------------------------| |:---------------|:-----------|:--------------------------------------------------------------|
| status | string | ``error / redirect / stream / success / rate-limit / picker`` | | ``status`` | ``string`` | ``error / redirect / stream / success / rate-limit / picker`` |
| text | string | Text | | ``text`` | ``string`` | Text |
| url | string | Direct link to a file / link to cobalt's stream | | ``url`` | ``string`` | Direct link to a file / link to cobalt's live render |
| pickerType | string | ``various / images`` | | ``pickerType`` | ``string`` | ``various / images`` |
| picker | array | Array of picker items | | ``picker`` | ``array`` | Array of picker items |
| audio | string | Direct link to a file / link to cobalt's stream | | ``audio`` | ``string`` | Direct link to a file / link to cobalt's live render |
### Picker Item Variables ### Picker Item Variables
Item type: ``object`` Item type: ``object``
| key | type | variables | description | | key | type | variables | description |
|:-----------|:-------|:------------------------------------------------|:--------------------------------------------| |:---------------|:-----------|:------------------------------------------------|:--------------------------------------------|
| type | string | ``video`` | Used only if ``pickerType`` is ``various``. | | ``type`` | ``string`` | ``video`` | Used only if ``pickerType`` is ``various``. |
| url | string | Direct link to a file / link to cobalt's stream | | | ``url`` | ``string`` | Direct link to a file / link to cobalt's live render | |
| thumb | string | Item thumbnail that's displayed in the picker | Used only for ``video`` type. | | ``thumb`` | ``string`` | Item thumbnail that's displayed in the picker | Used only for ``video`` type. |
## GET: ``/api/stream`` ## GET: ``/api/stream``
Content live render streaming endpoint.<br> Content live render streaming endpoint.<br>
### Request Query Variables ### Request Query Variables
| key | variables | description | | key | variables | description |
|:----|:-----------------|:-------------------------------------------------------------------------------------------------------------------------------| |:--------|:-----------------|:-------------------------------------------------------------------------------------------------------------------------------|
| p | ``1`` | Used for probing the rate limit. | | ``p`` | ``1`` | Used for probing whether user is rate limited. |
| t | Stream token | Unique stream ID. Used for retrieving cached stream info data. | | ``t`` | Stream token | Unique stream ID. Used for retrieving cached stream info data. |
| h | HMAC | Hashed combination of: (hashed) ip address, stream token, expiry timestamp, and service name. Used for verification of stream. | | ``h`` | HMAC | Hashed combination of: (hashed) ip address, stream token, expiry timestamp, and service name. Used for verification of stream. |
| e | Expiry timestamp | | | ``e`` | Expiry timestamp | |
## GET: ``/api/onDemand``
On-demand website element loading. Currently used only for older changelogs.<br>
### Request Query Variables
| key | variables | description |
|:--------|:----------|:---------------------------------------|
| blockId | ``0`` | Block ID to be rendered on the server. |
### Response Body Variables
| key | type | variables |
|:-------|:-------|:-----------------------------|
| status | string | ``error / success`` |
| text | string | Error text or rendered block |
## GET: ``/api/serverInfo`` ## GET: ``/api/serverInfo``
Returns current basic server info.<br> Returns current basic server info.<br>
Response Body Type: ``application/json`` Response Body Type: ``application/json``
### Response Body Variables ### Response Body Variables
| key | type | variables | | key | type | variables |
|:----------|:-------|:------------------| |:--------------|:-----------|:------------------|
| version | string | cobalt version | | ``version`` | ``string`` | cobalt version |
| commit | string | Git commit | | ``commit`` | ``string`` | Git commit |
| branch | string | Git branch | | ``branch`` | ``string`` | Git branch |
| name | string | Server name | | ``name`` | ``string`` | Server name |
| url | string | Server url | | ``url`` | ``string`` | Server url |
| cors | string | CORS status | | ``cors`` | ``int`` | CORS status |
| startTime | string | Server start time | | ``startTime`` | ``string`` | Server start time |