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): Add LiveChatBannerRedirect node #799

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

jonz94
Copy link
Contributor

@jonz94 jonz94 commented Nov 13, 2024

Add a new parser for the live chat node that appears when a streamer redirects their viewers to another channel’s live stream.

Example RawNode data 1:

{
  "liveChatBannerRedirectRenderer": {
    "bannerMessage": {
      "runs": [
        {
          "text": "Don't miss out! People are going to watch something from ",
          "textColor": 4294967295,
          "fontFace": "FONT_FACE_ROBOTO_REGULAR"
        },
        {
          "text": "洛可洛斯特Loco Lost",
          "bold": true,
          "textColor": 4294967295,
          "fontFace": "FONT_FACE_ROBOTO_REGULAR"
        }
      ]
    },
    "authorPhoto": {
      "thumbnails": [
        {
          "url": "https://yt4.ggpht.com/ytc/AIdro_nIvJCRqMHTDI2MJ74WX4bOCARktdMS6uHDR4TDh7Y7LA=s32-c-k-c0x00ffffff-no-rj",
          "width": 32,
          "height": 32
        },
        {
          "url": "https://yt4.ggpht.com/ytc/AIdro_nIvJCRqMHTDI2MJ74WX4bOCARktdMS6uHDR4TDh7Y7LA=s64-c-k-c0x00ffffff-no-rj",
          "width": 64,
          "height": 64
        }
      ]
    },
    "inlineActionButton": {
      "buttonRenderer": {
        "style": "STYLE_DEFAULT",
        "size": "SIZE_DEFAULT",
        "isDisabled": false,
        "text": {
          "runs": [
            {
              "text": "Go now"
            }
          ]
        },
        "command": {
          "commandMetadata": {
            "webCommandMetadata": {
              "url": "/watch?v=U9xhA27lySE",
              "webPageType": "WEB_PAGE_TYPE_WATCH",
              "rootVe": 3832
            }
          },
          "watchEndpoint": {
            "videoId": "U9xhA27lySE"
          }
        }
      }
    },
    "contextMenuButton": {
      "buttonRenderer": {
        "icon": {
          "iconType": "MORE_VERT"
        },
        "accessibility": {
          "label": "Chat actions"
        },
        "accessibilityData": {
          "accessibilityData": {
            "label": "Chat actions"
          }
        },
        "command": {
          "commandMetadata": {
            "webCommandMetadata": {
              "ignoreNavigation": true
            }
          },
          "liveChatItemContextMenuEndpoint": {
            "params": "Q2g0S0hBb2FRMUJIY1RWTExXTXdiMnRFUm1KWVFXeEJhMlJGWlVGNWJsRWFLU29uQ2hoVlF6SmFWMmRuYjI0eFRrOVVNbFJIWVZaVlRYcFpOMEVTQzNSWlNUVXROR05uYmxWRklBRW9CRElFRWdJSUJqZ0JTQUJRSlElM0QlM0Q="
          }
        }
      }
    }
  }
}

Example RawNode data 2:

{
  "liveChatBannerRedirectRenderer": {
    "bannerMessage": {
      "runs": [
        {
          "text": "月下香幽芳YuFang",
          "bold": true,
          "textColor": 4294967295,
          "fontFace": "FONT_FACE_ROBOTO_REGULAR"
        },
        {
          "text": " and their viewers just joined. Say hello!",
          "textColor": 4294967295,
          "fontFace": "FONT_FACE_ROBOTO_REGULAR"
        }
      ]
    },
    "authorPhoto": {
      "thumbnails": [
        {
          "url": "https://yt4.ggpht.com/tZEv92rwBhgCfVl6Ya6boBLS8soE7nzVA8xoH9VTqVr-BTonJn3CY8Geqdzk9vD2ESBQ6yC0TNk=s32-c-k-c0x00ffffff-no-rj",
          "width": 32,
          "height": 32
        },
        {
          "url": "https://yt4.ggpht.com/tZEv92rwBhgCfVl6Ya6boBLS8soE7nzVA8xoH9VTqVr-BTonJn3CY8Geqdzk9vD2ESBQ6yC0TNk=s64-c-k-c0x00ffffff-no-rj",
          "width": 64,
          "height": 64
        }
      ]
    },
    "inlineActionButton": {
      "buttonRenderer": {
        "style": "STYLE_DEFAULT",
        "size": "SIZE_DEFAULT",
        "isDisabled": false,
        "text": {
          "runs": [
            {
              "text": "Learn more"
            }
          ]
        },
        "trackingParams": "CCUQ8FsiEwjtsqzwob2JAxVZo9gFHaUOGto=",
        "command": {
          "clickTrackingParams": "CCUQ8FsiEwjtsqzwob2JAxVZo9gFHaUOGto=",
          "commandMetadata": {
            "webCommandMetadata": {
              "url": "https://support.google.com/youtube/answer/10359590?hl=en",
              "webPageType": "WEB_PAGE_TYPE_UNKNOWN",
              "rootVe": 83769
            }
          },
          "urlEndpoint": {
            "url": "https://support.google.com/youtube/answer/10359590?hl=en",
            "target": "TARGET_NEW_WINDOW"
          }
        }
      }
    },
    "contextMenuButton": {
      "buttonRenderer": {
        "icon": {
          "iconType": "MORE_VERT"
        },
        "accessibility": {
          "label": "Chat actions"
        },
        "trackingParams": "CCQQ8FsiEwjtsqzwob2JAxVZo9gFHaUOGto=",
        "accessibilityData": {
          "accessibilityData": {
            "label": "Chat actions"
          }
        },
        "command": {
          "clickTrackingParams": "CCQQ8FsiEwjtsqzwob2JAxVZo9gFHaUOGto=",
          "commandMetadata": {
            "webCommandMetadata": {
              "ignoreNavigation": true
            }
          },
          "liveChatItemContextMenuEndpoint": {
            "params": "Q2g0S0hBb2FRMDVwY0hkT1MyaDJXV3RFUmxKcVRUUjNZMlEzVjJNNGJGRWFLU29uQ2hoVlEzVlFTR3hOUldRd1kxSXRkSFpCV1ZCcVIxZFdkMUVTQzBvd1JEbEpOR2t4VTNsbklBRW9CRElFRWdJSUJqZ0JTQUJRSmclM0QlM0Q="
          }
        }
      }
    }
  }
}

@LuanRT LuanRT merged commit ad302b8 into LuanRT:main Nov 15, 2024
4 checks passed
@jonz94 jonz94 deleted the add-LiveChatBannerRedirect branch November 17, 2024 09:53
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