Building Classes for YouTube Feeds and Videos
Now that you've seen how the YouTube API works, we will show how you can represent the data types from the YouTube API as .NET classes (see Figure 4-5).
-
InnerTubeTime This is an enumeration that represents the possible
timeparameter values we can pass in to YouTube. We'll use this in theInnerTubeServiceclass as an optional parameter to pass into YouTube's API.-
InnerTubeFeed This class represents a specific video feed, such as the Top Rated videos. The
Feed Nameis a user-friendly name describing the feed, and the URL points to a YouTube API like the ones listed earlier.-
InnerTubeVideo This class represents a single YouTube video and includes most of the fields we get from YouTube (author, comments, categories), as well as a set of download properties that point to the location indicating where that video is stored on disk (once we download it).

Figure 4-5. YouTube's API as .NET classes
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access