From 8e250d65de399dcdcfd5f247ed01d241936476cb Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Mon, 5 Jul 2021 13:44:24 -0400 Subject: [PATCH] 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) --- API-Docs.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/API-Docs.md b/API-Docs.md index 52d722e..c20205f 100644 --- a/API-Docs.md +++ b/API-Docs.md @@ -47,6 +47,7 @@ ________________________________________________________________________________ **Error codes**: +400: Bad Request (Your inputs are wrong/impossible) 404: Not Found __________________________________________________________________ @@ -84,6 +85,7 @@ __________________________________________________________________ **Error codes**: +400: Bad Request (Your inputs are wrong/impossible) 404: Not Found __________________________________________________________________ @@ -461,6 +463,57 @@ __________________________________________________________________ 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 __________________________________________________________________