A lightweight IRC bot that provides real-time YouTube video information and search capabilities using the YouTube Data API. YouTubeBot is designed to be simple to set up, easy to configure, and free to use as it relies on the free YouTube Data API service (up to a certain quota limit).
Join us on MansionNET IRC to chat with us, test the bot, and discover new YouTube content!
🌐 Server: irc.inthemansion.com 🔒 Port: 6697 (SSL) 📝 Channels: #opers, #general, #welcome, #music, #heavy_metal, #devs, #test_room, #lobby
- Automatically detects YouTube video links shared in the chat and responds with:
- Video title
- Channel name
- View count
- Like count
- Allows users to search for YouTube videos using the
!yt search <query>
command - Allows users to retrieve information about a YouTube channel using the
!yt channel <name>
command - Supports multiple IRC channels
- Utilizes YouTube Data API for video and channel information
- SSL/TLS support for secure IRC connections
- Easy to configure and customize
- Python 3.6 or higher
irc
library for IRC client functionalitygoogle-api-python-client
library for YouTube Data API integration- YouTube Data API key
-
Clone the repository:
git clone https://github.com/MansionNET/YouTubeBot.git cd YouTubeBot
-
Create and activate a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Obtain a YouTube Data API key:
- Go to the Google Developers Console
- Create a new project or select an existing one
- Enable the YouTube Data API v3
- Create an API key
-
Create a
config.py
file in the project directory with the following content:YOUTUBE_API_KEY = 'YOUR_API_KEY'
Replace
'YOUR_API_KEY'
with your actual YouTube Data API key.
Start the bot:
python youtubebot.py
In any channel where the bot is present:
!yt search <query>
- Search for YouTube videos based on the provided query- Example:
!yt search funny cat videos
- Example:
!yt channel <name>
- Retrieve information about a YouTube channel with the specified name- Example:
!yt channel PewDiePie
- Example:
!yt help
- Display available commands
YouTubeBot uses the YouTube Data API v3 for video and channel information. An API key is required, and you must comply with the YouTube API Services Terms of Service.
Please be aware of the API usage limits and quotas to avoid exceeding them.
Contributions are welcome! Please read our Contributing Guide for details on how to submit pull requests, report issues, and contribute to the project.
This project is licensed under the MIT License - see the LICENSE file for details.
- YouTube for providing the YouTube Data API
- The IRC community for continued support of the protocol
This project is actively maintained. If you encounter any issues or have suggestions, please open an issue on GitHub.