Skip to content

ashiven/youtube-networks

Repository files navigation

License: MIT GitHub Release GitHub Issues or Pull Requests GitHub Issues or Pull Requests GitHub Repo stars

About

This script can be used to map out the channel landscape surrounding specific YouTube videos. It was developed as part of a programming project at TU Berlin. If you want to learn more about the project and how the generated graphs were evaluated, you may read the project report.

Getting Started

Prerequisites

Setup

  1. Clone the repository to your local machine as follows:

    git clone https://github.com/ashiven/youtube-networks.git
  2. Navigate to the youtube-networks directory.

    cd ./youtube-networks
  3. Install the necessary dependencies.

    pip install --user -r requirements.txt
  4. Insert your API key(s) into the script.

    nano ./src/main.py

Usage

  • Enter the following command to run the script:

    python ./src/main.py -s <link to a youtube video>
    parameter alias type description default
    --help -h Boolean Shows argument usage
    --seed -s String The initial YouTube link None
    --depth -d Integer The number of depth layers to calculate for the tree 2
    --width -w Integer The number of related videos per video 3
    --apikey -a String The API key to be used (if not provided, the first key from the list will be used) None
    --labels -l String Label description of the tree: title, videoId, channelId, channelName title
    --graph -g Boolean Convert the tree into a network graph False
    --force -f Boolean Calculate a large tree saved in a logfile until API key quota is reached False
    --aggressive -A Boolean Do the same as -f, exhausting all available API keys False
    --maxdepth -m Integer Max depth for tree compilation (must be a multiple of -d) 10000
    --importtrees -i String Path to a logfile (will convert its contents into a network graph) None
    --titles -t String Path to a logfile (will extract the video titles for further topic analysis) None

GitHub @ashiven  ·  Twitter ashiven_

About

Using the YouTube Data API to map out the channel landscape surrounding specific YouTube videos

Topics

Resources

License

Stars

Watchers

Forks

Languages