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

View File

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