mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-19 14:09:09 +03:00
Added new endpoints
38
API-Docs.md
38
API-Docs.md
@@ -10,21 +10,25 @@ If you're downloading the Database with any regularity, use this mirror to save
|
|||||||
The API and database follow [this license](https://creativecommons.org/licenses/by-nc-sa/4.0/) unless you have explicit permission.
|
The API and database follow [this license](https://creativecommons.org/licenses/by-nc-sa/4.0/) unless you have explicit permission.
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
|
|
||||||
**GET** `/api/getVideoSponsorTimes`
|
**GET** `/api/skipSegments`
|
||||||
|
|
||||||
**Input**:
|
**Input**:
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
videoID: string
|
videoID: string,
|
||||||
|
category: string // Optional, defaults to "sponsor". See [the category list](https://github.com/ajayyy/SponsorBlock/blob/master/config.json.example)
|
||||||
|
|
||||||
|
categories: JSON.stringify(string[]) // Use instead of "category" if you want multiple categories. Will look like [%22sponsor%22,%22intro%2]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**Response**:
|
**Response**:
|
||||||
```
|
```
|
||||||
{
|
[{ // Array of this object
|
||||||
sponsorTimes: array [float],
|
segments: float[], //[0, 15.23] start and end time in seconds
|
||||||
UUIDs: array [string] //The ID for this sponsor time, used to submit votes
|
UUID: string,
|
||||||
}
|
category: string
|
||||||
|
}]
|
||||||
```
|
```
|
||||||
|
|
||||||
**Error codes**:
|
**Error codes**:
|
||||||
@@ -33,9 +37,9 @@ ________________________________________________________________________________
|
|||||||
|
|
||||||
__________________________________________________________________
|
__________________________________________________________________
|
||||||
|
|
||||||
**GET** `/api/postVideoSponsorTimes`
|
**POST** `/api/skipSegments`
|
||||||
|
|
||||||
**Input**:
|
**Input Option 1 (URL Parameters)**:
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
videoID: string,
|
videoID: string,
|
||||||
@@ -45,6 +49,18 @@ __________________________________________________________________
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Input Option 2 (JSON Body)**:
|
||||||
|
```
|
||||||
|
{
|
||||||
|
videoID: string,
|
||||||
|
userID: string, // This should be a randomly generated UUID stored locally (not the public one)
|
||||||
|
segments: [{ // Array of this object
|
||||||
|
segment: float[], //[0, 15.23] start and end time in seconds
|
||||||
|
category: string
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
**Response**:
|
**Response**:
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
@@ -56,6 +72,8 @@ __________________________________________________________________
|
|||||||
|
|
||||||
400: Bad Request (Your inputs are wrong/impossible)
|
400: Bad Request (Your inputs are wrong/impossible)
|
||||||
|
|
||||||
|
403: Rejected by auto moderator (Reason will be sent in the response)
|
||||||
|
|
||||||
429: Rate Limit (Too many for the same user or IP)
|
429: Rate Limit (Too many for the same user or IP)
|
||||||
|
|
||||||
409: Duplicate
|
409: Duplicate
|
||||||
@@ -330,6 +348,10 @@ VIPs have extra privileges and their votes count more.
|
|||||||
403: Unauthorized (You are not an admin)
|
403: Unauthorized (You are not an admin)
|
||||||
|
|
||||||
|
|
||||||
|
### Legacy API
|
||||||
|
|
||||||
|
https://github.com/ajayyy/SponsorBlock/wiki/Legacy-API
|
||||||
|
|
||||||
### Local userID vs Public userID
|
### Local userID vs Public userID
|
||||||
|
|
||||||
The local userID should be a randomly generated and saved client side. It is used to submit and vote. The public userID is what is used as an identifier in the database. This is the local userID with a SHA 256 hash 5000 times.
|
The local userID should be a randomly generated and saved client side. It is used to submit and vote. The public userID is what is used as an identifier in the database. This is the local userID with a SHA 256 hash 5000 times.
|
||||||
Reference in New Issue
Block a user