You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get all the cookie from web browser using WebView2
List<CoreWebView2Cookie>wv2Cookies=[];if(webView.CoreWebView2 !=null)wv2Cookies=await webView.CoreWebView2.CookieManager.GetCookiesAsync("https://youtube.com");CookieCollectionsysNetCookieCollection=[];
wv2Cookies.ForEach(c => sysNetCookieCollection.Add(c.ToSystemNetCookie()));varpostData=new DownloadMultiPlaylistsRq
{Cookies= sysNetCookieCollection.ToImmutableList(),PlaylistUrls=["https://www.youtube.com/playlist?list=PLgomaFin7XDmN6yMSDH6vQ5vWBWsbFB0K"//"https://www.youtube.com/playlist?list=PLgomaFin7XDmVk3B20G9WtCxervsc1tt0"]};stringjson= Newtonsoft.Json.JsonConvert.SerializeObject(postData);// Prepare the contentvarcontent=new StringContent(json, Encoding.UTF8,"application/json");// Send POST requestHttpResponseMessageresponse=await httpClient.PostAsync("https://localhost:7151/api/v1/VideoDownload/playlists", content);
I use WPF for get all the cookie then pass it to my dotnet 8.0 API.
Step 2
Init var youtubeClient2 = new YoutubeClient(cookies);
Step 2
Getting all videos from a playlist that contain private videos that I can access with my youtube account. All the videos are returned.
Get each private video info is okay but when download I got 401.
An unhandled exception has occurred while executing the request. System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
Expectation: I think it should not have any from problem with download private video coz I have all the cookies
Actual Result: An unhandled exception has occurred while executing the request. System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized). .
Thank you so much for check and help this out.🙏🙏
Checklist
I have looked through existing issues to make sure that this bug has not been reported before
I have provided a descriptive title for this issue
I have made sure that this bug is reproducible on the latest version of the package
I have provided all the information needed to reproduce this bug as efficiently as possible
I have sponsored this project
The text was updated successfully, but these errors were encountered:
codewithmecoder
changed the title
Download private video by passing list of cookies
Download private video by passing list of cookies, bit got 401
Feb 28, 2024
Tyrrrz
changed the title
Download private video by passing list of cookies, bit got 401
Download private video by passing list of cookies, but got 401
Jun 28, 2024
Is this still reproducible with the latest version?
If I had to guess, there might be an issue with (de-)serialization of cookies when sending them to your backend. However, if you can fetch the private videos in a playlist, it's unlikely for that to be the issue.
You can also try fetching and downloading just one video and see if it changes anything.
Is this still reproducible with the latest version?
If I had to guess, there might be an issue with (de-)serialization of cookies when sending them to your backend. However, if you can fetch the private videos in a playlist, it's unlikely for that to be the issue.
You can also try fetching and downloading just one video and see if it changes anything.
Version
6.3.13
Platform
.NET 8.0 / Window 11
Steps to reproduce
Step 1
I use WPF for get all the cookie then pass it to my dotnet 8.0 API.
Step 2
var youtubeClient2 = new YoutubeClient(cookies);
Step 2
An unhandled exception has occurred while executing the request. System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
Details
An unhandled exception has occurred while executing the request. System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
.Thank you so much for check and help this out.🙏🙏
Checklist
The text was updated successfully, but these errors were encountered: