Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vishishtkapoor/youtubeanalytics
This Python-based project aims to fetch real-time YouTube metrics
https://github.com/vishishtkapoor/youtubeanalytics
python
Last synced: 10 days ago
JSON representation
This Python-based project aims to fetch real-time YouTube metrics
- Host: GitHub
- URL: https://github.com/vishishtkapoor/youtubeanalytics
- Owner: vishishtkapoor
- Created: 2024-08-06T13:52:13.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-08-06T13:56:50.000Z (6 months ago)
- Last Synced: 2024-11-17T21:20:34.829Z (2 months ago)
- Topics: python
- Language: HTML
- Homepage:
- Size: 8.78 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Real-Time YouTube Analytics Streamed to Telegram
This Python-based project aims to fetch real-time YouTube metrics like likes, views, comments, and favorites, and then streams this data via Kafka.
Also, KSqlDB was used for stream processing and the processed data is then sent to a Telegram bot for real-time notifications.## Requirements
- Python 3.10 (minimum)
- Kafka
- Telegram API
- Docker
- Confluent Containers (Zookeeper, Kafka, Schema Registry, Connect, ksqlDB, Control Center)## Getting Started
1. Clone the repository.
```bash
git clone https://github.com/airscholar/YoutubeAnalytics.git
```2. Install Python dependencies.
```bash
pip install -r requirements.txt
```3. Make sure you have Docker and Confluent containers set up.
## Configuration
1. Open `config/config.local` and set the following:
- `YOUTUBE_API_KEY`: Your YouTube API Key
- `PLAYLIST_ID`: The YouTube playlist ID you want to track2. Set up your Kafka server address in the main script, by default, it's set to `localhost:9092`.
## Running the Code
1. Start your Kafka and other Confluent services on Docker with
```bash
docker compose up -d
```
2. Run the Python script.
```bash
python YoutubeAnalytics.py
```## How It Works
1. Fetches data from YouTube API using the given playlist ID.
2. Sends this data to Kafka.
3. You should have another component (not included here but in the video) that reads from this Kafka topic and performs real-time analytics using ksqlDB.
4. The analytics results are then sent to Telegram for real-time notifications.