1
Fork 0
mirror of https://github.com/thegeneralist01/archivr synced 2026-05-30 08:36:47 +02:00

Compare commits

..

No commits in common. "b9f45d148bdf54f773b953f07b3355aa672d22db" and "df05687ad97a5c7ed5bb49bdcad32861e638d1f1" have entirely different histories.

2 changed files with 9 additions and 17 deletions

View file

@ -1,18 +1,6 @@
{
description = "Archivr - An open-source archive manager";
nixConfig = {
extra-substituters = [
"https://cache.thegeneralist01.com/"
"https://cache.garnix.io/"
"https://cache.nixos.org/"
];
extra-trusted-public-keys = [
"cache.thegeneralist01.com:jkKcenR877r7fQuWq6cr0JKv2piqBWmYLAYsYsSJnT4="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
};
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs =
@ -33,7 +21,7 @@
pname = "archivr";
version = "0.1.0";
src = pkgs.lib.cleanSource ./.;
cargoHash = "sha256-4m+4SMYA/rJ0eHEOc32zA2VdZI1pqzB5NenD0R0f2zM=";
cargoHash = "sha256-y47+Fmp3BID86aPnLtrvzg40lOr9cHyg/38+onisK7w=";
nativeBuildInputs = [ pkgs.pkg-config ];
};
archivr = pkgs.stdenv.mkDerivation {
@ -61,7 +49,6 @@
};
in
{
default = archivr;
archivr = archivr;
archivr-unwrapped = archivr_unwrapped;
}

View file

@ -77,7 +77,7 @@ enum Source {
// INFO: yt-dlp supports a lot of sites; so, when archiving (for example) a website, the user
// -> should be asked whether they want to archive the whole website or just the video(s) on it.
fn determine_source(path: &str) -> Source {
// INFO: Extractor URLs can be found here:
// INFO: Extractors' URLs can be found here:
// -> https://github.com/yt-dlp/yt-dlp/tree/dfc0a84c192a7357dd1768cc345d590253a14fe5/yt_dlp/extractor
// TEST: X posts can have multiple videos.
@ -272,7 +272,13 @@ fn main() -> Result<()> {
// Dir or whatever. it's midnight and my brain ain't wording/braining.
if hash_exists {
println!("File already archived.");
let _ = fs::remove_file(store_path.join("temp").join(&timestamp));
let _ = fs::remove_file(
store_path
.join("temp")
.join(&timestamp)
.join(format!("{timestamp}{file_extension}")),
);
process::exit(0);
} else {
move_temp_to_raw(
&store_path
@ -282,7 +288,6 @@ fn main() -> Result<()> {
&hash,
&store_path,
)?;
let _ = fs::remove_file(store_path.join("temp").join(&timestamp));
println!("File archived successfully.");
}