omansak / libvideo

A lightweight .NET library to download YouTube videos.
BSD 2-Clause "Simplified" License
553 stars 163 forks source link

GetBytes Not working, just hanging #219

Closed PureDevelopers closed 3 years ago

PureDevelopers commented 3 years ago

Discussed in https://github.com/omansak/libvideo/discussions/218

Originally posted by **PureDevelopers** October 18, 2021 I just found this package, and attempted to use it by creating a new app in VS. When debugging, the app just hangs on the GetBytes method. Any idea why or how to fix? the following simply doesn't work for me: `var youTube = YouTube.Default; // starting point for YouTube actions var video = youTube.GetVideo(link); // gets a Video object with info about the video File.WriteAllBytes(@"C:\" + video.FullName, video.GetBytes());`
PureDevelopers commented 3 years ago

here is the path I am using: https://www.youtube.com/watch?v=Pxw5WTxJ7To

omansak commented 3 years ago

can you share your exception ?

PureDevelopers commented 3 years ago

Hi, I wasn’t getting any errors, GetBytes was simply never returning. I have gotten to a point now, where this code is working, but it is really slow. I tried the chunking solution, but I am unable to get it to return anything. It just seems to run forever.

I would be happy to share my solution or just some of the code if you are interested. How is the chunking solution working for you?

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows

From: @.> Sent: Friday, October 22, 2021 8:23 AM To: @.> Cc: @.>; @.> Subject: Re: [omansak/libvideo] GetBytes Not working, just hanging (Issue #219)

can you share your exception ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/omansak/libvideo/issues/219#issuecomment-949730624, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABNX5WB6E7P3XGKMBYUIFATUIF6WVANCNFSM5GHWE4UA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

omansak commented 3 years ago

@PureDevelopers

ofc, I would be happy if you share your solution.

omansak commented 3 years ago

220

PureDevelopers commented 3 years ago

Jim Shaffer has shared a OneDrive file with you. To view it, click the link below. https://1drv.ms/u/s!AvHPKApmHh2S0Uc4m7pdShzTuTKD [https://r1.res.office365.com/owa/prem/images/dc-zip_20.png]https://1drv.ms/u/s!AvHPKApmHh2S0Uc4m7pdShzTuTKD WebApplication1.ziphttps://1drv.ms/u/s!AvHPKApmHh2S0Uc4m7pdShzTuTKD

I am attaching my solution. It is MVC web app, so just review the home controller. The first method works and returns a file, but the one that chunks the file never returns anything.


From: OMANSAK @.> Sent: Thursday, October 28, 2021 12:43 PM To: omansak/libvideo @.> Cc: PureDevelopers @.>; Mention @.> Subject: Re: [omansak/libvideo] GetBytes Not working, just hanging (Issue #219)

220https://github.com/omansak/libvideo/issues/220

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/omansak/libvideo/issues/219#issuecomment-954146768, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABNX5WASUN2O6LDWV4VQH5LUJGRXHANCNFSM5GHWE4UA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

omansak commented 3 years ago

check version 3.1.3-pre (include prerelease if does not show on nuget)

PureDevelopers commented 3 years ago

Once I checked the pre release check box, I was able to see a 3.1.3 version and a 3.1.4 version. I installed 3.1.3, but then I got some dependency errors. I added the following two packages: Jint Esprima

And then it ran, but no file was ever generated.

It executes the following line of code, and then it never returns:

var response = await _client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);

From: @.> Sent: Wednesday, November 3, 2021 2:57 PM To: @.> Cc: @.>; @.> Subject: Re: [omansak/libvideo] GetBytes Not working, just hanging (Issue #219)

check version 3.1.3-pre (include prerelease if does not show on nuget)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/omansak/libvideo/issues/219#issuecomment-960178090, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABNX5WFGO52ZBPO7S3OUYADUKGV5FANCNFSM5GHWE4UA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

omansak commented 3 years ago

can you try again with 1.3.4 with new dependencies (NiL.JS)?