diff --git a/YoutubeExplode.Tests/TestData/VideoIds.cs b/YoutubeExplode.Tests/TestData/VideoIds.cs index 9beef14f..ce9a8d74 100644 --- a/YoutubeExplode.Tests/TestData/VideoIds.cs +++ b/YoutubeExplode.Tests/TestData/VideoIds.cs @@ -12,6 +12,7 @@ internal static class VideoIds public const string AgeRestrictedSexual = "SkRSXFQerZs"; public const string AgeRestrictedEmbedRestricted = "hySoCSoH-g8"; public const string RequiresPurchase = "p3dDcKOFXQg"; + public const string RequiresPurchaseDistributed = "qs3NZHVM_Ik"; public const string LiveStream = "jfKfPfyJRdk"; public const string LiveStreamRecording = "rsAAeyAr-9Y"; public const string WithBrokenTitle = "4ZJWv6t-PfY"; diff --git a/YoutubeExplode.Tests/VideoSpecs.cs b/YoutubeExplode.Tests/VideoSpecs.cs index 7a514b8e..25cbf595 100644 --- a/YoutubeExplode.Tests/VideoSpecs.cs +++ b/YoutubeExplode.Tests/VideoSpecs.cs @@ -86,6 +86,7 @@ public async Task I_can_try_to_get_the_metadata_of_a_video_and_get_an_error_if_i [Theory] [InlineData(VideoIds.Normal)] [InlineData(VideoIds.Unlisted)] + [InlineData(VideoIds.RequiresPurchaseDistributed)] [InlineData(VideoIds.EmbedRestrictedByYouTube)] [InlineData(VideoIds.EmbedRestrictedByAuthor)] [InlineData(VideoIds.AgeRestrictedViolent)] diff --git a/YoutubeExplode/Bridge/SearchResponse.cs b/YoutubeExplode/Bridge/SearchResponse.cs index fb8a47ae..0aa32326 100644 --- a/YoutubeExplode/Bridge/SearchResponse.cs +++ b/YoutubeExplode/Bridge/SearchResponse.cs @@ -85,6 +85,13 @@ internal class VideoData(JsonElement content) [Lazy] public string? ChannelId => AuthorDetails + ?.GetPropertyOrNull("navigationEndpoint") + ?.GetPropertyOrNull("browseEndpoint") + ?.GetPropertyOrNull("browseId") + ?.GetStringOrNull() + ?? content + .GetPropertyOrNull("channelThumbnailSupportedRenderers") + ?.GetPropertyOrNull("channelThumbnailWithLinkRenderer") ?.GetPropertyOrNull("navigationEndpoint") ?.GetPropertyOrNull("browseEndpoint") ?.GetPropertyOrNull("browseId")