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.
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 |
---|---|---|---|
Abc tv | 200828 | 11600 | 131 |
Addis Compass Media / ACM / አዲስ ኮምፓስ ሚዲያ | 14583797 | 72200 | 1058 |
AddisWalta - AW | 60630014 | 459000 | 23112 |
Adebabay Media | 14682322 | 107000 | 1035 |
Alpha Media አልፋ ሚዲያ | 9614769 | 56000 | 1719 |
Andafta | 317144179 | 988000 | 7769 |
Arat Kilo Media አራት ኪሎ ሚዲያ | 712570 | 16500 | 90 |
DW Amharic | 261164 | 9800 | 256 |
EBC | 508033529 | 1490000 | 69427 |
EMS (Ethiopian Media Services) | 94474168 | 370000 | 2592 |
ESAN TV | 3087032 | 42600 | 106 |
ESATtv Ethiopia | 213553058 | 699000 | 11359 |
EVN for Ethiopia | 3051920 | 46500 | 242 |
Ethio Forum ኢትዮ ፎረም | 328906250 | 830000 | 2103 |
Ethio News - ኢትዮ ኒውስ | 39301147 | 194000 | 1836 |
Ethio News_ኢትዮ ኒውስ ቻናል 2 | 7504644 | 70800 | 251 |
Ethio Selam | 2134367 | 67000 | 88 |
EthioTube | 44496132 | 266000 | 1925 |
Fana Television | 435002971 | 1480000 | 45473 |
Feta Daily News | 249292345 | 827000 | 1872 |
GEBEYANU | 14007827 | 139000 | 836 |
Horizon Free Media ሆራይዝን ነፃ ሚዲያ | 3583645 | 49800 | 195 |
Mager Media - ማገር | 2316530 | 34300 | 450 |
Mengizem Media ምንጊዜም ሚዲያ | 8171838 | 69900 | 2501 |
OMN | 143027902 | 683000 | 12456 |
Reyot | 68142059 | 263000 | 2610 |
Roha | 47947539 | 235000 | 2078 |
Terara Network | 3727641 | 52800 | 285 |
Tigrai Media House | 161231551 | 373000 | 6438 |
VOA Amharic | 13280504 | 151000 | 7263 |
Wazema Radio | 2692496 | 50300 | 1545 |
Zara Media Network - ዛራ | 1291408 | 143000 | 0 |
ebstv worldwide | 1360838470 | 2600000 | 26042 |
ዓባይ ዜና - Abbay News | 33039618 | 440000 | 1979 |
Snapshot of stats as of 2024-08-01 23:05:10
- Python 3.6 or higher
- google-api-python-client package
- R dependencies:
data.table
andggplot2
- Quarto (for rendering chart.qmd)
-
Clone this repository:
git clone https://github.com/eyayaw/ethio-youtube-channels.git
-
Change the directory to the cloned repository:
cd ethio-youtube-channels
-
Install the required Python package:
pip install -r requirements.txt
-
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.
-
Set the API key as an environment variable named
YOUTUBE_DATA_API_V3_KEY
:export YOUTUBE_DATA_API_V3_KEY=your_api_key
-
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.
-
Run the script:
python main.py
-
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 thedata
folder containing the daily statistics for each channel in thechannels-list.csv
file. Additionally, “static” information of the channels given inchannels-list.csv
will be written todata/channels-info.csv
, and will be updated when new channels are added to the list.
-
Install the required R packages by running the following command in the R console:
install.packages(c("ggplot2", "data.table"))
-
Open the
make-plots.R
script and modify the input file name to match the latest CSV file in the data folder. -
Run the
make-plots.R
script to generate an interactive chart and save it as chart.html. -
Install Quarto and use it to render the
analysis.qmd
file.
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.