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 LiveChatTickerPaidMessageItem #845

Merged
merged 1 commit into from
Dec 15, 2024

Conversation

jonz94
Copy link
Contributor

@jonz94 jonz94 commented Dec 14, 2024

This PR updates the LiveChatTickerPaidMessageItem parser:

  • Change duration_sec property type from string to number
  • Change full_duration_sec property type from string to number
  • Handle the scenario where the author's name is represented as authUsername
  • Mark amount property as optional
  • Add start_background_color property
  • Add amount_text_color property
  • Add end_background_color property
  • Add animation_origin property
  • Add open_engagement_panel_command property

Example RawNode data 1:

{
  "liveChatTickerPaidMessageItemRenderer": {
    "id": "ChwKGkNJYnV3cG1NenZvQ0ZWM0R3Z1FkN1owQ25B",
    "amountTextColor": 3758096383,
    "startBackgroundColor": 4294278144,
    "endBackgroundColor": 4293284096,
    "authorPhoto": {
      "thumbnails": [
        {
          "url": "https://yt4.ggpht.com/ytc/AIdro_mZssKAtVURk_MqlGktbHRjbPGol9BEgE-bEzkUxvS2J0o=s32-c-k-c0x00ffffff-no-rj",
          "width": 32,
          "height": 32
        },
        {
          "url": "https://yt4.ggpht.com/ytc/AIdro_mZssKAtVURk_MqlGktbHRjbPGol9BEgE-bEzkUxvS2J0o=s64-c-k-c0x00ffffff-no-rj",
          "width": 64,
          "height": 64
        }
      ],
      "accessibility": {
        "accessibilityData": {
          "label": "土司"
        }
      }
    },
    "durationSec": 600,
    "showItemEndpoint": {
      "clickTrackingParams": "CBkQsMgEIhMI5Za9w5njiQMVn9w0Bx2EWwZz",
      "commandMetadata": {
        "webCommandMetadata": {
          "ignoreNavigation": true
        }
      },
      "showLiveChatItemEndpoint": {
        "renderer": {
          "liveChatPaidMessageRenderer": {
            /* truncated */
          }
        },
        "trackingParams": "CBoQjtEGIhMI5Za9w5njiQMVn9w0Bx2EWwZz"
      }
    },
    "authorExternalChannelId": "UCkiuqhOYPAfJ4bqz3K2s3ag",
    "fullDurationSec": 600,
    "trackingParams": "CBkQsMgEIhMI5Za9w5njiQMVn9w0Bx2EWwZz",
    "authorUsername": {
      "simpleText": "土司"
    },
    "animationOrigin": "ANIMATION_ORIGIN_PDG_TICKER_LIKE",
    "openEngagementPanelCommand": {
      "clickTrackingParams": "CBkQsMgEIhMI5Za9w5njiQMVn9w0Bx2EWwZz",
      "showEngagementPanelEndpoint": {
        "identifier": {
          "surface": "ENGAGEMENT_PANEL_SURFACE_LIVE_CHAT",
          "tag": "PAreply_thread"
        },
        "globalConfiguration": {
          "params": "ggm2AQojVWd6Wk4tUkkxeVhEd1dra1JnUjRBYUFCRHFnQnF0U1ZoUUkSVgopKicKGFVDMlpXZ2dvbjFOT1QyVEdhVlVNelk3QRILRF9VMHZUSnJ2X1UQARgEIAE6I1VnelpOLVJJMXlYRHdXa2tSZ1I0QWFBQkRxZ0JxdFNWaFFJGgggALABAPgBACIpKicKGFVDMlpXZ2dvbjFOT1QyVEdhVlVNelk3QRILRF9VMHZUSnJ2X1UoATAB"
        },
        "engagementPanelPresentationConfigs": {
          "engagementPanelPopupPresentationConfig": {
            "popupType": "PANEL_POPUP_TYPE_DIALOG"
          }
        }
      }
    }
  }
}

Example RawNode data 2:

{
  "liveChatTickerPaidMessageItemRenderer": {
    "id": "ChwKGkNMWEVvcmFvcFlvREZYM0N3Z1FkY2xJa25R",
    "amountTextColor": 3758096383,
    "startBackgroundColor": 4294278144,
    "endBackgroundColor": 4293284096,
    "authorPhoto": {
      "thumbnails": [
        {
          "url": "https://yt4.ggpht.com/VGq8Jh9ZBOSe3N9qduOnj573aFjmZqS4JSXolFzoFA4t5a4NBUF4NUlqDchqYIxl8mGN99z-=s32-c-k-c0x00ffffff-no-rj",
          "width": 32,
          "height": 32
        },
        {
          "url": "https://yt4.ggpht.com/VGq8Jh9ZBOSe3N9qduOnj573aFjmZqS4JSXolFzoFA4t5a4NBUF4NUlqDchqYIxl8mGN99z-=s64-c-k-c0x00ffffff-no-rj",
          "width": 64,
          "height": 64
        }
      ],
      "accessibility": {
        "accessibilityData": {
          "label": ""
        }
      }
    },
    "durationSec": 264,
    "showItemEndpoint": {
      "clickTrackingParams": "CCMQsMgEIhMImvyV4amligMVsJK5BR0uhiju",
      "commandMetadata": {
        "webCommandMetadata": {
          "ignoreNavigation": true
        }
      },
      "showLiveChatItemEndpoint": {
        "renderer": {
          "liveChatPaidMessageRenderer": {
            /* truncated */
          }
        },
        "trackingParams": "CCQQjtEGIhMImvyV4amligMVsJK5BR0uhiju"
      }
    },
    "authorExternalChannelId": "UCv55nnv26sizKp0hexHBFxQ",
    "fullDurationSec": 600,
    "trackingParams": "CCMQsMgEIhMImvyV4amligMVsJK5BR0uhiju",
    "authorUsername": {
      "simpleText": ""
    },
    "animationOrigin": "ANIMATION_ORIGIN_PDG_TICKER_LIKE",
    "openEngagementPanelCommand": {
      "clickTrackingParams": "CCMQsMgEIhMImvyV4amligMVsJK5BR0uhiju",
      "showEngagementPanelEndpoint": {
        "identifier": {
          "surface": "ENGAGEMENT_PANEL_SURFACE_LIVE_CHAT",
          "tag": "PAreply_thread"
        },
        "globalConfiguration": {
          "params": "ggmaAgojVWd6RWJQdWNPMzQwTmRMdXNtTjRBYUFCRHFnQjRNVGlsUUkSVgopKicKGFVDRUV3ZUZ0X2xQTk5UaXdTVTNaLS1qZxILNlRhbDZqcjhpUFkQARgEIAE6I1VnekViUHVjTzM0ME5kTHVzbU40QWFBQkRxZ0I0TVRpbFFJGmwIABgAIABKCBAAGAAgADAAULyPluGppYoDWAN4AKIBAKoBDBAAGgAiACoECAAQALABAMABAMgBvI-W4amligPiAQwIzezxugYQ3Om9nwHoAQDwAQD4AQCIAgCQAgCaAgwIzezxugYQ3Om9nwEiKSonChhVQ0VFd2VGdF9sUE5OVGl3U1UzWi0tamcSCzZUYWw2anI4aVBZKAEwAA%3D%3D"
        },
        "engagementPanelPresentationConfigs": {
          "engagementPanelPopupPresentationConfig": {
            "popupType": "PANEL_POPUP_TYPE_DIALOG"
          }
        }
      }
    }
  }
}

Example RawNode data 3:

{
  "liveChatTickerPaidMessageItemRenderer": {
    "id": "ChwKGkNMU00zWVBPN1lrREZkTW1yUVlkTDhvYVBR",
    "amountTextColor": 4278190080,
    "startBackgroundColor": 4280150454,
    "endBackgroundColor": 4278239141,
    "authorPhoto": {
      "thumbnails": [
        {
          "url": "https://yt4.ggpht.com/G-hGOyZsHea_YT1kmNcFTwySziduBvHqsx66jtVLh7t0910-lkWRlYSXNfyosvTQjzLqgV_Qtg=s32-c-k-c0x00ffffff-no-rj",
          "width": 32,
          "height": 32
        },
        {
          "url": "https://yt4.ggpht.com/G-hGOyZsHea_YT1kmNcFTwySziduBvHqsx66jtVLh7t0910-lkWRlYSXNfyosvTQjzLqgV_Qtg=s64-c-k-c0x00ffffff-no-rj",
          "width": 64,
          "height": 64
        }
      ],
      "accessibility": {
        "accessibilityData": {
          "label": "スーツノヒト"
        }
      }
    },
    "durationSec": 120,
    "showItemEndpoint": {
      "clickTrackingParams": "CAoQsMgEIhMIhvrd5JGoigMVYzR7Bx1jGgpX",
      "commandMetadata": {
        "webCommandMetadata": {
          "ignoreNavigation": true
        }
      },
      "showLiveChatItemEndpoint": {
        "renderer": {
          "liveChatPaidMessageRenderer": {
            /* truncated */
          }
        },
        "trackingParams": "CAsQjtEGIhMIhvrd5JGoigMVYzR7Bx1jGgpX"
      }
    },
    "authorExternalChannelId": "UCLA7zxhfjbNg7pjTg98Kwdw",
    "fullDurationSec": 120,
    "trackingParams": "CAoQsMgEIhMIhvrd5JGoigMVYzR7Bx1jGgpX",
    "authorUsername": {
      "simpleText": "スーツノヒト"
    },
    "animationOrigin": "ANIMATION_ORIGIN_PDG_TICKER_LIKE",
    "openEngagementPanelCommand": {
      "clickTrackingParams": "CAoQsMgEIhMIhvrd5JGoigMVYzR7Bx1jGgpX",
      "showEngagementPanelEndpoint": {
        "identifier": {
          "surface": "ENGAGEMENT_PANEL_SURFACE_LIVE_CHAT",
          "tag": "PAreply_thread"
        },
        "globalConfiguration": {
          "params": "ggm2AQojVWd4R0VjTmVRbVBHeExzVmJPQjRBYUFCRHFnQjVxZk1tQUkSVgopKicKGFVDMlpXZ2dvbjFOT1QyVEdhVlVNelk3QRILdVBJR2NLWVlnQlUQARgEIAE6I1VneEdFY05lUW1QR3hMc1ZiT0I0QWFBQkRxZ0I1cWZNbUFJGgggALABAPgBACIpKicKGFVDMlpXZ2dvbjFOT1QyVEdhVlVNelk3QRILdVBJR2NLWVlnQlUoATAB"
        },
        "engagementPanelPresentationConfigs": {
          "engagementPanelPopupPresentationConfig": {
            "popupType": "PANEL_POPUP_TYPE_DIALOG"
          }
        }
      }
    }
  }
}

* Change `duration_sec` property type from `string` to `number`
* Change `full_duration_sec` property type from `string` to `number`
* Handle the scenario where the author's name is represented as `authUsername`
* Mark `amount` property as optional
* Add `start_background_color` property
* Add `amount_text_color` property
* Add `end_background_color` property
* Add `animation_origin` property
* Add `open_engagement_panel_command` property
@LuanRT LuanRT merged commit 29e8d30 into LuanRT:main Dec 15, 2024
4 checks passed
@jonz94 jonz94 deleted the update-LiveChatTickerPaidMessageItem branch December 16, 2024 09:42
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.

2 participants