This is a command line tool gets data from a given channel and returns an Excel file. It takes the channel ID as input that can be extracted from the URL in the browser. Data contains videos, views, likes, comments and much more. The script is written in pyhton 3 and uses pandas to extract and transform the data.
Downloading an Excel file that contains data of videos in a given channel.
- You need a YouTube Data API key to make this work. I do not publish mine here. Get your own for free at https://console.developers.google.com/
- On Windows 10 open the comand line and type
setx YOUTUBE_API_KEY “REPLACE_THIS_TEXT_WITH_YOUR_YOUTUBE_DATA_API_KEY”
- Clone this repository
pip install -r requirements.txt
Feel free to watch a short video demo or a long video demo.
After downloading the Excel file you will find it in the output folder: output/
Have a look at the example output .xlsx file.
The output Excel contains values for the following attributes/columns:
- videoId
- publishedAt
- channelId
- title
- description
- channelTitle
- tags
- categoryId
- category
- liveBroadcastContent
- duration
- duration_sec
- dimension
- definition
- caption
- licensedContent
- projection
- privacyStatus
- license
- embeddable
- publicStatsViewable
- viewCount
- likeCount
- dislikeCount
- favoriteCount
- commentCount
- thumbnails_default
Hidden Features
This script uses a module that I used for some other YouTube Data Analytics Tools. By far not every function in this module is used in this project so you can explore the functions that will also allow to return YouTube Search Results and comments on videos.
Explore the module and have a closer look at src/youtube_data_module.py
- As some users are may not familiar on how to extract a channel ID from the URL in the browser, it might be a good idea to take as input any URL that somehow connects to a channel. This could be an URL of a specific video in this channel such as
https://www.youtube.com/watch?v=Pjt7Y3sG118
, a URL of a playlist that belongs to that channel likehttps://www.youtube.com/playlist?list=PLNiyoHci9a3Qien3F-WK6qD28biOy9ltE
or a URL with a personalized URL likehttps://www.youtube.com/user/schafer5
- 💥 💥💥Last but not least: A bowser-based online deployment would be nice 💥💥💥