Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
feat: add remaining cobalt arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
khyerdev committed May 1, 2024
1 parent ff24d63 commit 001292a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
18 changes: 17 additions & 1 deletion src/args/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ pub struct Args {
pub c_audio_only: bool,
pub c_audio_muted: bool,
pub c_twitter_gif: bool,
pub c_tt_full_audio: bool,
pub c_tt_h265: bool,
pub c_dublang: bool,
pub c_disable_metadata: bool,
pub out_filename: Option<String>,
pub c_fname_style: types::FilenamePattern,
pub same_filenames: bool,
Expand All @@ -39,7 +43,11 @@ impl Args {
method: None,
bulk_array: None,
picker_choice: 0,
c_fname_style: types::FilenamePattern::Classic
c_fname_style: types::FilenamePattern::Classic,
c_tt_full_audio: false,
c_tt_h265: false,
c_dublang: false,
c_disable_metadata: false,
}
}

Expand Down Expand Up @@ -84,6 +92,10 @@ impl Args {
"--audio-only" => self.c_audio_only = true,
"--mute-audio" => self.c_audio_muted = true,
"--twitter-gif" => self.c_twitter_gif = true,
"--tt-full-audio" => self.c_tt_full_audio = true,
"--tt-h265" => self.c_tt_h265 = true,
"--dublang" => self.c_dublang = true,
"--no-metadata" => self.c_disable_metadata = true,
"--output" => expected.push(ExpectedFlags::Output),
"--fname-style" => expected.push(ExpectedFlags::FilenamePattern),
"--pick" => expected.push(ExpectedFlags::Picker),
Expand Down Expand Up @@ -113,6 +125,10 @@ impl Args {
'a' => self.c_audio_only = true,
'm' => self.c_audio_muted = true,
'g' => self.c_twitter_gif = true,
'u' => self.c_tt_full_audio = true,
'h' => self.c_tt_h265 = true,
'l' => self.c_dublang = true,
'n' => self.c_disable_metadata = true,
'o' => expected.push(ExpectedFlags::Output),
's' => expected.push(ExpectedFlags::FilenamePattern),
'p' => expected.push(ExpectedFlags::Picker),
Expand Down
12 changes: 8 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,11 @@ const POST_TEMPLATE: &str = "{
\"aFormat\": \"<aformat>\",
\"filenamePattern\": \"<fname-style>\",
\"isAudioOnly\": <audio-only>,
\"isTTFullAudio\": false,
\"tiktokH265\": false,
\"isTTFullAudio\": <tt-full-audio>,
\"tiktokH265\": <tt-h265>,
\"isAudioMuted\": <audio-muted>,
\"dubLang\": false,
\"disableMetadata\": false,
\"dubLang\": <dublang>,
\"disableMetadata\": <no-metadata>,
\"twitterGif\": <twitter-gif>
}";
fn cobalt_args(args_in: &Args) -> String {
Expand All @@ -325,8 +325,12 @@ fn cobalt_args(args_in: &Args) -> String {
.replace("<vquality>", &args_in.c_video_quality.to_string())
.replace("<aformat>", &args_in.c_audio_format.print())
.replace("<fname-style>", &args_in.c_fname_style.print())
.replace("<tt-full-audio>", &args_in.c_tt_full_audio.to_string())
.replace("<tt-h265>", &args_in.c_tt_h265.to_string())
.replace("<audio-only>", &args_in.c_audio_only.to_string())
.replace("<audio-muted>", &args_in.c_audio_muted.to_string())
.replace("<dublang>", &args_in.c_dublang.to_string())
.replace("<no-metadata>", &args_in.c_disable_metadata.to_string())
.replace("<twitter-gif>", &args_in.c_twitter_gif.to_string())
}

Expand Down

0 comments on commit 001292a

Please sign in to comment.