Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(parser): Update LiveChatPaidSticker #849

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jonz94
Copy link
Contributor

@jonz94 jonz94 commented Dec 16, 2024

This PR updates the LiveChatPaidSticker parser:

  • Add sticker_accessibility_label property
  • Add sticker_display_width property
  • Add sticker_display_height property
  • Add context_menu_accessibility_label property
  • Add timestamp_usec property
  • Add is_v2_style property

Example RawNode data 1:

{
  "liveChatPaidStickerRenderer": {
    "id": "ChwKGkNPNmI3ZW5CcUlvREZVdkV3Z1FkNlFZVDJR",
    "contextMenuEndpoint": {
      "clickTrackingParams": "CAUQ77sEIhMIwc_N8cGoigMV_-1MAh2NTwkk",
      "commandMetadata": {
        "webCommandMetadata": {
          "ignoreNavigation": true
        }
      },
      "liveChatItemContextMenuEndpoint": {
        "params": "Q2g0S0hBb2FRMDgyWWpkbGJrSnhTVzlFUmxWMlJYZG5VV1EyVVZsVU1sRWFLU29uQ2hoVlEzbHJaMEYxU1dwdU56QmZRMWhNVG1wYU9IcHdjRkVTQzBSQ1NHNXJPSGRxT0VwaklBRW9CRElhQ2hoVlF6SkZhVjh6VW5KdlpHczVUMkpxYUVSelVVMVdVVUU0QWtnQVVCUSUzRA=="
      }
    },
    "contextMenuAccessibility": {
      "accessibilityData": {
        "label": "Chat actions"
      }
    },
    "timestampUsec": "1734222400844356",
    "authorPhoto": {
      "thumbnails": [
        {
          "url": "https://yt4.ggpht.com/ytc/AIdro_lmdU1tg3poJ8X_t8MFGZpZD-7nFujvA6blC4MIv7QIOBY=s32-c-k-c0x00ffffff-no-rj",
          "width": 32,
          "height": 32
        },
        {
          "url": "https://yt4.ggpht.com/ytc/AIdro_lmdU1tg3poJ8X_t8MFGZpZD-7nFujvA6blC4MIv7QIOBY=s64-c-k-c0x00ffffff-no-rj",
          "width": 64,
          "height": 64
        }
      ]
    },
    "authorName": {
      "simpleText": "八神光"
    },
    "authorExternalChannelId": "UC2Ei_3Rrodk9ObjhDsQMVQA",
    "sticker": {
      "thumbnails": [
        {
          "url": "//lh3.googleusercontent.com/1GF4XO0fhtEnQiPQwgLDQ49XhFOJxV7aJW3ku9eJEJptm1UwdE-vzQb4wTF5Utg5rcsSJuBY7sCkwyTLkeg=s104-rwa",
          "width": 104,
          "height": 104
        },
        {
          "url": "//lh3.googleusercontent.com/1GF4XO0fhtEnQiPQwgLDQ49XhFOJxV7aJW3ku9eJEJptm1UwdE-vzQb4wTF5Utg5rcsSJuBY7sCkwyTLkeg=s208-rwa",
          "width": 208,
          "height": 208
        }
      ],
      "accessibility": {
        "accessibilityData": {
          "label": "Shiba dog dressed in a traditional outfit waving Japanese fans"
        }
      }
    },
    "authorBadges": [
      {
        "liveChatAuthorBadgeRenderer": {
          "customThumbnail": {
            "thumbnails": [
              {
                "url": "https://yt3.ggpht.com/Gg2DqhMA9ErDYrWzXU8V8sQkiHupa6MouS4l29dyEjnWQ2YNlWc0mvCxQrFw3KcRIPsheRRsHA=s16-c-k",
                "width": 16,
                "height": 16
              },
              {
                "url": "https://yt3.ggpht.com/Gg2DqhMA9ErDYrWzXU8V8sQkiHupa6MouS4l29dyEjnWQ2YNlWc0mvCxQrFw3KcRIPsheRRsHA=s32-c-k",
                "width": 32,
                "height": 32
              }
            ]
          },
          "tooltip": "Member (2 years)",
          "accessibility": {
            "accessibilityData": {
              "label": "Member (2 years)"
            }
          }
        }
      }
    ],
    "moneyChipBackgroundColor": 4294953512,
    "moneyChipTextColor": 3741319168,
    "purchaseAmountText": {
      "simpleText": "NT$150.00"
    },
    "stickerDisplayWidth": 104,
    "stickerDisplayHeight": 104,
    "backgroundColor": 4294953512,
    "authorNameTextColor": 2315255808,
    "trackingParams": "CAUQ77sEIhMIwc_N8cGoigMV_-1MAh2NTwkk",
    "isV2Style": true
  }
}

Example RawNode data 2:

{
  "liveChatPaidStickerRenderer": {
    "id": "ChwKGkNNT0prdVNqdW9RREZhMF9yUVlkUGZZT0V3",
    "contextMenuEndpoint": {
      "clickTrackingParams": "CAwQ77sEIhMIpfCv3MioigMV1fBMAh1DSiXx",
      "commandMetadata": {
        "webCommandMetadata": {
          "ignoreNavigation": true
        }
      },
      "liveChatItemContextMenuEndpoint": {
        "params": "Q2g0S0hBb2FRMDFQU210MVUycDFiMUZFUm1Fd1gzSlJXV1JRWmxsUFJYY2FLU29uQ2hoVlF6SmFWMmRuYjI0eFRrOVVNbFJIWVZaVlRYcFpOMEVTQzNwZk9UVTNiemx0VG0xaklBRW9CRElhQ2hoVlExVnRMV2xKVkRGSGMyUnRPRzQwYVhkSWFtSXpSa0U0QWtnQlVCUSUzRA=="
      }
    },
    "contextMenuAccessibility": {
      "accessibilityData": {
        "label": "Chat actions"
      }
    },
    "timestampUsec": "1708444524473088",
    "authorPhoto": {
      "thumbnails": [
        {
          "url": "https://yt4.ggpht.com/ytc/AIdro_mJMNqjr7qrkAZkFX-hXpITiaT0l-HOoLbdxucO1GX1XN4=s32-c-k-c0x00ffffff-no-rj",
          "width": 32,
          "height": 32
        },
        {
          "url": "https://yt4.ggpht.com/ytc/AIdro_mJMNqjr7qrkAZkFX-hXpITiaT0l-HOoLbdxucO1GX1XN4=s64-c-k-c0x00ffffff-no-rj",
          "width": 64,
          "height": 64
        }
      ]
    },
    "authorName": {
      "simpleText": "J C"
    },
    "authorExternalChannelId": "UCUm-iIT1Gsdm8n4iwHjb3FA",
    "timestampText": {
      "simpleText": "1:49:36"
    },
    "sticker": {
      "thumbnails": [
        {
          "url": "//lh3.googleusercontent.com/k4OwpD05s52dcfXQ88DUcco5bLW38cHkpfmQftjSNzuXJTOOHsXoa-trHRRnoRYGZSxti7APvOha265X9P4=s144-rwa",
          "width": 144,
          "height": 144
        },
        {
          "url": "//lh3.googleusercontent.com/k4OwpD05s52dcfXQ88DUcco5bLW38cHkpfmQftjSNzuXJTOOHsXoa-trHRRnoRYGZSxti7APvOha265X9P4=s288-rwa",
          "width": 288,
          "height": 288
        }
      ],
      "accessibility": {
        "accessibilityData": {
          "label": "Shiba dog wearing samurai armor writing 'You're amazing' in the air with sparklers"
        }
      }
    },
    "authorBadges": [
      {
        "liveChatAuthorBadgeRenderer": {
          "customThumbnail": {
            "thumbnails": [
              {
                "url": "https://yt3.ggpht.com/ECY6ss6mnC-Ay4w1GfhDc7HiKBd9T8pSsdCIIW3DKEuWLODyt4slsjimjpp-Tdls3WQw7RwDRA=s16-c-k",
                "width": 16,
                "height": 16
              },
              {
                "url": "https://yt3.ggpht.com/ECY6ss6mnC-Ay4w1GfhDc7HiKBd9T8pSsdCIIW3DKEuWLODyt4slsjimjpp-Tdls3WQw7RwDRA=s32-c-k",
                "width": 32,
                "height": 32
              }
            ]
          },
          "tooltip": "New member",
          "accessibility": {
            "accessibilityData": {
              "label": "New member"
            }
          }
        }
      }
    ],
    "moneyChipBackgroundColor": 4293467747,
    "moneyChipTextColor": 4294967295,
    "purchaseAmountText": {
      "simpleText": "NT$1,490.00"
    },
    "stickerDisplayWidth": 144,
    "stickerDisplayHeight": 144,
    "backgroundColor": 4293467747,
    "authorNameTextColor": 3019898879,
    "trackingParams": "CAwQ77sEIhMIpfCv3MioigMV1fBMAh1DSiXx",
    "isV2Style": true
  }
}

* Add `sticker_accessibility_label` property
* Add `sticker_display_width` property
* Add `sticker_display_height` property
* Add `context_menu_accessibility_label` property
* Add `timestamp_usec` property
* Add `is_v2_style` property
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant