mirror of
https://github.com/jcreek/YouTubeChannelDownloader.git
synced 2026-07-13 03:03:46 +00:00
feat(*): Add Windows ffmpeg support
This is only for people wanting to run this as a console application on windows, it's completely unnecessary for running this in a docker container.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
$ffmpegFilePath = "$PSScriptRoot\ffmpeg.exe"
|
||||
|
||||
# Check if already exists
|
||||
if (Test-Path $ffmpegFilePath) {
|
||||
Write-Host "Skipped downloading ffmpeg, file already exists."
|
||||
exit
|
||||
}
|
||||
|
||||
Write-Host "Downloading ffmpeg..."
|
||||
|
||||
# Download the zip archive
|
||||
$url = "https://github.com/vot/ffbinaries-prebuilt/releases/download/v4.1/ffmpeg-4.1-win-64.zip"
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
$wc = New-Object System.Net.WebClient
|
||||
$wc.DownloadFile($url, "$ffmpegFilePath.zip")
|
||||
$wc.Dispose()
|
||||
|
||||
# Extract ffmpeg.exe from the archive
|
||||
Add-Type -Assembly System.IO.Compression.FileSystem
|
||||
$zip = [IO.Compression.ZipFile]::OpenRead("$ffmpegFilePath.zip")
|
||||
[IO.Compression.ZipFileExtensions]::ExtractToFile($zip.GetEntry("ffmpeg.exe"), $ffmpegFilePath)
|
||||
$zip.Dispose()
|
||||
|
||||
# Delete the archive
|
||||
Remove-Item "$ffmpegFilePath.zip" -Force
|
||||
|
||||
Write-Host "Done downloading ffmpeg."
|
||||
@@ -16,4 +16,16 @@
|
||||
<PackageReference Include="YoutubeExplode" Version="6.0.5" />
|
||||
<PackageReference Include="YoutubeExplode.Converter" Version="2.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- This downloads FFmpeg and copies it to output directory-->
|
||||
<!-- <Target Name="Download FFmpeg before build" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="powershell -ExecutionPolicy Bypass -File "$(ProjectDir)/DownloadFfmpeg.ps1"" />
|
||||
<Copy SourceFiles="$(ProjectDir)/ffmpeg.exe" DestinationFiles="$(OutDir)/ffmpeg.exe" />
|
||||
</Target>
|
||||
|
||||
<Target Name="Download FFmpeg before publish" BeforeTargets="PrepareForPublish">
|
||||
<Exec Command="powershell -ExecutionPolicy Bypass -File "$(ProjectDir)/DownloadFfmpeg.ps1"" />
|
||||
<Copy SourceFiles="$(ProjectDir)/ffmpeg.exe" DestinationFiles="$(PublishDir)/ffmpeg.exe" />
|
||||
</Target> -->
|
||||
|
||||
</Project>
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user