Skip to content

Stream Youtube Chat to Discord Webhook (.NET 8 Worker Service in Docker)

License

Notifications You must be signed in to change notification settings

jim60105/YoutubeLiveChatToDiscord

Repository files navigation

Youtube Live Chat To Discord

CodeFactor FOSSA Status

Caution

Please take note of the AGPLv3 license that we are using.
You MUST share the source code with anyone who can access the services (service, which means the Discord messages published by this program).
Share the URL of this GitHub repository, or publish the modified source code if any changes were made.

Stream Youtube chat to Discord Webhook

Youtube Live Chat Discord Webhook
image ➡️ image
image ➡️ image
image ➡️ image
image ➡️ image
image ➡️ image
image ➡️ image

English | 中文

  • The underlying implementation uses yt-dlp instead of the YouTube API, so there is no API quota limit.
  • When this tool is idle, it reads the JSON file generated by yt-dlp every 10 seconds.
  • Upon startup, it waits for 1 minute to skip old chats before starting monitoring.

    If you want to skip this waiting and start immediately, please pass the environment variable SKIP_STARTUP_WAITING.

  • It can monitor membership-only live streams by automatically detect and import the cookies.txt file in the execution directory into yt-dlp.
  • It is not suitable for for scenarios with a high message speed. It sends a maximum of one Discord webhook every two seconds, which may cause delays if the new chat speed exceeds the forwarding speed.

    Discord has a limitation that allows calling webhooks up to 30 times per minute in the same channel ref.
    If multiple instances of this tool are simultaneously running and pushed to the same channel, it's easy to trigger Discord cooldown. Please be aware of your usage environment.

Membership-only (login required) videos

If a file named cookies.txt exists in the program's execution directory, it will be used automatically.

For Docker, please mount cookies.txt to /app/cookies.txt.

Docker

Please refer to docker-compose.yml.

Two parameters need to be passed in:

  • Video ID
  • Discord Webhook URL
docker run --rm ghcr.io/jim60105/youtubelivechattodiscord [Video_Id] [Discord_Webhook_Url]

Also available at quay.io

Kubernetes Helm Chart

git clone https://github.com/jim60105/YoutubeLiveChatToDiscord.git
cd YoutubeLiveChatToDiscord/helm-chart
vim values.yaml
helm install [Release_Name] .

Timezone

Default timezone is Asia/Taipei. Please change it with TZ environment variable.

LICENSE

AGPL-3.0

GNU AFFERO GENERAL PUBLIC LICENSE Version 3

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Caution

Please take note of the AGPLv3 license that we are using.
You MUST share the source code with anyone who can access the services (the Discord messages published by this program).
Share the URL of this GitHub repository, or publish the modified source code if any changes were made.