diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index b59d75bac..000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -updates: -- package-ecosystem: nuget - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 16 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d514e357b..1cc699818 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,36 +15,54 @@ on: jobs: build: name: Build - runs-on: windows-2022 + runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - name: Restore dependencies run: dotnet restore + - name: Build run: dotnet build --no-restore + - name: Test run: dotnet test --no-build --verbosity normal + # Publish - name: Publish framework-dependent run: dotnet publish YoutubeDl.Wpf -c Release --no-restore + - name: Publish self-contained for Windows ARM64 run: dotnet publish YoutubeDl.Wpf -c Release -r win-arm64 --self-contained + - name: Publish self-contained for Windows x64 run: dotnet publish YoutubeDl.Wpf -c Release -r win-x64 --self-contained + + - name: Publish self-contained for Windows x86 + run: dotnet publish YoutubeDl.Wpf -c Release -r win-x86 --self-contained + # Upload + - name: Upload artifacts for Windows framework-dependent + uses: actions/upload-artifact@v4 + with: + name: youtube-dl-wpf-${{ github.sha }}-windows + path: YoutubeDl.Wpf/bin/Release/net8.0-windows10.0.22621.0/publish/ + - name: Upload artifacts for Windows ARM64 - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: youtube-dl-wpf-${{ github.sha }}-windows-arm64 - path: YoutubeDl.Wpf/bin/Release/net6.0-windows10.0.22000.0/win-arm64/publish/ + path: YoutubeDl.Wpf/bin/Release/net8.0-windows10.0.22621.0/win-arm64/publish/ + - name: Upload artifacts for Windows x64 - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: youtube-dl-wpf-${{ github.sha }}-windows-x64 - path: YoutubeDl.Wpf/bin/Release/net6.0-windows10.0.22000.0/win-x64/publish/ - - name: Upload artifacts for Windows framework-dependent - uses: actions/upload-artifact@v2 + path: YoutubeDl.Wpf/bin/Release/net8.0-windows10.0.22621.0/win-x64/publish/ + + - name: Upload artifacts for Windows x86 + uses: actions/upload-artifact@v4 with: - name: youtube-dl-wpf-${{ github.sha }}-windows - path: YoutubeDl.Wpf/bin/Release/net6.0-windows10.0.22000.0/publish/ + name: youtube-dl-wpf-${{ github.sha }}-windows-x86 + path: YoutubeDl.Wpf/bin/Release/net8.0-windows10.0.22621.0/win-x86/publish/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f24b16eb5..78e6020eb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,46 +8,49 @@ on: jobs: publish_upload: name: Publish and upload - runs-on: windows-2022 + runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - name: Restore dependencies run: dotnet restore - - name: Build - run: dotnet build --no-restore - - name: Test - run: dotnet test --no-build --verbosity normal + # Publish - name: Publish framework-dependent run: dotnet publish YoutubeDl.Wpf -c Release --no-restore + - name: Publish self-contained for Windows ARM64 run: dotnet publish YoutubeDl.Wpf -c Release -r win-arm64 --self-contained + - name: Publish self-contained for Windows x64 run: dotnet publish YoutubeDl.Wpf -c Release -r win-x64 --self-contained - # Get version - - name: Get version - id: get_version - shell: bash - run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) + + - name: Publish self-contained for Windows x86 + run: dotnet publish YoutubeDl.Wpf -c Release -r win-x86 --self-contained + # Package - name: Package for Windows run: | - cd YoutubeDl.Wpf/bin/Release/net6.0-windows10.0.22000.0/publish - 7z a -tzip -mx=9 -mfb=128 ../youtube-dl-wpf-${{ steps.get_version.outputs.VERSION }}-windows.zip . - 7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on ../youtube-dl-wpf-${{ steps.get_version.outputs.VERSION }}-windows.7z . + cd YoutubeDl.Wpf/bin/Release/net8.0-windows10.0.22621.0/publish + 7z a -tzip -mx=9 -mfb=128 ../youtube-dl-wpf-${{ github.ref_name }}-windows.zip . + 7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on ../youtube-dl-wpf-${{ github.ref_name }}-windows.7z . cd ../win-arm64/publish - 7z a -tzip -mx=9 -mfb=128 ../../youtube-dl-wpf-${{ steps.get_version.outputs.VERSION }}-windows-arm64.zip . - 7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on ../../youtube-dl-wpf-${{ steps.get_version.outputs.VERSION }}-windows-arm64.7z . + 7z a -tzip -mx=9 -mfb=128 ../../youtube-dl-wpf-${{ github.ref_name }}-windows-arm64.zip . + 7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on ../../youtube-dl-wpf-${{ github.ref_name }}-windows-arm64.7z . cd ../../win-x64/publish - 7z a -tzip -mx=9 -mfb=128 ../../youtube-dl-wpf-${{ steps.get_version.outputs.VERSION }}-windows-x64.zip . - 7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on ../../youtube-dl-wpf-${{ steps.get_version.outputs.VERSION }}-windows-x64.7z . + 7z a -tzip -mx=9 -mfb=128 ../../youtube-dl-wpf-${{ github.ref_name }}-windows-x64.zip . + 7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on ../../youtube-dl-wpf-${{ github.ref_name }}-windows-x64.7z . + cd ../../win-x86/publish + 7z a -tzip -mx=9 -mfb=128 ../../youtube-dl-wpf-${{ github.ref_name }}-windows-x86.zip . + 7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on ../../youtube-dl-wpf-${{ github.ref_name }}-windows-x86.7z . + # Release - name: Upload release assets for Windows uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: YoutubeDl.Wpf/bin/Release/net6.0-windows10.0.22000.0/youtube-dl-wpf-* + file: YoutubeDl.Wpf/bin/Release/net8.0-windows10.0.22621.0/youtube-dl-wpf-* tag: ${{ github.ref }} file_glob: true prerelease: true diff --git a/README.md b/README.md index 175746975..04a28d5ac 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # 🎞⬇ Cube YouTube Downloader - `youtube-dl-wpf` -[![Build](https://github.com/database64128/youtube-dl-wpf/workflows/Build/badge.svg)](https://github.com/database64128/youtube-dl-wpf/actions?query=workflow%3ABuild) -[![Release](https://github.com/database64128/youtube-dl-wpf/workflows/Release/badge.svg)](https://github.com/database64128/youtube-dl-wpf/actions?query=workflow%3ARelease) +[![Build](https://github.com/database64128/youtube-dl-wpf/actions/workflows/build.yml/badge.svg)](https://github.com/database64128/youtube-dl-wpf/actions/workflows/build.yml) +[![Release](https://github.com/database64128/youtube-dl-wpf/actions/workflows/release.yml/badge.svg)](https://github.com/database64128/youtube-dl-wpf/actions/workflows/release.yml) -A simple GUI wrapper for [`youtube-dl`](https://github.com/ytdl-org/youtube-dl) and [`yt-dlp`](https://github.com/yt-dlp/yt-dlp). +WPF GUI for [youtube-dl](https://github.com/ytdl-org/youtube-dl) and [yt-dlp](https://github.com/yt-dlp/yt-dlp). ![Home](home.webp "Home") ![Settings](settings.webp "Settings") @@ -11,40 +11,42 @@ A simple GUI wrapper for [`youtube-dl`](https://github.com/ytdl-org/youtube-dl) ## Features - Follow 🎨 system color mode, or choose between 🌃 dark mode and 🔆 light mode. -- Update `youtube-dl`/`yt-dlp` on startup. +- Update youtube-dl/yt-dlp on startup. - List all available formats. - Override video, audio formats and output container. - Embed metadata into downloaded file. - Download and embed thumbnails. -- Download playlists. +- Download whole playlists. +- Select items from playlist to download. - Select types of subtitles (default, all languages, auto-generated) to download and embed. -- Specify custom download filename template. +- Specify custom output template. - Specify custom download path. -- Specify custom `ffmpeg` path. +- Specify custom FFmpeg path. - Specify custom proxy. - Specify custom command-line arguments. ## Usage 1. Download the pre-built binary or build it from source. -2. Download [`youtube-dl`](https://github.com/ytdl-org/youtube-dl) or [`yt-dlp`](https://github.com/yt-dlp/yt-dlp) from the upstream. _Optionally but recommended_, get `ffmpeg` either by [building from source](https://www.ffmpeg.org/) or downloading [pre-built binaries](https://ffmpeg.zeranoe.com/builds/) for Windows. -3. The framework-dependent binary requires an installed [.NET 6 Runtime](https://dotnet.microsoft.com/download/dotnet/6.0) to run. Alternatively, download the self-contained binary that bundles the runtime. The upstream `youtube-dl` binary requires MSVC++ 2010 x86 runtime. -4. Run `youtube-dl-wpf.exe`. Go to __Settings__. Set the path to `youtube-dl`/`yt-dlp` and `ffmpeg`. -5. Go back to the home tab. Paste a video URL and start downloading! 🚀 +2. Download [yt-dlp](https://github.com/yt-dlp/yt-dlp) or [youtube-dl](https://github.com/ytdl-org/youtube-dl). +3. It's optional but highly recommended to also download [FFmpeg](https://ffmpeg.org/download.html). Otherwise you won't be able to merge separate video and audio tracks. +4. The framework-dependent binary requires an installed [.NET Runtime](https://dotnet.microsoft.com/) to run. Alternatively, download the self-contained binary that bundles the runtime. +5. Run `youtube-dl-wpf.exe`. Go to __Settings__. Set the path to youtube-dl/yt-dlp and FFmpeg. +6. Go back to the home tab. Paste a video URL and start downloading! 🚀 ## FAQ 1. Q: The __Download__ button is grayed out and I can't click it! - A: `youtube-dl-wpf` is a simple GUI wrapper. It doesn't bundle any downloader with it. You have to download `youtube-dl`/`yt-dlp` from the upstream. The `ffmpeg` binary is required by `youtube-dl`/`yt-dlp` when downloading and merging separate video and audio tracks, which is the case for any video resolution higher than 360p on YouTube. + A: `youtube-dl-wpf` is a simple GUI wrapper. It doesn't bundle any downloader with it. You have to download youtube-dl or yt-dlp for it to work. FFmpeg is required by youtube-dl and yt-dlp when merging separate video and audio tracks, which is the case for most formats on YouTube. 2. Q: How can I use a proxy to download? - A: Leave the proxy field empty to use system proxy settings. Otherwise the format is similar to how `curl` accepts proxy strings. Examples are, `socks5://localhost:1080/`, `http://localhost:8080/`. Currently the upstream doesn't accept `socks5h` protocol and treat `socks5` as `socks5h` by always resolving the hostname using the proxy. This is tracked in [this issue](https://github.com/ytdl-org/youtube-dl/issues/22618). + A: Leave the proxy field empty to use system proxy settings. Otherwise the format is similar to how `curl` accepts proxy strings (e.g. `socks5://localhost:1080/`, `http://localhost:8080/`). Currently the upstream doesn't accept `socks5h` protocol and treat `socks5` as `socks5h` by always resolving the hostname using the proxy. This is tracked in [this issue](https://github.com/ytdl-org/youtube-dl/issues/22618). 3. Q: Downloading the whole playlist doesn't work! - A: It's an upstream bug, just like many other issues you might discover. There's nothing I can do. Just report the bug to the [upstream](https://github.com/ytdl-org/youtube-dl). + A: It's an upstream bug, just like many other issues you might discover. There's nothing I can do. Just report the bug to yt-dlp or youtube-dl, whichever you use. 4. Q: `youtube-dl` and `yt-dlp` behave differently! @@ -60,7 +62,7 @@ A simple GUI wrapper for [`youtube-dl`](https://github.com/ytdl-org/youtube-dl) ## Build -Prerequisites: .NET 6 SDK +Prerequisites: .NET 8 SDK Note for packagers: The application by default uses executable directory as config directory. To use user's config directory, define the constant `PACKAGED` when building. @@ -97,4 +99,4 @@ dotnet publish YoutubeDl.Wpf -c Release -p:DefineConstants=PACKAGED -r win-x64 - - [Roboto Mono](https://fonts.google.com/specimen/Roboto+Mono) is licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). - [ReactiveUI](https://github.com/reactiveui/ReactiveUI) and its dependencies are licensed under [MIT](https://github.com/reactiveui/ReactiveUI/blob/main/LICENSE). -© 2022 database64128 +© 2024 database64128 diff --git a/YoutubeDl.Wpf.Tests/YoutubeDl.Wpf.Tests.csproj b/YoutubeDl.Wpf.Tests/YoutubeDl.Wpf.Tests.csproj index 0d0945183..a3c4e7b64 100644 --- a/YoutubeDl.Wpf.Tests/YoutubeDl.Wpf.Tests.csproj +++ b/YoutubeDl.Wpf.Tests/YoutubeDl.Wpf.Tests.csproj @@ -1,7 +1,7 @@  - net6.0-windows10.0.22000.0 + net8.0-windows10.0.22621.0 false @@ -9,13 +9,13 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/YoutubeDl.Wpf/App.xaml b/YoutubeDl.Wpf/App.xaml index 6f0e2d1d8..dc2944eab 100644 --- a/YoutubeDl.Wpf/App.xaml +++ b/YoutubeDl.Wpf/App.xaml @@ -7,7 +7,7 @@ - + diff --git a/YoutubeDl.Wpf/MainWindow.xaml b/YoutubeDl.Wpf/MainWindow.xaml index 847edafb0..476847e17 100644 --- a/YoutubeDl.Wpf/MainWindow.xaml +++ b/YoutubeDl.Wpf/MainWindow.xaml @@ -17,7 +17,7 @@ TextOptions.TextRenderingMode="Auto" Background="{DynamicResource MaterialDesignPaper}" FontFamily="{materialDesign:MaterialDesignFont}" - Title="Cube YouTube Downloader" Height="720" Width="904" MinHeight="644" MinWidth="620"> + Title="Cube YouTube Downloader" MinHeight="644" MinWidth="620"> @@ -28,7 +28,7 @@ - +