Skip to content

An app to parse youtube video comments and store them in a csv file

Notifications You must be signed in to change notification settings

wuyenlin/youtube-comment-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Youtube Comments Scraper

This python script allows you to scrap all the comments given a youtube video link and save them into a csv file.

Pre-requisite

You will need to install Postman in order to make use of this app.

Getting started

Install dependencies

To install dependencies, run:

pip install -r requirements.txt

Get google API key

Follow the instructions in this link to obtain the API key.

Specifically, in Google API Console, navigate to YouTube Data API v3 and in the credential tab create an API key.

Make a .env file as follows:

cp .env.example .env

and fill in your API key in the file.

Start up the app

set FLASK_APP=api.py
flask run

And now the app is listening on http://127.0.0.1:5000/.

Using Postman

Now, open a new tab and select POST method on the address: http://127.0.0.1:5000/getResult

On the tab below, choose Body and select raw in JSON format. Paste the following:

{
    "url": "https://www.youtube.com/watch?v=kuhhT_cBtFU&t=2s&ab_channel=CNN"
}

And hit Send button.

Now, the csv file should be in the folder of ./data/.

Enjoy!

About

An app to parse youtube video comments and store them in a csv file

Resources

Stars

Watchers

Forks