Skip to content

falconlee236/YouTube-Comment-TO-MySQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YouTube-Comment-TO-MySQL

Comment_to_MySQL made by python language program, which works searching youtube comment by using Youtube API

This program's Result is stored into MySQL table schema

Code style

python code style

Screenshots

example

Using this data and list, I Insert this data into MySQL table,

Comment_in_MySQL

Prerequisite Module

You can use requirments.txt to install necessary module simply.

emoji version
google-auth-oauthlib version
google--api--python--client version
google--auth
google--auth--httplib2
pandas
numpy
PyMySQL

Features

This program using Youtube API crawls much more youtube video comment than using selenium and beautifulsoup python module.

[Left] using selenium and chromedriver [Right] using youtube API and MySQL
Max comment = 1500
total video's comment = 15,000,000
Max comment = up to 15,000,000
total video's comment = 15,000,000
LEFT Comment_in_MySQL

This program is slower than the way to selenium crawling But more precise than that way

If you're using Bigdata and Artificial Intelligence or if you're a Data Scientist and Data Analyst , You must need to this program to use much many youtube comment data and to analyze youtube environment.

Installation

  1. clone this repository to local

  2. issue your own OAuth 2.0 Client ID json file >>> Issue Guideline

  3. Rename OAuth json file to client_secret.json

  4. In Terminal, Change your main directory and write this code

    > python src\Comment_to_MySQL.py
    "Enter a video_id" : #Enter target video id
    '''
    if your target youtube address is https://www.youtube.com/watch?v=YWt4wmZ_EMI
    you should put target video id YWt4wmZ_EMI
    '''
  5. IF Authorization is successfully, You will see
    "Please visit this URL to authorize this application : ~~~~~~~~"
    "Enter the authorization code :"
    After visit that URL and Complete Authorization, get authorization code and enter the code

  6. IF You execute program first, You will enter MySQL info to connect DB

    "Your user name? Ex) root : "
    "Your user passwd? Ex) 123456 : "
    "Your host name? Ex) localhost : "
    "Your Database Schema name? Ex) sys : "
    "charset of Database Schema? Ex) utf8 : "

    After that, the json file is made in local repository, MySQL_Auth.json

  7. After connecting MySQL and python, program needs to find table name. if there is existing DB table in local, DO NOT execute create table query. But Do not exist, Create Table You are typing name in program

  8. Do you want to save comment result, put in "y" when this code to see Do you want to save your changes? (y/n) :

API Reference

Go to this page >>> API Reference

Contact

Naver= falconlee236@naver.com

Google= hermit236@gmail.com

IF you find error code, plz contact upper email address or Issue or pull request or fork

PLZ STAR AND FORK!!!!!!!!!!

Welcome for contribution