{"id":35263187,"url":"https://github.com/agash/ytlivechat","last_synced_at":"2026-04-02T15:46:17.854Z","repository":{"id":237385752,"uuid":"794426035","full_name":"Agash/YTLiveChat","owner":"Agash","description":"InnerTube API for YouTube LiveChat to get Live Chat messages without API restrictions. Mainly intended for use in application for the streamer.","archived":false,"fork":false,"pushed_at":"2026-02-16T20:08:23.000Z","size":274,"stargazers_count":16,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-17T02:11:09.382Z","etag":null,"topics":["innertube","poketuber","youtube-api","youtube-live-chat","youtube-plays","ytplays"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/Agash.YTLiveChat/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Agash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["Agash"]}},"created_at":"2024-05-01T06:05:44.000Z","updated_at":"2026-02-16T20:07:15.000Z","dependencies_parsed_at":"2024-06-02T07:26:50.105Z","dependency_job_id":"730d79ca-1cae-444e-a8e3-de9b525b3c9a","html_url":"https://github.com/Agash/YTLiveChat","commit_stats":null,"previous_names":["agash/ytlivechat"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/Agash/YTLiveChat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agash%2FYTLiveChat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agash%2FYTLiveChat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agash%2FYTLiveChat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agash%2FYTLiveChat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Agash","download_url":"https://codeload.github.com/Agash/YTLiveChat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agash%2FYTLiveChat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29706572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T05:59:28.568Z","status":"ssl_error","status_checked_at":"2026-02-22T05:58:46.208Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["innertube","poketuber","youtube-api","youtube-live-chat","youtube-plays","ytplays"],"created_at":"2025-12-30T09:31:42.471Z","updated_at":"2026-04-02T15:46:17.841Z","avatar_url":"https://github.com/Agash.png","language":"C#","funding_links":["https://github.com/sponsors/Agash"],"categories":[],"sub_categories":[],"readme":"# YTLiveChat\n\nUnofficial .NET library for reading YouTube live chat via InnerTube (the same web-facing surface YouTube uses), without Data API quotas or OAuth setup.\n\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/Agash/YTLiveChat/publish.yml?style=flat-square\u0026logo=github\u0026logoColor=white)](https://github.com/Agash/YTLiveChat/actions)\n[![NuGet Version](https://img.shields.io/nuget/v/Agash.YTLiveChat.DependencyInjection.svg?style=flat-square\u0026logo=nuget\u0026logoColor=white)](https://www.nuget.org/packages/Agash.YTLiveChat.DependencyInjection/)\n[![NuGet Version](https://img.shields.io/nuget/v/Agash.YTLiveChat.svg?style=flat-square\u0026logo=nuget\u0026logoColor=white)](https://www.nuget.org/packages/Agash.YTLiveChat/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)\n\n## Targets\n\n- `net10.0`\n- `netstandard2.1`\n- `netstandard2.0`\n\n## Install\n\nCore package:\n\n```bash\ndotnet add package Agash.YTLiveChat\n```\n\nWith DI helpers:\n\n```bash\ndotnet add package Agash.YTLiveChat.DependencyInjection\n```\n\n## What You Get\n\n- Chat messages (`liveChatTextMessageRenderer`)\n- Super Chats / Super Stickers with parsed amount + currency\n- Membership events (new/milestone/gift purchase/gift redemption)\n- Ticker support (`addLiveChatTickerItemAction`) including:\n  - ticker paid messages\n  - ticker membership items\n  - ticker gift purchase announcements\n- Viewer leaderboard rank extraction (YouTube points crown tags like `#1`)\n- Raw InnerTube action access (`RawActionReceived`) including unsupported actions\n- Async streaming APIs (`StreamChatItemsAsync`, `StreamRawActionsAsync`)\n\n## Important Caveats\n\n- This is an unofficial parser over YouTube’s internal schema. Payloads can change at any time.\n- This library reads chat only (no sending messages).\n- Respect request frequency to avoid rate limits or temporary blocks.\n\n## Beta API Notice\n\nContinuous livestream monitor mode is currently **BETA/UNSUPPORTED** and can change or break at any time:\n\n- `YTLiveChatOptions.EnableContinuousLivestreamMonitor`\n- `YTLiveChatOptions.LiveCheckFrequency`\n- `IYTLiveChat.LivestreamStarted`\n- `IYTLiveChat.LivestreamEnded`\n- `IYTLiveChat.LivestreamInaccessible`\n\nThese members intentionally emit compiler warnings via `[Obsolete]` to signal unstable API status.\n\nMonitor note: channel/watch page resolution is fetched via stateless (no-cookie) requests inside the library to reduce consent-interstitial loops during long-running monitor sessions.\n\n## Quick Start (DI)\n\n```csharp\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Hosting;\nusing YTLiveChat.Contracts;\nusing YTLiveChat.Contracts.Services;\nusing YTLiveChat.DependencyInjection;\n\nHostApplicationBuilder builder = Host.CreateApplicationBuilder(args);\nbuilder.Services.AddYTLiveChat(builder.Configuration);\n\nbuilder.Services.Configure\u003cYTLiveChatOptions\u003e(options =\u003e\n{\n    options.RequestFrequency = 1000;\n    options.DebugLogReceivedJsonItems = true;\n    options.DebugLogFilePath = \"logs/ytlivechat_debug.json\";\n});\n\nbuilder.Services.AddHostedService\u003cChatWorker\u003e();\nawait builder.Build().RunAsync();\n```\n\nWorker example:\n\n```csharp\nusing YTLiveChat.Contracts.Models;\nusing YTLiveChat.Contracts.Services;\n\npublic sealed class ChatWorker(IYTLiveChat chat) : IHostedService\n{\n    public Task StartAsync(CancellationToken ct)\n    {\n        chat.InitialPageLoaded += (_, e) =\u003e Console.WriteLine($\"Loaded: {e.LiveId}\");\n        chat.ChatReceived += (_, e) =\u003e HandleChat(e.ChatItem);\n        chat.RawActionReceived += (_, e) =\u003e\n        {\n            if (e.ParsedChatItem is null)\n            {\n                // Unsupported action still available here\n                Console.WriteLine(\"RAW action received.\");\n            }\n        };\n        chat.ChatStopped += (_, e) =\u003e Console.WriteLine($\"Stopped: {e.Reason}\");\n        chat.ErrorOccurred += (_, e) =\u003e Console.WriteLine($\"Error: {e.GetException().Message}\");\n\n        chat.Start(handle: \"@channelHandle\");\n        return Task.CompletedTask;\n    }\n\n    public Task StopAsync(CancellationToken ct)\n    {\n        chat.Stop();\n        return Task.CompletedTask;\n    }\n\n    private static void HandleChat(ChatItem item)\n    {\n        // inspect item.Superchat / item.MembershipDetails / item.ViewerLeaderboardRank / item.IsTicker\n    }\n}\n```\n\n## Async Streaming APIs\n\n```csharp\nawait foreach (ChatItem item in chat.StreamChatItemsAsync(handle: \"@channel\", cancellationToken: ct))\n{\n    Console.WriteLine($\"{item.Author.Name}: {string.Join(\"\", item.Message.Select(ToText))}\");\n}\n\nawait foreach (RawActionReceivedEventArgs raw in chat.StreamRawActionsAsync(liveId: \"videoId\", cancellationToken: ct))\n{\n    if (raw.ParsedChatItem is null)\n    {\n        Console.WriteLine(raw.RawAction.ToString());\n    }\n}\n\nstatic string ToText(MessagePart part) =\u003e part switch\n{\n    TextPart t =\u003e t.Text,\n    EmojiPart e =\u003e e.EmojiText ?? e.Alt ?? \"\",\n    _ =\u003e \"\"\n};\n```\n\n## Raw JSON Capture for Schema Analysis\n\nEnable:\n\n```csharp\noptions.DebugLogReceivedJsonItems = true;\noptions.DebugLogFilePath = \"logs/ytlivechat_debug.json\";\n```\n\nThe file is written as a valid JSON array, so it is directly parseable by tools/scripts.\n\n## Example App\n\n`YTLiveChat.Example` includes:\n\n- UTF-8 console setup for multilingual output\n- colorized one-line TUI rendering\n- rank/ticker/membership/superchat tagging\n- unsupported raw action hints\n- optional raw JSON capture prompt\n- optional continuous monitor mode prompt (beta)\n\n## Current Schema Coverage Gaps\n\n- Poll update/action-panel payloads are captured in tests as raw fixtures, but not yet projected into first-class contracts.\n- Creator goals are not mapped yet (awaiting enough stable raw samples).\n\n## Contributing\n\nBug reports and raw payload samples are highly valuable.  \nIf you add parser support for new payloads, include:\n\n- response model updates in `YTLiveChat/Models/Response/LiveChatResponse.cs`\n- parser updates in `YTLiveChat/Helpers/Parser.cs`\n- tests + fixtures in `YTLiveChat.Tests`\n\n## License\n\nMIT. See `LICENSE.txt`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagash%2Fytlivechat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagash%2Fytlivechat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagash%2Fytlivechat/lists"}