Skip to content

About

Download comments and replies of YouTube video

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

GetYouTubeComments

Download comments and replies of a YouTube video as human readable text file. To use it you need to provide a Google YouTube API key and a YouTube video id. Please refer to YouTube Data API Overview for creating your API key.

Installation

From Binary Release

For Windows 11 and Ubuntu 24.04 a PyInstaller standalone onefile binary build is provided in the Releases. Download it and extract the executable. If it doesn't work on your system or a different platform is required install it from source.

From Source

  1. Download and install Python 3.X on your system: https://www.python.org/downloads/
  2. Open a shell / command prompt and install matplotlib, numphy and scipy:
pip install --upgrade google-api-python-client
  1. Optionally install git command line client: https://github.com/git-guides/install-git
  2. Download FreqRespGraph:
  3. Test the installation by running: python GetYouTubeComments.py -h

Usage

If you run it from source on Windows your need to eanble UTF8 encoding:

set PYTHONUTF8=1
python GetYouTubeComments.py -h
usage: GetYouTubeComments [-h] [--apikey [APIKEY]] [--videoid [VIDEOID]]

GetYouTubeComments extracts comments and replies of a YouTube video in a human readable text format. To use it you need 
to provide a Google YouTube API key and YouTube video id.  

options:
  -h, --help           show this help message and exit
  --apikey [APIKEY]    Your YouTube API key, default query
  --videoid [VIDEOID]  YouTube video id, default query

Examples

python GetYouTubeComments.py
Your YouTube API key: 
YouTube video id: OoGxMMJkQfQ
198 comments and 278 replies saved to YouTubeOoGxMMJkQfQ.txt.

python GetYouTubeComments.py --apikey "A.....................................8" --videoid "OoGxMMJkQfQ"
198 comments and 278 replies saved to YouTubeOoGxMMJkQfQ.txt.

Limitations

Altough the YouTube WebUI shows a hierarchy of replies the YouTube Data API only provides a list of comments and for each comment a flat list of replies. So replies on replies as just shown a replies on the initial comment instead of a nested hierarchy.

About

Download comments and replies of YouTube video

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages