Changes by blabdude - - added 400 to /api/skipSegments - added lockCategories (GET has prefix in param but up to you if you want to keep it)

Ajay Ramachandran
2021-07-05 13:44:24 -04:00
parent 95fd51c23a
commit 8e250d65de

@@ -47,6 +47,7 @@ ________________________________________________________________________________
**Error codes**: **Error codes**:
400: Bad Request (Your inputs are wrong/impossible)
404: Not Found 404: Not Found
__________________________________________________________________ __________________________________________________________________
@@ -84,6 +85,7 @@ __________________________________________________________________
**Error codes**: **Error codes**:
400: Bad Request (Your inputs are wrong/impossible)
404: Not Found 404: Not Found
__________________________________________________________________ __________________________________________________________________
@@ -461,6 +463,57 @@ __________________________________________________________________
400: Bad Request (Your inputs are wrong/impossible) or exceed the character limits 400: Bad Request (Your inputs are wrong/impossible) or exceed the character limits
404: Not Found
________________________________________________________________________________
##### **GET** `/api/lockCategories`
**Input** (URL Parameters):
```js
{
videoID: string
}
```
**Response**:
```js
{
"categories": string[]
// See https://github.com/ajayyy/SponsorBlock/wiki/Types#category
}
```
**Error codes**:
400: Bad Request (Your inputs are wrong/impossible)
404: Not Found
__________________________________________________________________
##### **GET** `/api/lockCategories/:sha256HashPrefix`
`sha256HashPrefix` is a hash of the YouTube `videoID`. It should be the first 4 - 32 characters (4 is recommended). This provides extra privacy by potentially finding more than just the video you are looking for. This makes the server not know exactly what video you are looking for.
**Input** (URL Parameters):
```js
{
"prefix": sha256HashPrefix // optional if not sent through path
}
```
**Response**:
```js
[{ // Array of this object
"videoID": string,
"hash": string, // The full hash
"categories": string[]
// See https://github.com/ajayyy/SponsorBlock/wiki/Types#category
}]
```
**Error codes**:
400: Bad Request (Your inputs are wrong/impossible)
404: Not Found 404: Not Found
__________________________________________________________________ __________________________________________________________________