mitegab / ethio-youtube-channels

Daily YouTube stats for selected Ethiopian channels

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ethiopian Political YouTube Channels Daily Statistics

This repository contains a Python script that collects daily statistics, such as view count, subscriber count, and video count, from a selected list of Ethiopian YouTube channels that have political proclivities or heavily discuss Ethiopian politics.

The script main.py has been running since January 01, 2023, see ./data/channels-data_01-2023.csv. The repo also includes R scripts for generating charts based on the collected data. You can use this repo to collect daily statistics of other YouTube channels, see the Usage section below.

Table of Contents

Overview

The purpose of this project is to gather daily insights and analyze the impact of Ethiopian political YouTube channels on their audience. By collecting and processing data such as view count, subscriber count, and video count, we can better understand the reach and influence of these channels in the Ethiopian political landscape, and identify which channels are more popular.

View a snapshot of stats
id statistics.viewCount statistics.subscriberCount statistics.videoCount
Abebe Belew 30303247 152000 1062
Adebabay Media 13036893 99400 914
Alpha Media አልፋ ሚዲያ 5411148 40400 981
Anchor Ethiopia 6648079 80400 236
Andafta 269542794 889000 5974
Arat Kilo Media አራት ኪሎ ሚዲያ 669293 16100 89
Ashara Media - አሻራ ሚዲያ 2971184 35100 771
EMS (Ethiopian Media Services) 44514734 222000 1046
ESATtv Ethiopia 197405901 641000 8811
ETHIO 251 MEDIA 13187078 109000 912
Ethio 360 Media 230124604 583000 4006
Ethio News - ኢትዮ ኒውስ 29028481 164000 1430
EthioTube 40330479 224000 1750
Feta Daily News 149028357 583000 991
GEBEYANU 10266427 107000 638
MENELIK TELEVISION 3 246145 2910 129
Mager Media - ማገር 1213374 22900 322
Mengizem Media ምንጊዜም ሚዲያ 3660557 31200 1296
OMN 110513467 513000 9670
Reyot 43204588 189000 2069
Roha 11563335 95200 975
Terara Network 3389884 45100 276
Tigrai Media House 155145214 351000 5473
Zara Media Network - ዛራ 21515125 129000 418
ኢትዮ ሰላም Ethio Selam 3032904 37700 120
ዓባይ ዜና - Abbay News 17843758 335000 1182

Snapshot of stats as of 2023-04-01 23:04:33

Requirements

Installation

  1. Clone this repository:

    git clone https://github.com/eyayaw/ethio-youtube-channels.git
  2. Change the directory to the cloned repository:

    cd ethio-youtube-channels
  3. Install the required Python package:

    pip install -r requirements.txt

Usage

  1. To use the script, you’ll need to obtain a Google API key. Follow the instructions in the Google API Console documentation to create a project and obtain an API key. Please read the YouTube Data API getting started.

  2. Set the API key as an environment variable named YOUTUBE_DATA_API_V3_KEY : export YOUTUBE_DATA_API_V3_KEY=your_api_key

  3. Update the  channels-list.csv  file with the list of YouTube channel IDs that you want to collect daily statistics about/from. Add one channel ID per row.

  4. Run the script: python main.py

  5. The script will generate a CSV file named  channels-data_MM-YYYY.csv  (where MM is the month and YYYY is the year, generated automatically as the script runs) in the  data  folder containing the daily statistics for each channel in the  channels-list.csv  file. Additionally, “static” information of the channels given in channels-list.csv will be written to data/channels-info.csv, and will be updated when new channels are added to the list.

Visualizing Data

  1. Install the required R packages by running the following command in the R console: install.packages(c("ggplot2", "data.table"))

  2. Open the  make-plots.R  script and modify the input file name to match the latest CSV file in the  data  folder.

  3. Run the  make-plots.R  script to generate an interactive chart and save it as  chart.html.

  4. Install Quarto and use it to render the  chart.qmd  file.

Contributing

I highly welcome contributions to this project. If you want to add new features, fix bugs, or improve documentation, please submit a pull request or open an issue.


Inspired by

  1. Corey Schafer’s Python YouTube API tutorials, and
  2. Patrik Loeber’s YouTube Data API tutorials

About

Daily YouTube stats for selected Ethiopian channels


Languages

Language:Python 57.1%Language:R 42.9%