diff options
author | Soispha <soispha@vhack.eu> | 2024-01-20 12:03:46 +0100 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2024-01-20 12:03:46 +0100 |
commit | 089c08af03849fb2883a17726462ca0d8ce8b51f (patch) | |
tree | d5d9285c6beab0babd16fe533b621ed56280bdd4 /sys/nixpkgs/pkgs/yt/src/constants.rs | |
parent | feat(hm/conf/nvim/plgs/treesitter): Add custom parser for `yts` (diff) | |
download | nixos-config-089c08af03849fb2883a17726462ca0d8ce8b51f.zip |
feat(sys/nixpkgs/pkgs/yt): Merge ytc and the rewritten ytc
Diffstat (limited to 'sys/nixpkgs/pkgs/yt/src/constants.rs')
-rw-r--r-- | sys/nixpkgs/pkgs/yt/src/constants.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/sys/nixpkgs/pkgs/yt/src/constants.rs b/sys/nixpkgs/pkgs/yt/src/constants.rs new file mode 100644 index 00000000..23e1d9b9 --- /dev/null +++ b/sys/nixpkgs/pkgs/yt/src/constants.rs @@ -0,0 +1,36 @@ +use std::{env, fs, path::PathBuf}; + +pub const HELP_STR: &'static str = include_str!("./help.str"); + +pub const YT_DLP_FLAGS: [&str; 12] = [ + "--format", + "bestvideo[height<=?1080]+bestaudio/best", + "--embed-chapters", + "--progress", + "--write-comments", + "--extractor-args", + "youtube:max_comments=150,all,100;comment_sort=top", + "--write-info-json", + "--sponsorblock-mark", + "default", + "--sponsorblock-remove", + "sponsor", +]; +pub const MPV_FLAGS: [&str; 2] = ["--speed=2.7", "--volume=75"]; + +pub const CONCURRENT: u32 = 5; + +pub const DOWNLOAD_DIR: &str = "/tmp/ytcc"; + +const STATUS_PATH: &str = "ytcc/running"; + +pub fn status_path() -> anyhow::Result<PathBuf> { + let out: PathBuf = format!( + "{}/{}", + env::var("XDG_RUNTIME_DIR").expect("This should always exist"), + STATUS_PATH + ) + .into(); + fs::create_dir_all(&out.parent().expect("Parent should exist"))?; + Ok(out) +} |