Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<ItemGroup>
<PackageVersion Include="AngleSharp" Version="1.4.0" />
<PackageVersion Include="CSharpier.MsBuild" Version="1.2.1" />
<PackageVersion Include="CSharpier.MsBuild" Version="1.2.6" />
<PackageVersion Include="Deorcify" Version="1.1.0" />
<PackageVersion Include="Lazy.Fody" Version="1.11.0" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.5" />
Expand All @@ -24,7 +24,9 @@
<PackageVersion Include="FluentAssertions" Version="8.9.0" />
<PackageVersion Include="GitHubActionsTestLogger" Version="3.0.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageVersion Include="PolyShim" Version="2.7.0" />
<PackageVersion Include="JsonExtensions" Version="1.2.0" />
<PackageVersion Include="PolyShim" Version="2.11.0-a.1" />
<PackageVersion Include="PowerKit" Version="0.0.0-a.9" />
<PackageVersion Include="Tmds.DBus.Protocol" Version="0.21.3" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
Expand Down
3 changes: 2 additions & 1 deletion YoutubeExplode.Converter.Tests/EnvironmentSpecs.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.IO;
using System.Threading.Tasks;
using FluentAssertions;
using PowerKit;
using Xunit;
using Xunit.Abstractions;
using YoutubeExplode.Converter.Tests.Utils;
Expand All @@ -19,7 +20,7 @@ public async Task I_can_download_a_video_with_custom_environment_variables_passe
// Arrange
using var youtube = new YoutubeClient();

using var dir = TempDir.Create();
using var dir = TempDirectory.Create();
var filePath = Path.Combine(dir.Path, "video.mp4");

var logFilePath = Path.Combine(dir.Path, "ffreport.log");
Expand Down
29 changes: 15 additions & 14 deletions YoutubeExplode.Converter.Tests/GeneralSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
using System.Threading.Tasks;
using FluentAssertions;
using Gress;
using PowerKit;
using PowerKit.Extensions;
using Xunit;
using Xunit.Abstractions;
using YoutubeExplode.Converter.Tests.Utils;
using YoutubeExplode.Converter.Tests.Utils.Extensions;
using YoutubeExplode.Videos.Streams;

namespace YoutubeExplode.Converter.Tests;
Expand All @@ -25,7 +26,7 @@ public async Task I_can_download_a_video_as_a_single_mp4_file()
// Arrange
using var youtube = new YoutubeClient();

using var dir = TempDir.Create();
using var dir = TempDirectory.Create();
var filePath = Path.Combine(dir.Path, "video.mp4");

// Act
Expand All @@ -41,7 +42,7 @@ public async Task I_can_download_a_video_as_a_single_webm_file()
// Arrange
using var youtube = new YoutubeClient();

using var dir = TempDir.Create();
using var dir = TempDirectory.Create();
var filePath = Path.Combine(dir.Path, "video.webm");

// Act
Expand All @@ -57,7 +58,7 @@ public async Task I_can_download_a_video_as_a_single_mp3_file()
// Arrange
using var youtube = new YoutubeClient();

using var dir = TempDir.Create();
using var dir = TempDirectory.Create();
var filePath = Path.Combine(dir.Path, "video.mp3");

// Act
Expand All @@ -73,7 +74,7 @@ public async Task I_can_download_a_video_as_a_single_ogg_file()
// Arrange
using var youtube = new YoutubeClient();

using var dir = TempDir.Create();
using var dir = TempDirectory.Create();
var filePath = Path.Combine(dir.Path, "video.ogg");

// Act
Expand All @@ -89,7 +90,7 @@ public async Task I_can_download_a_video_as_a_single_mp4_file_with_multiple_stre
// Arrange
using var youtube = new YoutubeClient();

using var dir = TempDir.Create();
using var dir = TempDirectory.Create();
var filePath = Path.Combine(dir.Path, "video.mp4");

// Act
Expand Down Expand Up @@ -122,7 +123,7 @@ await youtube.Videos.DownloadAsync(
{
if (streamInfo.AudioLanguage is not null)
{
File.ContainsBytes(
File.Contains(
filePath,
Encoding.ASCII.GetBytes(streamInfo.AudioLanguage.Value.Name)
)
Expand All @@ -133,7 +134,7 @@ await youtube.Videos.DownloadAsync(

foreach (var streamInfo in videoStreamInfos)
{
File.ContainsBytes(filePath, Encoding.ASCII.GetBytes(streamInfo.VideoQuality.Label))
File.Contains(filePath, Encoding.ASCII.GetBytes(streamInfo.VideoQuality.Label))
.Should()
.BeTrue();
}
Expand All @@ -145,7 +146,7 @@ public async Task I_can_download_a_video_as_a_single_webm_file_with_multiple_str
// Arrange
using var youtube = new YoutubeClient();

using var dir = TempDir.Create();
using var dir = TempDirectory.Create();
var filePath = Path.Combine(dir.Path, "video.webm");

// Act
Expand Down Expand Up @@ -178,7 +179,7 @@ await youtube.Videos.DownloadAsync(
{
if (streamInfo.AudioLanguage is not null)
{
File.ContainsBytes(
File.Contains(
filePath,
Encoding.ASCII.GetBytes(streamInfo.AudioLanguage.Value.Name)
)
Expand All @@ -189,7 +190,7 @@ await youtube.Videos.DownloadAsync(

foreach (var streamInfo in videoStreamInfos)
{
File.ContainsBytes(filePath, Encoding.ASCII.GetBytes(streamInfo.VideoQuality.Label))
File.Contains(filePath, Encoding.ASCII.GetBytes(streamInfo.VideoQuality.Label))
.Should()
.BeTrue();
}
Expand All @@ -201,7 +202,7 @@ public async Task I_can_download_a_video_with_custom_conversion_settings()
// Arrange
using var youtube = new YoutubeClient();

using var dir = TempDir.Create();
using var dir = TempDirectory.Create();
var filePath = Path.Combine(dir.Path, "video.mp3");

// Act
Expand All @@ -224,7 +225,7 @@ public async Task I_can_try_to_download_a_video_and_get_an_error_if_the_conversi
// Arrange
using var youtube = new YoutubeClient();

using var dir = TempDir.Create();
using var dir = TempDirectory.Create();
var filePath = Path.Combine(dir.Path, "video.mp4");

// Act
Expand Down Expand Up @@ -252,7 +253,7 @@ public async Task I_can_download_a_video_while_tracking_progress()
// Arrange
using var youtube = new YoutubeClient();

using var dir = TempDir.Create();
using var dir = TempDirectory.Create();
var filePath = Path.Combine(dir.Path, "video.mp3");

var progress = new ProgressCollector<double>();
Expand Down
11 changes: 6 additions & 5 deletions YoutubeExplode.Converter.Tests/SubtitleSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
using System.Text;
using System.Threading.Tasks;
using FluentAssertions;
using PowerKit;
using PowerKit.Extensions;
using Xunit;
using YoutubeExplode.Converter.Tests.Utils;
using YoutubeExplode.Converter.Tests.Utils.Extensions;
using YoutubeExplode.Videos.Streams;

namespace YoutubeExplode.Converter.Tests;
Expand All @@ -22,7 +23,7 @@ public async Task I_can_download_a_video_as_a_single_mp4_file_with_subtitles()
// Arrange
using var youtube = new YoutubeClient();

using var dir = TempDir.Create();
using var dir = TempDirectory.Create();
var filePath = Path.Combine(dir.Path, "video.mp4");

var streamManifest = await youtube.Videos.Streams.GetManifestAsync("NtQkz0aRDe8");
Expand All @@ -48,7 +49,7 @@ await youtube.Videos.DownloadAsync(

foreach (var trackInfo in trackInfos)
{
File.ContainsBytes(filePath, Encoding.ASCII.GetBytes(trackInfo.Language.Name))
File.Contains(filePath, Encoding.ASCII.GetBytes(trackInfo.Language.Name))
.Should()
.BeTrue();
}
Expand All @@ -60,7 +61,7 @@ public async Task I_can_download_a_video_as_a_single_webm_file_with_subtitles()
// Arrange
using var youtube = new YoutubeClient();

using var dir = TempDir.Create();
using var dir = TempDirectory.Create();
var filePath = Path.Combine(dir.Path, "video.webm");

var streamManifest = await youtube.Videos.Streams.GetManifestAsync("NtQkz0aRDe8");
Expand All @@ -86,7 +87,7 @@ await youtube.Videos.DownloadAsync(

foreach (var trackInfo in trackInfos)
{
File.ContainsBytes(filePath, Encoding.ASCII.GetBytes(trackInfo.Language.Name))
File.Contains(filePath, Encoding.ASCII.GetBytes(trackInfo.Language.Name))
.Should()
.BeTrue();
}
Expand Down
35 changes: 0 additions & 35 deletions YoutubeExplode.Converter.Tests/Utils/Extensions/FileExtensions.cs

This file was deleted.

32 changes: 0 additions & 32 deletions YoutubeExplode.Converter.Tests/Utils/Extensions/HttpExtensions.cs

This file was deleted.

3 changes: 2 additions & 1 deletion YoutubeExplode.Converter.Tests/Utils/FFmpeg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using YoutubeExplode.Converter.Tests.Utils.Extensions;
using PowerKit;
using PowerKit.Extensions;

namespace YoutubeExplode.Converter.Tests.Utils;

Expand Down
36 changes: 0 additions & 36 deletions YoutubeExplode.Converter.Tests/Utils/TempDir.cs

This file was deleted.

37 changes: 0 additions & 37 deletions YoutubeExplode.Converter.Tests/Utils/TempFile.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<PackageReference Include="GitHubActionsTestLogger" PrivateAssets="all" />
<PackageReference Include="Gress" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="PowerKit" PrivateAssets="all" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion YoutubeExplode.Converter/ConversionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using YoutubeExplode.Converter.Utils.Extensions;
using PowerKit.Extensions;
using YoutubeExplode.Videos;
using YoutubeExplode.Videos.ClosedCaptions;
using YoutubeExplode.Videos.Streams;
Expand Down
2 changes: 1 addition & 1 deletion YoutubeExplode.Converter/ConversionRequestBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using YoutubeExplode.Converter.Utils.Extensions;
using PowerKit.Extensions;
using YoutubeExplode.Videos.Streams;

namespace YoutubeExplode.Converter;
Expand Down
Loading