Compare commits

...

5 Commits

5 changed files with 76 additions and 0 deletions

View File

@@ -114,3 +114,9 @@ Our network analysis revealed that YouTube's web client uses a `POST` request to
**Prioritization:** All research will prioritize **open-source and Linux-compatible solutions**. Compliance with YouTube's Terms of Service remains a critical factor.
**Next Steps:** The findings from this revised research will be compiled into a structured document to inform the design and implementation of a robust YouTube Live Chat monitoring solution.
## Phase 5: Advanced Features
* **Objective:** Explore and implement advanced functionalities to enhance chat interaction and moderation.
* **Potential Ideas:**
1. **LLM for Message Moderation:** Integrate a Large Language Model (LLM) to spot-check incoming messages for potential bad actors, inappropriate content, or spam. This would involve sending chat messages to the LLM for analysis and taking automated or semi-automated actions based on its output.

View File

@@ -54,6 +54,38 @@ This document provides detailed instructions for setting up and running the `pyt
4. **Save Chat Log:**
To exit the script gracefully, press `Ctrl+C`. You will then be prompted if you want to save the chat log.
## Installation and Usage (Compiled Executable)
For users who prefer a standalone application without needing to install Python or manage dependencies, a compiled executable is available for Linux.
1. **Download the Executable:**
* Go to the [Gitea Releases page](https://gitea.ramforth.net/ramforth/youtube-chat-webhook-v2/releases).
* Download the `pytchat_listener` executable from the latest release (e.g., `v0.1.0-alpha`).
2. **Make Executable:**
* Open your terminal and navigate to the directory where you downloaded the executable.
* Make the file executable:
```bash
chmod +x pytchat_listener
```
3. **Run the Executable:**
* Execute the program directly:
```bash
./pytchat_listener
```
4. **Enter Video ID:**
* The program will prompt you to "Enter the YouTube Live Stream Video ID:". Paste the 11-character ID of the live stream you wish to monitor and press Enter.
5. **Observe Chat:**
* The program will then start fetching and displaying live chat messages in your terminal.
6. **Save Chat Log:**
* To exit the program gracefully, press `Ctrl+C`. You will then be prompted if you want to save the chat log.
**Note:** This executable is compiled for Linux. If you are on a different operating system (e.g., Windows, macOS), you will need to follow the "Installation Steps" above to run the script from source.
## User Colors Persistence (`user_colors.json`)
The script assigns unique, persistent colors to chatters. This mapping is stored in a file named `user_colors.json` in the project directory.
@@ -61,3 +93,14 @@ The script assigns unique, persistent colors to chatters. This mapping is stored
* If this file does not exist, it will be created automatically.
* If it exists, the script will load the previously assigned colors.
* You can manually edit this file to change a user's color or reset the mapping.
## YouTube API Authentication (Optional)
For the core functionality of fetching live chat using `pytchat`, explicit YouTube Data API v3 authentication (e.g., API keys or OAuth 2.0 credentials) is **not required**. `pytchat` leverages an internal YouTube API endpoint that does not necessitate these credentials for public live chat streams.
However, if you plan to extend this project to interact with other YouTube Data API v3 services (e.g., managing videos, accessing private data, or performing actions that require user authorization), you will need to set up API credentials. You can find detailed instructions on how to obtain and configure these credentials in the official Google Cloud documentation:
* [Google Cloud Console - Credentials](https://console.cloud.google.com/apis/credentials)
* [YouTube Data API v3 Overview](https://developers.google.com/youtube/v3)
For Python projects, you would typically use libraries like `google-auth-oauthlib` and `google-api-python-client` to handle authentication and API interactions.

View File

@@ -34,3 +34,11 @@ For detailed installation and usage instructions, please refer to the [INSTALLAT
* Interactive message sending.
* More advanced terminal UI (e.g., `prompt_toolkit` for input).
* Web overlay integration.
## License
This project is licensed under the MIT License.
## Contributors
* [Matt North](https://www.youtube.com/channel/UCaSAujYjLliDCkwODH2z5vg)

View File

@@ -151,6 +151,10 @@ def main():
except Exception as e:
console.print(f"[red]An error occurred: {e}[/red]")
finally:
global _stop_input_thread
_stop_input_thread = True # Signal the input thread to stop
# input_thread.join() # Optionally wait for the input thread to finish, but daemon=True makes it optional
log_file.close()
save_log = input(f"\nDo you want to save the chat log to {log_filename}? (y/n): ").lower()
if save_log != 'y' and save_log != 'yes':

15
user_colors.json Normal file
View File

@@ -0,0 +1,15 @@
{
"UCR12saiy07zwHngHGRPElPA": "#FF8000",
"UCUN25adHEN3RsJv5zG5q-NA": "#6600CC",
"UCnQp1K5xb4BwkQcgGWLDgXg": "#CCCC00",
"UCHKOdAXNoqWigv68Akl2tfQ": "#FFFF00",
"UCzGyNkYAsiz44Y2j_Sow-Cg": "#FF00FF",
"UCB-9oxvzRaKE7nXTjlxGVuw": "#800080",
"UCFEBDP1nhQvSfCM-jwzRYYg": "#FFC0CB",
"UCqWPyox1YcGyLvd5diOHQzQ": "#008080",
"UChYWkaRhR6QjpPg89QEH9dw": "#800000",
"UCM_70tWxaeehPw_muaS8ViA": "#FFD700",
"UCaSAujYjLliDCkwODH2z5vg": "#FF69B4",
"UCZ5WJG7fitlL0lru5yW4Nbw": "#00FF00",
"UCQy5619DyyQ0wktqB_RnXzw": "#FFA500"
}