chore: fix json formatting in notes

This commit is contained in:
ThetaDev 2023-05-01 18:43:44 +02:00
parent fa4c845c2f
commit c634b26bc2

View file

@ -3,27 +3,29 @@
When YouTube introduces a new feature, it does so gradually. When a user creates a new When YouTube introduces a new feature, it does so gradually. When a user creates a new
session, YouTube decided randomly which new features should be enabled. session, YouTube decided randomly which new features should be enabled.
YouTube sessions are identified by the visitor data cookie. This cookie is sent with every YouTube sessions are identified by the visitor data cookie. This cookie is sent with
API request using the `context.client.visitor_data` JSON parameter. It is also returned in the every API request using the `context.client.visitor_data` JSON parameter. It is also
`responseContext.visitorData` response parameter and stored as the `__SECURE-YEC` cookie. returned in the `responseContext.visitorData` response parameter and stored as the
`__SECURE-YEC` cookie.
By sending the same visitor data cookie, A/B tests can be reproduced, which is important for testing By sending the same visitor data cookie, A/B tests can be reproduced, which is important
alternative YouTube clients. for testing alternative YouTube clients.
This page lists all A/B tests that were encountered while maintaining the RustyPipe client. This page lists all A/B tests that were encountered while maintaining the RustyPipe
client.
**Impact rating:** **Impact rating:**
The impact ratings shows how much effort it takes to adapt alternative YouTube clients to the The impact ratings shows how much effort it takes to adapt alternative YouTube clients
new feature. to the new feature.
- 🟢 **Low** Minor incompatibility (e.g. parameter name change) - 🟢 **Low** Minor incompatibility (e.g. parameter name change)
- 🟡 **Medium** Extensive changes to the response data model OR removal of parameters - 🟡 **Medium** Extensive changes to the response data model OR removal of parameters
- 🔴 **High** Changes to the functionality of YouTube that will require API changes - 🔴 **High** Changes to the functionality of YouTube that will require API changes for
for alternative clients alternative clients
If you want to check how often these A/B tests occur, you can use the `codegen` tool with the If you want to check how often these A/B tests occur, you can use the `codegen` tool
following command: `rustypipe-codegen ab-test <id>`. with the following command: `rustypipe-codegen ab-test <id>`.
## [1] Attributed text description ## [1] Attributed text description
@ -33,17 +35,18 @@ following command: `rustypipe-codegen ab-test <id>`.
![A/B test 1 screenshot](./_img/ab_1.png) ![A/B test 1 screenshot](./_img/ab_1.png)
YouTube shows internal links (channels, videos, playlists) in the video description YouTube shows internal links (channels, videos, playlists) in the video description as
as buttons with the YouTube icon. To accomplish this, they completely changed the underlying buttons with the YouTube icon. To accomplish this, they completely changed the
data model. underlying data model.
The new format uses a string with the entire plaintext content along with a list of `"commandRuns"` The new format uses a string with the entire plaintext content along with a list of
which include the link data and the position of the links within the text. `"commandRuns"` which include the link data and the position of the links within the
text.
Note that the position and length parameter refer to the number of UTF-16 characters. If Note that the position and length parameter refer to the number of UTF-16 characters. If
you are implementing this in a language which does not use UTF-16 as its internal string you are implementing this in a language which does not use UTF-16 as its internal string
representation, you have to iterate over the unicode codepoints and keep track of the UTF-16 representation, you have to iterate over the unicode codepoints and keep track of the
index seperately. UTF-16 index seperately.
**OLD** **OLD**
@ -124,14 +127,15 @@ index seperately.
YouTube changed their channel page layout, putting livestreams and short videos into YouTube changed their channel page layout, putting livestreams and short videos into
separate tabs. separate tabs.
Fetching the videos page now only returns a subset of a channel's videos. To get all videos Fetching the videos page now only returns a subset of a channel's videos. To get all
from a channel, you would have to run up to 3 queries. videos from a channel, you would have to run up to 3 queries.
Even though it has its disadvantages, the RSS feed is now probably the best way for keeping Even though it has its disadvantages, the RSS feed is now probably the best way for
track of a channel's new uploads. keeping track of a channel's new uploads.
Additionally the channel tab response model was slightly changed, now using a `"RichGridRenderer"`. Additionally the channel tab response model was slightly changed, now using a
Short videos also have their own data models (`"reelItemRenderer"`). `"RichGridRenderer"`. Short videos also have their own data models
(`"reelItemRenderer"`).
**RichGrid** **RichGrid**
@ -273,8 +277,8 @@ Note that channels without handles still use the old data model, even on the sam
- **Impact:** 🟢 Low - **Impact:** 🟢 Low
- **Endpoint:** browse (trending videos) - **Endpoint:** browse (trending videos)
YouTube moved the list of trending videos from the main *trending* page to a YouTube moved the list of trending videos from the main _trending_ page to a separate
separate tab (Videos). tab (Videos).
The video tab is fetched with the params `4gIOGgxtb3N0X3BvcHVsYXI%3D`. The video tab is fetched with the params `4gIOGgxtb3N0X3BvcHVsYXI%3D`.
@ -302,43 +306,47 @@ YouTube changed the header renderer type on the trending page to a `pageHeaderRe
**OLD** **OLD**
```json ```json
"c4TabbedHeaderRenderer": { {
"avatar": { "c4TabbedHeaderRenderer": {
"thumbnails": [ "avatar": {
{ "thumbnails": [
"height": 100, {
"url": "https://www.youtube.com/img/trending/avatar/trending_avatar.png", "height": 100,
"width": 100 "url": "https://www.youtube.com/img/trending/avatar/trending_avatar.png",
} "width": 100
] }
}, ]
"title": "Trending", },
"trackingParams": "CBAQ8DsiEwiXi_iUht76AhVM6hEIHfgTB2g=" "title": "Trending",
"trackingParams": "CBAQ8DsiEwiXi_iUht76AhVM6hEIHfgTB2g="
}
} }
``` ```
**NEW** **NEW**
```json ```json
"pageHeaderRenderer": { {
"pageTitle": "Trending", "pageHeaderRenderer": {
"content": { "pageTitle": "Trending",
"pageHeaderViewModel": { "content": {
"title": { "pageHeaderViewModel": {
"dynamicTextViewModel": { "text": { "content": "Trending" } } "title": {
}, "dynamicTextViewModel": { "text": { "content": "Trending" } }
"image": { },
"contentPreviewImageViewModel": { "image": {
"image": { "contentPreviewImageViewModel": {
"sources": [ "image": {
{ "sources": [
"url": "https://www.youtube.com/img/trending/avatar/trending.png", {
"width": 100, "url": "https://www.youtube.com/img/trending/avatar/trending.png",
"height": 100 "width": 100,
} "height": 100
] }
}, ]
"style": "CONTENT_PREVIEW_IMAGE_STYLE_CIRCLE" },
"style": "CONTENT_PREVIEW_IMAGE_STYLE_CIRCLE"
}
} }
} }
} }