This script will utilize YouTube's Data API v3 to gather metadata from search queries and videos from channels depending on user input. In addition to the metadata provided by the API, I've added a few more fields to fill out like checking for faces in thumbnails, title length, is the title a question, and title capital letter percentage. All metadata will be exported to a CSV file which can be easily viewable in Excel.
The goal of this mini project was to see if there are correlations between search queries and certain video metadata.
The metadata written to CSV:
- Channel Name
- Video Category
- Video URL
- Title
- View Count
- Likes
- Dislikes
- Comment Count
- Face in thumbnail?
- Title Length
- Capital Letter %
- Question in Title
- Tags in Video?
To run:
- Create a new project
- Place haarcascade_frontalface_default.xml in your project folder
- Replace the API key placeholder with your Google API key
Need help getting a Google API key? Click here
*Depending on your API privileges, you are most likely limited to 500~ videos per day
Face Detection Code by shantnu, modified by Me