8
0

- Upgrade

This commit is contained in:
Aleksandr Garin 2023-08-22 17:00:22 +03:00
parent 826b0e39ec
commit 2e4a583801
2 changed files with 244 additions and 74 deletions

View File

@ -1,22 +1,23 @@
_id: spc_2b420b2bed1d4d868807303a581fb8c1 _id: spc_2b420b2bed1d4d868807303a581fb8c1
type: ApiSpec type: ApiSpec
parentId: wrk_cd1160cf39f5497fa4711fe4fd6567de parentId: wrk_cd1160cf39f5497fa4711fe4fd6567de
modified: 1680017776645 modified: 1692712790774
created: 1679916396495 created: 1679916396495
fileName: youtubekids.yaml fileName: youtubekids.yaml
contents: >+ contents: >
openapi: 3.0.3 openapi: 3.0.3
info: info:
title: YouTube Kids Public API title: YouTube Kids Public API
description: For generate API REST clients for Feelter UGC description: For generate API REST clients for Feelter UGC
contact: contact:
email: garin1221@yandex.ru email: garin1221@yandex.ru
version: 1.0.0 version: 0.0.2
servers: servers:
- url: https://www.youtubekids.com/youtubei/v1 - url: https://www.youtubekids.com/youtubei/v1
description: Original YoutubeKids API Server V1
tags: tags:
- name: browse - name: browse
@ -29,7 +30,7 @@ contents: >+
post: post:
tags: tags:
- browse - browse
summary: Browse resource content summary: Browse resource content
description: Get content for resource description: Get content for resource
operationId: browse operationId: browse
requestBody: requestBody:
@ -37,31 +38,34 @@ contents: >+
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/BrowseRequestPayload' $ref: '#/components/schemas/BrowseRequestPayload'
responses: responses:
'200': '200':
description: OK description: OK
content: content:
'application/json': 'application/json':
"schema": "schema":
$ref: '#/components/schemas/BrowseResponsePayload' $ref: '#/components/schemas/BrowseResponsePayload'
'400': default:
description: Bad Request description: Unexpected error
content: content:
'application/json': 'application/json':
"schema": "schema":
$ref: '#/components/schemas/ErrorResponsePayload' $ref: '#/components/schemas/ErrorResponsePayload'
# Компоненты # Компоненты
components: components:
# Схемы данных # Схемы данных
schemas: schemas:
# Ошибка # Ошибка
Error: Error:
type: object type: object
required:
- message
- domain
- reason
properties: properties:
message: message:
type: string type: string
@ -69,28 +73,28 @@ contents: >+
type: string type: string
reason: reason:
type: string type: string
# Доступность данных # Доступность данных
AccessibilityData: AccessibilityData:
type: object type: object
properties: properties:
label: label:
type: string type: string
# Доступность # Доступность
Accessibility: Accessibility:
type: object type: object
properties: properties:
accessibilityData: accessibilityData:
$ref: '#/components/schemas/AccessibilityData' $ref: '#/components/schemas/AccessibilityData'
# WatchEndpoint # WatchEndpoint
WatchEndpoint: WatchEndpoint:
type: object type: object
properties: properties:
videoId: videoId:
type: string type: string
# BrowseEndpoint # BrowseEndpoint
BrowseEndpoint: BrowseEndpoint:
type: object type: object
@ -98,78 +102,100 @@ contents: >+
browseId: browseId:
type: string type: string
canonicalBaseUrl: canonicalBaseUrl:
type: string type: string
# Конечная точка навигации # Конечная точка навигации
NavigationEndpoint: NavigationEndpoint:
type: object type: object
properties: properties:
clickTrackingParams: clickTrackingParams:
type: string type: string
watchEndpoint: watchEndpoint:
$ref: '#/components/schemas/WatchEndpoint' $ref: '#/components/schemas/WatchEndpoint'
browseEndpoint: browseEndpoint:
$ref: '#/components/schemas/BrowseEndpoint' $ref: '#/components/schemas/BrowseEndpoint'
# Текст -> Runs # Текст -> Runs
TextRun: TextRun:
type: object type: object
required:
- text
properties: properties:
text: text:
type: string type: string
navigationEndpoint: navigationEndpoint:
$ref: '#/components/schemas/NavigationEndpoint' $ref: '#/components/schemas/NavigationEndpoint'
# Текст # Текст
Text: Text:
type: object type: object
required:
- runs
properties: properties:
runs: runs:
type: array type: array
items: items:
$ref: '#/components/schemas/TextRun' $ref: '#/components/schemas/TextRun'
accessibility: accessibility:
$ref: '#/components/schemas/Accessibility' $ref: '#/components/schemas/Accessibility'
# Строковый параметр ключ-зачение # Строковый параметр ключ-зачение
KeyStringValue: KeyStringValue:
type: object type: object
required:
- key
- value
properties: properties:
key: key:
type: string type: string
value: value:
type: string type: string
# Ассеты категории # Ассеты категории
CategoryAssets: CategoryAssets:
type: object type: object
required:
- assetKey
properties: properties:
assetKey: assetKey:
type: string type: string
backgroundColor: backgroundColor:
type: string type: string
# Расширение для владельцев детских видео # Расширение для владельцев детских видео
KidsVideoOwnerExtension: KidsVideoOwnerExtension:
type: object type: object
required:
- externalChannelId
properties: properties:
externalChannelId: externalChannelId:
type: string type: string
# Thumbnail # Thumbnail
Thumbnail: Thumbnail:
type: object type: object
required:
- url
- width
- height
properties: properties:
url: url:
type: string type: string
width: width:
type: number type: integer
height: height:
type: number type: integer
# Компактный видеорендерер # Рендер карточки с видео
CompactVideoRenderer: CompactVideoRenderer:
type: object type: object
required:
- videoId
- thumbnail
- title
- viewCountText
- trackingParams
- kidsVideoOwnerExtension
properties: properties:
videoId: videoId:
type: string type: string
@ -200,7 +226,7 @@ contents: >+
thumbnails: thumbnails:
type: array type: array
items: items:
$ref: '#/components/schemas/Thumbnail' $ref: '#/components/schemas/Thumbnail'
trackingParams: trackingParams:
type: string type: string
shortViewCountText: shortViewCountText:
@ -208,22 +234,115 @@ contents: >+
accessibility: accessibility:
$ref: '#/components/schemas/Accessibility' $ref: '#/components/schemas/Accessibility'
kidsVideoOwnerExtension: kidsVideoOwnerExtension:
$ref: '#/components/schemas/KidsVideoOwnerExtension' $ref: '#/components/schemas/KidsVideoOwnerExtension'
# Рендер карточки с плейлистом
CompactPlaylistRenderer:
type: object
required:
- playlistId
- thumbnail
- title
- viewCountText
- trackingParams
properties:
playlistId:
type: string
thumbnail:
type: object
properties:
thumbnails:
type: array
items:
$ref: '#/components/schemas/Thumbnail'
title:
$ref: '#/components/schemas/Text'
shortBylineText:
$ref: '#/components/schemas/Text'
videoCountText:
$ref: '#/components/schemas/Text'
navigationEndpoint:
$ref: '#/components/schemas/NavigationEndpoint'
videoCountShortText:
$ref: '#/components/schemas/Text'
trackingParams:
type: string
sidebarThumbnails:
type: array
items:
type: object
properties:
thumbnails:
type: array
items:
$ref: '#/components/schemas/Thumbnail'
thumbnailText:
$ref: '#/components/schemas/Text'
shareUrl:
type: string
longBylineText:
$ref: '#/components/schemas/Text'
tvBanner:
type: object
properties:
thumbnails:
type: array
items:
$ref: '#/components/schemas/Thumbnail'
# Рендер карточки с каналом
CompactChannelRenderer:
type: object
required:
- channelId
- displayName
- videoCountText
- title
- trackingParams
properties:
channelId:
type: string
thumbnail:
type: object
properties:
thumbnails:
type: array
items:
$ref: '#/components/schemas/Thumbnail'
displayName:
$ref: '#/components/schemas/Text'
videoCountText:
$ref: '#/components/schemas/Text'
subscriberCountText:
$ref: '#/components/schemas/Text'
navigationEndpoint:
$ref: '#/components/schemas/NavigationEndpoint'
title:
$ref: '#/components/schemas/Text'
trackingParams:
type: string
# Средство визуализации раздела элемента # Средство визуализации раздела элемента
ItemSectionRenderer: ItemSectionRenderer:
type: object type: object
required:
- contents
- trackingParams
properties: properties:
contents: contents:
type: array type: array
items: items:
type: object type: object
properties: properties:
compactPlaylistRenderer:
$ref: '#/components/schemas/CompactPlaylistRenderer'
compactChannelRenderer:
$ref: '#/components/schemas/CompactChannelRenderer'
compactVideoRenderer: compactVideoRenderer:
$ref: '#/components/schemas/CompactVideoRenderer' $ref: '#/components/schemas/CompactVideoRenderer'
trackingParams: trackingParams:
type: string type: string
# Рендер списка разделов # Рендер списка разделов
SectionListRenderer: SectionListRenderer:
type: object type: object
@ -234,10 +353,10 @@ contents: >+
type: object type: object
properties: properties:
itemSectionRenderer: itemSectionRenderer:
$ref: '#/components/schemas/ItemSectionRenderer' $ref: '#/components/schemas/ItemSectionRenderer'
trackingParams: trackingParams:
type: string type: string
# Визуализатор закрепленных сечений # Визуализатор закрепленных сечений
AnchoredSectionRenderer: AnchoredSectionRenderer:
type: object type: object
@ -256,15 +375,15 @@ contents: >+
categoryAssets: categoryAssets:
$ref: '#/components/schemas/CategoryAssets' $ref: '#/components/schemas/CategoryAssets'
categoryType: categoryType:
type: string type: string
# Якорь экрана # Якорь экрана
ScreenAnchor: ScreenAnchor:
type: object type: object
properties: properties:
anchoredSectionRenderer: anchoredSectionRenderer:
$ref: '#/components/schemas/AnchoredSectionRenderer' $ref: '#/components/schemas/AnchoredSectionRenderer'
# Рендерер экрана # Рендерер экрана
ScreenRenderer: ScreenRenderer:
type: object type: object
@ -273,7 +392,7 @@ contents: >+
type: array type: array
items: items:
$ref: '#/components/schemas/ScreenAnchor' $ref: '#/components/schemas/ScreenAnchor'
# Средство визуализации заголовка категории # Средство визуализации заголовка категории
CategoriesHeaderRenderer: CategoriesHeaderRenderer:
type: object type: object
@ -281,18 +400,33 @@ contents: >+
trackingParams: trackingParams:
type: string type: string
# TODO # TODO
# Параметры контента # Параметры контента
KidsAppContentSettings: KidsAppContentSettings:
type: object type: object
required:
- corpusPreference
- kidsNoSearchMode
properties: properties:
corpusPreference: corpusPreference:
type: string type: string
enum:
- KIDS_CORPUS_PREFERENCE_UNKNOWN # unknown
- KIDS_CORPUS_PREFERENCE_YOUNGER # (0-4 years)
- KIDS_CORPUS_PREFERENCE_TWEEN # (5-7)
- KIDS_CORPUS_PREFERENCE_PAM_YOUNGER
- KIDS_CORPUS_PREFERENCE_PAM_TWEEN
- KIDS_CORPUS_PREFERENCE_PRESCHOOL # (8-12)
example: KIDS_CORPUS_PREFERENCE_TWEEN example: KIDS_CORPUS_PREFERENCE_TWEEN
kidsNoSearchMode: kidsNoSearchMode:
type: string type: string
enum:
- YT_KIDS_NO_SEARCH_MODE_UNKNOWN # unknown
- YT_KIDS_NO_SEARCH_MODE_ON
- YT_KIDS_NO_SEARCH_MODE_OFF
example: YT_KIDS_NO_SEARCH_MODE_OFF example: YT_KIDS_NO_SEARCH_MODE_OFF
default: YT_KIDS_NO_SEARCH_MODE_OFF
# Конфигурация категорий # Конфигурация категорий
KidsAppCategorySettings: KidsAppCategorySettings:
type: object type: object
@ -301,8 +435,8 @@ contents: >+
type: array type: array
example: ["approved_for_you", "black_joy", "camp", "collections", "earth", "explore", "favorites", "gaming", "halloween", "hero", "learning", "making", "move", "music", "reading", "shared_by_parents", "shows", "soccer", "sports", "spotlight", "winter"] example: ["approved_for_you", "black_joy", "camp", "collections", "earth", "explore", "favorites", "gaming", "halloween", "hero", "learning", "making", "move", "music", "reading", "shared_by_parents", "shows", "soccer", "sports", "spotlight", "winter"]
items: items:
type: string type: string
# Параметры приложения # Параметры приложения
KidsAppInfo: KidsAppInfo:
type: object type: object
@ -312,55 +446,79 @@ contents: >+
$ref: '#/components/schemas/KidsAppContentSettings' $ref: '#/components/schemas/KidsAppContentSettings'
categorySettings: categorySettings:
$ref: '#/components/schemas/KidsAppCategorySettings' $ref: '#/components/schemas/KidsAppCategorySettings'
# Информация о клиенте в запросе # Информация о клиенте в запросе
RequestClient: RequestClient:
type: object type: object
description: Client information description: Client information
required:
- hl
- gl
- osName
- platform
- osVersion
- clientName
- deviceMake
- kidsAppInfo
- browserName
- clientVersion
- browserVersion
properties: properties:
clientName: clientName:
type: string type: string
example: WEB_KIDS example: WEB_KIDS
default: WEB_KIDS
clientVersion: clientVersion:
type: string type: string
example: 2.20230202.00.00 example: 2.20230817.00.00
default: 2.20230817.00.00
hl: hl:
type: string type: string
example: ru example: ru
default: ru
gl: gl:
type: string type: string
example: RU example: RU
default: RU
experimentsToken: experimentsToken:
type: string type: string
browserName: browserName:
type: string type: string
example: Safari example: Safari
default: Safari
deviceMake: deviceMake:
type: string type: string
example: apple example: apple
default: apple
browserVersion: browserVersion:
type: string type: string
example: '16.2' example: '16.2'
default: '16.2'
osName: osName:
type: string type: string
example: Macintosh example: Macintosh
default: Macintosh
osVersion: osVersion:
type: string type: string
example: 10_15_7 example: '10_15_7'
default: '10_15_7'
platform: platform:
type: string type: string
example: DESKTOP example: DESKTOP
default: DESKTOP
kidsAppInfo: kidsAppInfo:
$ref: '#/components/schemas/KidsAppInfo' $ref: '#/components/schemas/KidsAppInfo'
# Контекст запроса # Контекст запроса
RequestContext: RequestContext:
type: object type: object
description: Request context description: Request context
required:
- client
properties: properties:
client: client:
$ref: '#/components/schemas/RequestClient' $ref: '#/components/schemas/RequestClient'
# Контекст ответа # Контекст ответа
ResponseContext: ResponseContext:
type: object type: object
@ -369,32 +527,41 @@ contents: >+
visitorData: visitorData:
type: string type: string
maxAgeSeconds: maxAgeSeconds:
type: number type: integer
serviceTrackingParams: serviceTrackingParams:
type: array type: array
items: items:
type: object type: object
properties: properties:
service: service:
type: string type: string
params: params:
type: array type: array
items: items:
$ref: '#/components/schemas/KeyStringValue' $ref: '#/components/schemas/KeyStringValue'
# Данные для запроса на получение контента определенного ресурса # Данные для запроса на получение контента определенного ресурса
BrowseRequestPayload: BrowseRequestPayload:
type: object type: object
required:
- context
- browseId
properties: properties:
context: context:
$ref: '#/components/schemas/RequestContext' $ref: '#/components/schemas/RequestContext'
params:
type: string
browseId: browseId:
type: string type: string
example: FEkids_home example: FEkids_home
# Ответ на запрос получения контента определенного ресурса # Ответ на запрос получения контента определенного ресурса
BrowseResponsePayload: BrowseResponsePayload:
type: object type: object
required:
- header
- contents
- responseContext
properties: properties:
responseContext: responseContext:
$ref: '#/components/schemas/ResponseContext' $ref: '#/components/schemas/ResponseContext'
@ -407,19 +574,26 @@ contents: >+
type: object type: object
properties: properties:
kidsHomeScreenRenderer: kidsHomeScreenRenderer:
$ref: '#/components/schemas/ScreenRenderer' $ref: '#/components/schemas/ScreenRenderer'
trackingParams: trackingParams:
type: string type: string
# Ответ с ошибкой # Ответ с ошибкой
ErrorResponsePayload: ErrorResponsePayload:
type: object type: object
required:
- error
properties: properties:
error: error:
type: object type: object
required:
- code
- errors
- status
- message
properties: properties:
code: code:
type: number type: integer
example: 400 example: 400
message: message:
type: string type: string
@ -430,8 +604,4 @@ contents: >+
status: status:
type: string type: string
example: FAILED_PRECONDITION example: FAILED_PRECONDITION
contentType: yaml contentType: yaml

View File

@ -1,7 +1,7 @@
_id: req_wrk_cd1160cf39f5497fa4711fe4fd6567de0f6a24fa _id: req_wrk_cd1160cf39f5497fa4711fe4fd6567de0f6a24fa
type: Request type: Request
parentId: fld_wrk_cd1160cf39f5497fa4711fe4fd6567de0f6a24fa parentId: fld_wrk_cd1160cf39f5497fa4711fe4fd6567de0f6a24fa
modified: 1680014368438 modified: 1692541642074
created: 1679919032177 created: 1679919032177
url: "{{ base_url }}/browse" url: "{{ base_url }}/browse"
name: Browse resource content name: Browse resource content
@ -14,7 +14,7 @@ body:
"context": { "context": {
"client": { "client": {
"clientName": "WEB_KIDS", "clientName": "WEB_KIDS",
"clientVersion": "2.20230202.00.00", "clientVersion": "2.20230817.00.00",
"hl": "ru", "hl": "ru",
"gl": "RU", "gl": "RU",
"experimentsToken": "string", "experimentsToken": "string",