From 128d06edd160d2fd0bd9c4458d473ee03905673f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=B3=E9=88=9E?= Date: Sun, 3 Dec 2023 07:05:29 +0800 Subject: [PATCH] docs: Add English readme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add .prettierrc file with overrides for markdown files - Add .vscode/settings.json file with cSpell words - Add README-zh.md file with translated content - Update README.md file with translated content Signed-off-by: 陳鈞 --- .prettierrc | 11 ++++++++ .vscode/settings.json | 6 +++++ README.md | 51 ++++++++++++++++++++---------------- README.zh.md | 60 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 106 insertions(+), 22 deletions(-) create mode 100644 .prettierrc create mode 100644 .vscode/settings.json create mode 100644 README.zh.md diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..ea6f621 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,11 @@ +{ + "overrides": [ + { + "files": ["*.md"], + "options": { + "tabWidth": 2, + "useTabs": false + } + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c9c5a54 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "cSpell.words": [ + "cooldown", + "youtubelivechattodiscord" + ] +} \ No newline at end of file diff --git a/README.md b/README.md index 70e8e26..25c3357 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,44 @@ # YoutubeLiveChatToDiscord -## 將Youtube聊天室串流至Discord Webhook +## Stream Youtube chat to Discord Webhook -|Youtube Live Chat|| Discord Webhook | -|:-:|:-:|:-:| -|![image](https://user-images.githubusercontent.com/16995691/151545455-af26cbe6-0942-464a-b15e-76ca67dfa142.png) |➡️| ![image](https://user-images.githubusercontent.com/16995691/151438025-d0c4a2de-6845-4d64-93db-89afb2f98e45.png)| -|![image](https://user-images.githubusercontent.com/16995691/151545035-0dfc65e3-41a4-4342-b0c4-178b53a077d6.png) |➡️| ![image](https://user-images.githubusercontent.com/16995691/151545242-651cdbd1-ae8c-4a47-acda-7b9a3b4f59ba.png)| -|![image](https://user-images.githubusercontent.com/16995691/151663570-999a5c8c-a336-407e-906a-56399530417b.png) |➡️| ![image](https://user-images.githubusercontent.com/16995691/151663574-dc5abbc2-cb5d-4e40-a4ce-bfc39f2a7029.png) +| Youtube Live Chat | | Discord Webhook | +| :-------------------------------------------------------------------------------------------------------------: | :-: | :-------------------------------------------------------------------------------------------------------------: | +| ![image](https://user-images.githubusercontent.com/16995691/151545455-af26cbe6-0942-464a-b15e-76ca67dfa142.png) | ➡️ | ![image](https://user-images.githubusercontent.com/16995691/151438025-d0c4a2de-6845-4d64-93db-89afb2f98e45.png) | +| ![image](https://user-images.githubusercontent.com/16995691/151545035-0dfc65e3-41a4-4342-b0c4-178b53a077d6.png) | ➡️ | ![image](https://user-images.githubusercontent.com/16995691/151545242-651cdbd1-ae8c-4a47-acda-7b9a3b4f59ba.png) | +| ![image](https://user-images.githubusercontent.com/16995691/151663570-999a5c8c-a336-407e-906a-56399530417b.png) | ➡️ | ![image](https://user-images.githubusercontent.com/16995691/151663574-dc5abbc2-cb5d-4e40-a4ce-bfc39f2a7029.png) | -- 不適合用在有大量留言的狀況,此工具是設計來監控 FreeChat\ - 此工具最高每兩秒打一次 discord webhook ,可能造成轉送速度跟不上留言速度 - > Discord 方面的限制為,同一頻道中每分鐘可呼叫 Webhook 30次 [ref](https://twitter.com/lolpython/status/967621046277820416)\ - > 若同時啟動複數此工具並推送至同一個頻道,很容易觸發Discord冷卻,請留意你的使用環境 -- 底層使用 yt-dlp 來抓資料,並不是 youtube api ,沒有額度問題 -- 此工具在閒置時,讀取 yt-dlp 寫的 json 檔案間隔為10秒 -- 啟動時會等待1分鐘,使 yt-dlp 下載舊留言,再由此開始監控 - > 如果要跳過此1分鐘,請傳入環境變數`SKIP_STARTUP_WAITING` -- 在程式同一層若存在名為`cookies.txt`的檔案,就會讀入yt-dlp,使能在會員限定直播間使用 +

+ English | + + 中文 + +

-## 會員限定(需登入)的影片 +- Not appropriate for scenarios with a high message speed. This tool is designed to monitor FreeChat. + This tool sends a discord webhook every two seconds at most, which may cause the forwarding speed to not keep up with the comment speed. + > Discord's limitation is that Webhooks can be called 30 times per minute in the same channel [ref](https://twitter.com/lolpython/status/967621046277820416). + > If multiple instances of this tool are activated and pushed to the same channel at the same time, it is easy to trigger Discord cooldown. Please pay attention to your usage environment. +- The underlying data retrieval uses yt-dlp instead of YouTube API, so there are no API quota issues. +- When idle, this tool reads the json file written by yt-dlp every 10 seconds. +- Upon startup, it waits for 1 minute for yt-dlp to download old comments before starting monitoring from there. + > To skip this 1-minute waiting period, please pass the environment variable `SKIP_STARTUP_WAITING`. +- If a file named `cookies.txt` exists in the same directory as the program, it will be automatically imported into yt-dlp to used for membership live streaming. -在程式的執行目錄若存在名為`cookies.txt`的檔案,就會將之讀入yt-dlp +## Membership (login required) videos -Docker請將`cookies.txt` mount 至 `/app/cookies.txt` +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 -> 請參考`docker-compose.yml` +> Please refer to `docker-compose.yml`. -需傳入兩個參數 +Two parameters need to be passed in: -- 影片ID -- Discord Webhook網址 +- Video ID +- Discord Webhook URL ```sh docker run -rm ghcr.io/jim60105/youtubelivechattodiscord [Video_Id] [Discord_Webhook_Url] diff --git a/README.zh.md b/README.zh.md new file mode 100644 index 0000000..8a667b2 --- /dev/null +++ b/README.zh.md @@ -0,0 +1,60 @@ +# YoutubeLiveChatToDiscord + +## 將 Youtube 聊天室串流至 Discord Webhook + +| Youtube Live Chat | | Discord Webhook | +| :-------------------------------------------------------------------------------------------------------------: | :-: | :-------------------------------------------------------------------------------------------------------------: | +| ![image](https://user-images.githubusercontent.com/16995691/151545455-af26cbe6-0942-464a-b15e-76ca67dfa142.png) | ➡️ | ![image](https://user-images.githubusercontent.com/16995691/151438025-d0c4a2de-6845-4d64-93db-89afb2f98e45.png) | +| ![image](https://user-images.githubusercontent.com/16995691/151545035-0dfc65e3-41a4-4342-b0c4-178b53a077d6.png) | ➡️ | ![image](https://user-images.githubusercontent.com/16995691/151545242-651cdbd1-ae8c-4a47-acda-7b9a3b4f59ba.png) | +| ![image](https://user-images.githubusercontent.com/16995691/151663570-999a5c8c-a336-407e-906a-56399530417b.png) | ➡️ | ![image](https://user-images.githubusercontent.com/16995691/151663574-dc5abbc2-cb5d-4e40-a4ce-bfc39f2a7029.png) | + +

+ + English + | + 中文 +

+ +* 不適合用在有大量留言的狀況,此工具是設計來監控 FreeChat + 此工具最高每兩秒打一次 discord webhook ,可能造成轉送速度跟不上留言速度 + > Discord 方面的限制為,同一頻道中每分鐘可呼叫 Webhook 30 次 [ref](https://twitter.com/lolpython/status/967621046277820416) + > 若同時啟動複數此工具並推送至同一個頻道,很容易觸發 Discord 冷卻,請留意你的使用環境 +* 底層使用 yt-dlp 來抓資料,並不是 youtube api ,沒有 API 額度問題 +* 此工具在閒置時,讀取 yt-dlp 寫的 json 檔案間隔為 10 秒 +* 啟動時會等待 1 分鐘,使 yt-dlp 下載舊留言,再由此開始監控 + > 如果要跳過此 1 分鐘,請傳入環境變數 `SKIP_STARTUP_WAITING` +* 在程式同一層若存在名為 `cookies.txt` 的檔案,就會讀入 yt-dlp,使能在會員限定直播使用 + +## 會員限定 (需登入) 的影片 + +在程式的執行目錄若存在名為 `cookies.txt` 的檔案,它會自動使用 + +Docker 請將 `cookies.txt` mount 至 `/app/cookies.txt` + +## Docker + +> 請參考 `docker-compose.yml` + +需傳入兩個參數 + +* 影片 ID +* Discord Webhook 網址 + +```sh +docker run -rm ghcr.io/jim60105/youtubelivechattodiscord [Video_Id] [Discord_Webhook_Url] +``` + +也可在[quay.io](https://quay.io/jim60105/youtubelivechattodiscord)取得。 + +## Kubernetes Helm Chart + +```sh +git clone https://github.com/jim60105/YoutubeLiveChatToDiscord.git +cd YoutubeLiveChatToDiscord/helm-chart +vim values.yaml +helm install [Release_Name] . +``` + +### Timezone + +預設時區為 `Asia/Taipei`。請使用 `TZ` 環境變數進行更改。