// Copyright 2017 Brian Allred
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
namespace NYoutubeDL.Options
{
#region Using
using Helpers;
#endregion
///
/// Object containing PostProcessing parameters
///
public class PostProcessing : OptionSection
{
[Option] internal readonly BoolOption addMetadata = new BoolOption("--add-metadata");
[Option] internal readonly EnumOption audioFormat =
new EnumOption("--audio-format");
[Option] internal readonly StringOption audioQuality = new StringOption("--audio-quality");
[Option] internal readonly StringOption command = new StringOption("--exec");
[Option] internal readonly EnumOption convertSubs =
new EnumOption("--convert-subs");
[Option] internal readonly BoolOption embedSubs = new BoolOption("--embed-subs");
[Option] internal readonly BoolOption embedThumbnail = new BoolOption("--embed-thumbnail");
[Option] internal readonly BoolOption extractAudio = new BoolOption("-x");
[Option] internal readonly StringOption ffmpegLocation = new StringOption("--ffmpeg-location");
[Option] internal readonly EnumOption fixupPolicy =
new EnumOption("--fixup");
[Option] internal readonly BoolOption keepVideo = new BoolOption("-k");
[Option] internal readonly StringOption metadataFromTitle = new StringOption("--metadata-from-title");
[Option] internal readonly BoolOption noPostOverwrites = new BoolOption("--no-post-overwrites");
[Option] internal readonly StringOption postProcessorArgs = new StringOption("--postprocessor-args");
[Option] internal readonly BoolOption preferAvconv = new BoolOption("--prefer-avconv");
[Option] internal readonly BoolOption preferFfmpeg = new BoolOption("--prefer-ffmpeg");
[Option] internal readonly EnumOption recodeFormat =
new EnumOption("--recode-video");
[Option] internal readonly BoolOption xattrs = new BoolOption("--xattrs");
///
/// --add-metadata
///
public bool AddMetadata
{
get => this.addMetadata.Value ?? false;
set => this.SetField(ref this.addMetadata.Value, value);
}
///
/// --audio-format
///
public Enums.AudioFormat AudioFormat
{
get => this.audioFormat.Value == null
? Enums.AudioFormat.best
: (Enums.AudioFormat) this.audioFormat.Value;
set => this.SetField(ref this.audioFormat.Value, (int) value);
}
///
/// --audio-quality
///
public string AudioQuality
{
get => this.audioQuality.Value ?? "5";
set => this.SetField(ref this.audioQuality.Value, value);
}
///
/// --exec
///
public string Command
{
get => this.command.Value;
set => this.SetField(ref this.command.Value, value);
}
///
/// --convert-subs
///
public Enums.SubtitleFormat ConvertSubs
{
get => this.convertSubs.Value == null
? Enums.SubtitleFormat.undefined
: (Enums.SubtitleFormat) this.convertSubs.Value;
set => this.SetField(ref this.convertSubs.Value, (int) value);
}
///
/// --embed-subs
///
public bool EmbedSubs
{
get => this.embedSubs.Value ?? false;
set => this.SetField(ref this.embedSubs.Value, value);
}
///
/// --embed-thumbnail
///
public bool EmbedThumbnail
{
get => this.embedThumbnail.Value ?? false;
set => this.SetField(ref this.embedThumbnail.Value, value);
}
///
/// -x
///
public bool ExtractAudio
{
get => this.extractAudio.Value ?? false;
set => this.SetField(ref this.extractAudio.Value, value);
}
///
/// --ffmpeg-location
///
public string FfmpegLocation
{
get => this.ffmpegLocation.Value;
set => this.SetField(ref this.ffmpegLocation.Value, value);
}
///
/// --fixup
///
public Enums.FixupPolicy FixupPolicy
{
get => this.fixupPolicy.Value == null
? Enums.FixupPolicy.detect_or_warn
: (Enums.FixupPolicy) this.fixupPolicy.Value;
set => this.SetField(ref this.fixupPolicy.Value, (int) value);
}
///
/// -k
///
public bool KeepVideo
{
get => this.keepVideo.Value ?? false;
set => this.SetField(ref this.keepVideo.Value, value);
}
///
/// --metadata-from-title
///
public string MetadataFromTitle
{
get => this.metadataFromTitle.Value;
set => this.SetField(ref this.metadataFromTitle.Value, value);
}
///
/// --no-post-overwrites
///
public bool NoPostOverwrites
{
get => this.noPostOverwrites.Value ?? false;
set => this.SetField(ref this.noPostOverwrites.Value, value);
}
///
/// --postprocessor-args
///
public string PostProcessorArgs
{
get => this.postProcessorArgs.Value;
set => this.SetField(ref this.postProcessorArgs.Value, value);
}
///
/// --prefer-avconv
///
public bool PreferAvconv
{
get => this.preferAvconv.Value ?? false;
set => this.SetField(ref this.preferAvconv.Value, value);
}
///
/// --prefer-ffmpeg
///
public bool PreferFfmpeg
{
get => this.preferFfmpeg.Value ?? false;
set => this.SetField(ref this.preferFfmpeg.Value, value);
}
///
/// --recode-video
///
public Enums.VideoFormat RecodeFormat
{
get => this.recodeFormat.Value == null
? Enums.VideoFormat.undefined
: (Enums.VideoFormat) this.recodeFormat.Value;
set => this.SetField(ref this.recodeFormat.Value, (int) value);
}
///
/// [Experimental]
/// --xattrs
///
public bool Xattrs
{
get => this.xattrs.Value ?? false;
set => this.SetField(ref this.xattrs.Value, value);
}
}
}