diff --git a/YoutubeDownloader/YoutubeClient.cs b/YoutubeDownloader/YoutubeClient.cs index 28cdb732..663e50af 100644 --- a/YoutubeDownloader/YoutubeClient.cs +++ b/YoutubeDownloader/YoutubeClient.cs @@ -40,11 +40,17 @@ public class YoutubeClient : IYoutubeClient /// public YoutubeClient(HttpClient http, IReadOnlyList initialCookies) { + // Add necessary cookies. + var cookies = new List(initialCookies) + { + new("SOCS", "CAESEwgDEgk0ODE3Nzk3MjQaAmVuIAEaBgiA_LyaBg") { Domain = "youtube.com" } //cookie consent request bypass + }; + var youtubeHttp = new HttpClient( - new YoutubeHttpHandler(http, initialCookies), + new YoutubeHttpHandler(http, cookies), true ); - + Videos = new VideoClient(youtubeHttp); Playlists = new PlaylistClient(youtubeHttp); Channels = new ChannelClient(youtubeHttp);