How to Get List of YouTube Channel Videos using YouTube API?
I’ve got 150+ videos on @SupeRails Youtube channel, and now I want to list them on my own superails.com website.
I could copypaste the information manually, but that would take ages.
I could use web scraping, but what's the point, if there is an easy to use Youtube API?
In this episode we will:
✅ Learn basics of using Google Cloud Console ☁️
✅ Enable and use Youtube API
✅ LIST videos from ANY channel
✅ Get detailed info for any particular video
✅ Paginate API results
✅ Store results in our local database 💾
✅ Use ActiveJob to do it all async
Episode source code: https://github.com/corsego/135-youtube-api/commit/8f5d71f1b3b52624c1c4986ab045a1b96ce15347
Based on this blogpost: https://blog.corsego.com/youtube-api
0:00 How to extract videos from Youtube?
1:20 Enable Youtube Data API in Google Cloud
2:03 Create API key
2:20 Install Google API Ruby Client gem for Youtube
5:45 Make API request to Youtube to LIST videos
7:25 Make API request to SHOW one video
8:50 Get video Duration
10:35 Save API data in Rails database
12:30 Create ActiveJob to LIST videos
18:44 Create ActiveJob to get each video and save in the database
28:17 Schedule video creation jobs inside video list job
29:35 Run the import job!
30:56 Final result! Let's look at the imported data