
Youtube videos are a great source of knowledge. However, when it comes to Youtube comments most of us cringe, as youtube comments are home for trolls and similar. But there are some comment sections out there that have some of the finest youtube comments you will ever find. You will enjoy reading and would want to keep it for future use and analysis.
However, the most common method of archiving those comments are either copy & paste or taking a screenshot.
But today we have this tool called youtube-comment-downloader developed by Github user @egbertbouman which can easily scrape all the comments off of a youtube video, and parse them into a Javascript object (.JSON) file.
Syntax of Output file
{
"heart":false,
"votes":0,
"photo":"",
"author":"Ilo........ylie",
"cid":"UgwGk................BR4AaABAg",
"text":"thank you for this!",
"time":"3 weeks ago",
"channel":"UC................................BD7g"
}
Output

Install Youtube Comment Downloader
1. Clone the repository to your local machine
git clone https://github.com/egbertbouman/youtube-comment-downloader.git

2. Goto the youtube-comment-downloader directory
cd youtube-comment-downloader
3. Install required python modules
pip install requests
pip install lxml
pip install cssselect
4. Execute the following commands
Replace VIDEO_ID with the ID of the youtube video you want to download the comments from.
https://www.youtube.com/watch?v=XYZABCDEFG
XYZABCDEFG is the video ID
Syntax:
python downloader.py --youtubeid VIDEO_ID --output VIDEO_ID.json
Example :
python downloader.py --youtubeid ScMzIvxBSi4 --output ScMzIvxBSi4.json
5. You will be notified of how many comments were found in the terminal:

6. A Javascript Object file also called JSON file with the filename VIDEO_ID.json will be created in the same directory

Note
- This script doesn’t use the youtube API to extract comments
- For Youtube IDs starting with
-
(dash) you will need to run the script with: -y=-idwithdash
or --youtubeid=-idwithdash
- To limit the size of the output file it is in delimited JSON, however, you can change the structure using an online JSON Formatter tools.
Project Repository
https://github.com/egbertbouman/youtube-comment-downloader
This content has been shared for Educational And Non-Profit Purpose ONLY