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
Using this data and list, I Insert this data into MySQL table,
You can use requirments.txt to install necessary module simply.
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 |
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.
-
clone this repository to local
-
issue your own OAuth 2.0 Client ID json file >>> Issue Guideline
-
Rename OAuth json file to
client_secret.json
-
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 '''
-
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 -
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
-
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
-
Do you want to save comment result, put in "y" when this code to see
Do you want to save your changes? (y/n) :
Go to this page >>> API Reference
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