[youtube-data-api]: add video resource attributes to builtin.channelVideos (#201) #216
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #201
Summary
This PR updates the
builtin.channelVideosresource to support retrieving extended video metadata that is not available through theplaylistItemsresource alone.To achieve this, the logic has been refactored to perform a two-step fetch:
videosendpoint directly using those IDs to fetch comprehensive details.Key Changes
channel_videos.pynow chains requests to properly fetch data from thevideosresource.statistics:view_count,like_count,comment_count,favorite_countcontentDetails:duration,definition,dimension,captionstatus:upload_status,privacy_status,license,embeddable,public_stats_viewablesnippet:published_at(mapped correctly frompublishedAt),category_id,default_languageto_listcalls to userow_type='scalar'instead of the deprecatedflatten=Trueparameter.examples/channel_videos.sqlto demonstrate the usage of the new fields.test_lib.py)channels_videos.pychanged fromflattentorow_typeand set it asscalar(mitigated multiple warnings)Verification
test_builtin_channel_videos_with_enhanced_attributesintests/e2e/test_lib.py.