michelderooij / Get-EventSession

Script to assist in downloading Microsoft event contents or return session information.
MIT License
69 stars 29 forks source link

Problem with video downloads - Build 2023 #31

Closed MikeBrannigan closed 11 months ago

MikeBrannigan commented 1 year ago

Using the following command line to get the complete English Build 2023 slides and videos from an elevated Powershell with set-executionpolicy unrestricted, PS E:\Build2023> .\Get-EventSession.ps1 -DownloadFolder E:\Build2023 -FORMAT bestvideo+bestaudio -EVENT Build2023 -LANGUAGE English -MaxDownloadJobs 2

I initially get

Exception calling "Start" with "0" argument(s): "The file or directory is corrupted and unreadable" At E:\Build2023\Get-EventSession.ps1:1070 char:17 + $p.Start() | Out-Null + ~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : Win32Exception You cannot call a method on a null-valued expression. At E:\Build2023\Get-EventSession.ps1:1071 char:17 + $stdout = $p.StandardOutput.ReadToEnd() + ~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At E:\Build2023\Get-EventSession.ps1:1072 char:17 + $stderr = $p.StandardError.ReadToEnd() + ~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull Exception calling "WaitForExit" with "0" argument(s): "No process is associated with this object." At E:\Build2023\Get-EventSession.ps1:1073 char:17 + $p.WaitForExit() + ~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : InvalidOperationException

Then it attempts to download a video and I get

Start-Process : This command cannot be run due to the error: The file or directory is corrupted and unreadable.
At E:\Build2023\Get-EventSession.ps1:891 char:23
$job= Start-Process @ProcessParam

 CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException                              
 FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand

Write-Progress : Cannot validate argument on parameter 'Id'. The argument is null, empty, or an element of the
argument collection contains a null value. Supply a collection that does not contain any null values and then try the
command again.

At E:\Build2023\Get-EventSession.ps1:807 char:36
                 Write-Progress -Id $job.job.id -Activity ('Video {0}  ...
CategoryInfo          : InvalidData: (:) [Write-Progress], ParameterBindingValidationException
 FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.WriteProgressCommand

Slidedeck exists BRK200H-What's new in .NET 8 for Web, frontends, backends, and futures.pptx Write-Progress : Cannot validate argument on parameter 'Id'. The argument is null, empty, or an element of the argument collection contains a null value. Supply a collection that does not contain any null values and then try the command again. At E:\Build2023\Get-EventSession.ps1:807 char:36 Write-Progress -Id $job.job.id -Activity ('Video {0} ...


     CategoryInfo          : InvalidData: (:) [Write-Progress], ParameterBindingValidationException
     FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.WriteProgressCommand

TERMINATING

If I use the -NoVideo on the command line there are no problems and all slidedecks are downlaoded
Atreidae commented 11 months ago

I've run into the same issue. Seems to be a corrupt yt-dlp.exe that the script is downloading (its only 84k!) image

Replacing it with a known good copy of yt-dlp resolves the issue

michelderooij commented 11 months ago

Thanks for the heads-up - updated yt-dlp source location + checking downloaded exe (4.00)