Baseline: WPF/Avalonia/Cli/Core + plans (BROWSER_FEATURES_PLAN v2, MOBILE_PLAN v1)
This commit is contained in:
commit
21b7c4d8bd
60 changed files with 6581 additions and 0 deletions
28
VideoDownloader.Core/Social/SocialPresets.cs
Normal file
28
VideoDownloader.Core/Social/SocialPresets.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
namespace VideoDownloader.Core.Social;
|
||||
|
||||
/// <summary>정적 화질 프리셋. 카드에 즉시 표시(네트워크 조회 불필요). yt-dlp 포맷 셀렉터 기반.</summary>
|
||||
public static class SocialPresets
|
||||
{
|
||||
public static readonly List<FormatOption> All = new()
|
||||
{
|
||||
new("최고 화질 (MP4)", "bv*+ba/b", IsAudio: false),
|
||||
new("1080p", "bv*[height<=1080]+ba/b[height<=1080]/b[height<=1080]"),
|
||||
new("720p", "bv*[height<=720]+ba/b[height<=720]/b[height<=720]"),
|
||||
new("480p", "bv*[height<=480]+ba/b[height<=480]/b[height<=480]"),
|
||||
new("360p", "bv*[height<=360]+ba/b[height<=360]/b[height<=360]"),
|
||||
new("오디오만 (MP3)", "ba", IsAudio: true),
|
||||
};
|
||||
|
||||
/// <summary>설정의 기본 화질 키(best/1080/720/480/360/audio) 로 기본 옵션을 찾는다.</summary>
|
||||
public static FormatOption DefaultFor(string? key)
|
||||
{
|
||||
var k = (key ?? "best").Trim().ToLowerInvariant();
|
||||
foreach (var o in All)
|
||||
{
|
||||
if (k == "best" && o.Label.StartsWith("최고")) return o;
|
||||
if (k == "audio" && o.IsAudio) return o;
|
||||
if (o.Label.StartsWith(k + "p", StringComparison.Ordinal)) return o;
|
||||
}
|
||||
return All[0];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue