Git Product home page Git Product logo

youtubelivechattodiscord's Introduction

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.

youtubelivechattodiscord's People

Contributors

jim60105 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

youtubelivechattodiscord's Issues

Docker usage and yt-dlp complains about Bad Request, is yt-dlp too old?

I was trying to use this script with the direct copy paste line:
docker run --rm ghcr.io/jim60105/youtubelivechattodiscord [Video_Id] [Discord_Webhook_Url]

It tries several times these checks and ultimately fails:

fail: YoutubeLiveChatToDiscord.Services.LiveChatDownloadService[0]
WARNING: [youtube] YouTube said: ERROR - Precondition check failed.

WARNING: [youtube] Unable to download API page: HTTP Error 400: Bad Request (caused by <HTTPError 400: Bad Request>); 
please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. 
Confirm you are on the latest version using  yt-dlp -U

I used to get same kind of errors when yt-dlp wasn't updated on the host machine when using the same yt-dlp for other purposes.
What could be the solution or should updated yt-dlp somehow be included in the docker?

Unhandled message types

Handled

markChatItemAsDeletedAction

 {"replayChatItemAction": {"actions": [{"markChatItemAsDeletedAction": {"deletedStateMessage": {"runs": [{"text": "[message retracted]"}]}, "targetItemId": "ALOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONGID"}}]}, "videoOffsetTimeMsec": "457482433", "isLive": true}

liveChatModeChangeMessageRenderer

{"replayChatItemAction": {"actions": [{"addChatItemAction": {"item": {"liveChatModeChangeMessageRenderer": {"id": "ChwKGkNMVE4tN251OV9jQ0ZRWU1yUVlkZzNzREFR", "timestampUsec": "1653385900049121", "icon": {"iconType": "TAB_SUBSCRIPTIONS"}, "text": {"runs": [{"text": "Kakeru Ch. 間取かける", "bold": true}, {"text": " turned on subscribers-only mode", "bold": true}]}, "subtext": {"runs": [{"text": "Only channel subscribers of ", "italics": true}, {"text": "24 hours", "italics": true}, {"text": " or longer can send messages", "italics": true}]}}}}}]}, "videoOffsetTimeMsec": "1323923524", "isLive": true}

SC Sticker動圖不顯示

image
該不顯示的圖片網址: https://lh3.googleusercontent.com/F9hYM8LBLkP2zc_eoSPntXri750IJMttj2tyyaUQmpa-4tVqV0nyqQsozgcXYYtW8se6FVieYzfINOO2VF7b=s288-rwa
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.