Skip to content

Commit

Permalink
merge hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm360 committed Nov 10, 2023
2 parents ebfa6fd + f8aa496 commit 7083a7c
Show file tree
Hide file tree
Showing 169 changed files with 2,621 additions and 2,127 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
*.user
*.userosscache
*.sln.docstates
.idea/


# Build results
[Dd]ebug/
Expand All @@ -22,4 +20,4 @@ bld/
*.opencover.xml

#Visual studio cache/options directory
.vs/
.vs/
13 changes: 13 additions & 0 deletions .idea/.idea.YoutubeDownloader/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.idea.YoutubeDownloader/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/.idea.YoutubeDownloader/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/.idea.YoutubeDownloader/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/.idea.YoutubeDownloader/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,26 @@ https://github.com/Etherna/YoutubeExplode/releases

# Changelog

## v6.3.7 (09-Nov-2023)

- [Converter] Fixed an issue where subtitles embedded via `VideoClient.DownloadAsync(...)` had their languages specified using ISO 639-1 codes instead of ISO 639-2 codes.

## v6.3.6 (17-Oct-2023)

- Fixed an issue where calling `VideoClient.GetAsync(...)` on certain videos failed with an exception due to recent YouTube changes.

## v6.3.5 (28-Sep-2023)

- Added support for parsing live video URLs (i.e. `youtube.com/live/...`). (Thanks [@eimigueloliveir](https://github.com/eimigueloliveir))

## v6.3.4 (06-Sep-2023)

- Fixed an issue where calling any method on `SearchClient` resulted in an exception on mobile devices. (Thanks [@jerry08](https://github.com/jerry08))

## v6.3.3 (31-Aug-2023)

- Fixed an issue where calling `ChannelClient.GetAsync(...)` and `PlaylistClient.GetAsync(...)` failed on some channels and playlists due to recent YouTube changes. (Thanks [@tmm360](https://github.com/tmm360))

## v6.3.2 (18-Aug-2023)

- Fixed an issue where calling `StreamClient.GetManifestAsync(...)` failed on videos from the "YouTube Movies & TV" system channel.
Expand Down
8 changes: 5 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<Project>

<PropertyGroup>
<Company>Etherna Sagl</Company>
<Copyright>Copyright (C) Oleksii Holub, Copyright (C) 2023 Etherna Sagl</Copyright>
<Company>Etherna SA</Company>
<Copyright>Copyright (C) Oleksii Holub, Copyright (C) 2023 Etherna SA</Copyright>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<IsPackable>false</IsPackable>

<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>

<!-- Disable nullability warnings on frameworks where BCL is not annotated -->
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ YoutubeExplode
Copyright (C) 2016-2023 Oleksii Holub

Etherna YoutubeDownloader fork
Copyright (C) 2023-present Etherna Sagl
Copyright (C) 2023-present Etherna SA

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ var stream = await youtube.Videos.Streams.GetAsync(streamInfo);
await youtube.Videos.Streams.DownloadAsync(streamInfo, $"video.{streamInfo.Container}");
```

> **Warning**:
> While the `Url` property in the stream metadata can be used to access the underlying content, you need a series of carefully crafted HTTP requests in order to do so.
> It's highly recommended to use `Videos.Streams.GetAsync(...)` or `Videos.Streams.DownloadAsync(...)` instead, as they will all the heavy lifting for you.
#### Downloading closed captions

Closed captions can be downloaded in a similar way to media streams.
Expand Down
54 changes: 36 additions & 18 deletions YoutubeDownloader.Converter.Tests/GeneralSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ public class GeneralSpecs : IAsyncLifetime
{
private readonly ITestOutputHelper _testOutput;

public GeneralSpecs(ITestOutputHelper testOutput) =>
_testOutput = testOutput;
public GeneralSpecs(ITestOutputHelper testOutput) => _testOutput = testOutput;

public async Task InitializeAsync() => await FFmpeg.InitializeAsync();

Expand Down Expand Up @@ -114,16 +113,23 @@ public async Task I_can_download_a_video_as_a_single_mp4_file_with_multiple_stre
.Take(3)
.ToArray();

await youtube.Videos.DownloadAsync(
videoStreamInfos.Concat<IStreamInfo>(audioStreamInfos).ToArray(),
new ConversionRequestBuilder(filePath).Build()
);
await youtube
.Videos
.DownloadAsync(
videoStreamInfos.Concat<IStreamInfo>(audioStreamInfos).ToArray(),
new ConversionRequestBuilder(filePath).Build()
);

// Assert
MediaFormat.IsMp4File(filePath).Should().BeTrue();

foreach (var streamInfo in videoStreamInfos)
FileEx.ContainsBytes(filePath, Encoding.ASCII.GetBytes(streamInfo.VideoQuality.Label)).Should().BeTrue();
{
FileEx
.ContainsBytes(filePath, Encoding.ASCII.GetBytes(streamInfo.VideoQuality.Label))
.Should()
.BeTrue();
}
}

[Fact]
Expand Down Expand Up @@ -153,16 +159,23 @@ public async Task I_can_download_a_video_as_a_single_webm_file_with_multiple_str
.Take(3)
.ToArray();

await youtube.Videos.DownloadAsync(
videoStreamInfos.Concat<IStreamInfo>(audioStreamInfos).ToArray(),
new ConversionRequestBuilder(filePath).Build()
);
await youtube
.Videos
.DownloadAsync(
videoStreamInfos.Concat<IStreamInfo>(audioStreamInfos).ToArray(),
new ConversionRequestBuilder(filePath).Build()
);

// Assert
MediaFormat.IsWebMFile(filePath).Should().BeTrue();

foreach (var streamInfo in videoStreamInfos)
FileEx.ContainsBytes(filePath, Encoding.ASCII.GetBytes(streamInfo.VideoQuality.Label)).Should().BeTrue();
{
FileEx
.ContainsBytes(filePath, Encoding.ASCII.GetBytes(streamInfo.VideoQuality.Label))
.Should()
.BeTrue();
}
}

[Fact]
Expand All @@ -175,11 +188,16 @@ public async Task I_can_download_a_video_using_custom_conversion_settings()
var filePath = Path.Combine(dir.Path, "video.mp3");

// Act
await youtube.Videos.DownloadAsync("9bZkp7q19f0", filePath, o => o
.SetFFmpegPath(FFmpeg.FilePath)
.SetContainer("mp4")
.SetPreset(ConversionPreset.UltraFast)
);
await youtube
.Videos
.DownloadAsync(
"9bZkp7q19f0",
filePath,
o =>
o.SetFFmpegPath(FFmpeg.FilePath)
.SetContainer("mp4")
.SetPreset(ConversionPreset.UltraFast)
);

// Assert
MediaFormat.IsMp4File(filePath).Should().BeTrue();
Expand Down Expand Up @@ -208,4 +226,4 @@ public async Task I_can_download_a_video_while_tracking_progress()
foreach (var value in progressValues)
_testOutput.WriteLine($"Progress: {value:P2}");
}
}
}
32 changes: 19 additions & 13 deletions YoutubeDownloader.Converter.Tests/SubtitleSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,20 @@ public async Task I_can_download_a_video_as_a_single_mp4_file_with_subtitles()
var trackInfos = trackManifest.Tracks;

// Act
await youtube.Videos.DownloadAsync(
streamInfos,
trackInfos,
new ConversionRequestBuilder(filePath).Build()
);
await youtube
.Videos
.DownloadAsync(streamInfos, trackInfos, new ConversionRequestBuilder(filePath).Build());

// Assert
MediaFormat.IsMp4File(filePath).Should().BeTrue();

foreach (var trackInfo in trackInfos)
FileEx.ContainsBytes(filePath, Encoding.ASCII.GetBytes(trackInfo.Language.Name)).Should().BeTrue();
{
FileEx
.ContainsBytes(filePath, Encoding.ASCII.GetBytes(trackInfo.Language.Name))
.Should()
.BeTrue();
}
}

[Fact]
Expand All @@ -70,16 +73,19 @@ public async Task I_can_download_a_video_as_a_single_webm_file_with_subtitles()
var trackInfos = trackManifest.Tracks;

// Act
await youtube.Videos.DownloadAsync(
streamInfos,
trackInfos,
new ConversionRequestBuilder(filePath).Build()
);
await youtube
.Videos
.DownloadAsync(streamInfos, trackInfos, new ConversionRequestBuilder(filePath).Build());

// Assert
MediaFormat.IsWebMFile(filePath).Should().BeTrue();

foreach (var trackInfo in trackInfos)
FileEx.ContainsBytes(filePath, Encoding.ASCII.GetBytes(trackInfo.Language.Name)).Should().BeTrue();
{
FileEx
.ContainsBytes(filePath, Encoding.ASCII.GetBytes(trackInfo.Language.Name))
.Should()
.BeTrue();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public static async Task DownloadAsync(this HttpClient http, string url, string

await source.CopyToAsync(destination);
}
}
}
Loading

0 comments on commit 7083a7c

Please sign in to comment.