Updated chat info scraper to match rumble website update

This commit is contained in:
tyler 2024-05-31 11:26:07 -04:00
parent a4125e8de8
commit 6bcc437bc0

View file

@ -88,11 +88,11 @@ func (c *Client) getChatInfo() (*ChatInfo, error) {
return nil, fmt.Errorf("error finding end of chat function in webpage") return nil, fmt.Errorf("error finding end of chat function in webpage")
} }
args := parseRumbleChatArgs(lineS[start : start+end]) args := parseRumbleChatArgs(lineS[start : start+end])
channelID, err := strconv.Atoi(args[5]) channelID, err := strconv.Atoi(args[6])
if err != nil { if err != nil {
return nil, fmt.Errorf("error converting channel ID argument string to int: %v", err) return nil, fmt.Errorf("error converting channel ID argument string to int: %v", err)
} }
chatInfo = &ChatInfo{ChannelID: channelID, ChatID: args[1], UrlPrefix: args[0]} chatInfo = &ChatInfo{ChannelID: channelID, ChatID: args[2], UrlPrefix: args[0]}
} else if strings.Contains(lineS, "media-by--a") && strings.Contains(lineS, "author") { } else if strings.Contains(lineS, "media-by--a") && strings.Contains(lineS, "author") {
r := strings.NewReader(lineS) r := strings.NewReader(lineS)
node, err := html.Parse(r) node, err := html.Parse(r)