1
Fork 0
mirror of https://github.com/thegeneralist01/archivr synced 2026-07-22 03:05:32 +02:00

refactor: extract archive core crate

This commit is contained in:
TheGeneralist 2026-06-01 22:37:57 +02:00
parent 0b2afe6398
commit 3cf2c9cd3a
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
14 changed files with 34 additions and 13 deletions

View file

@ -1,4 +1,5 @@
use anyhow::{Context, Result};
use archivr_core::{database, downloader, twitter::parse_tweet_id};
use chrono::Local;
use clap::{Parser, Subcommand};
use serde_json::json;
@ -9,11 +10,6 @@ use std::{
process,
};
mod database;
mod downloader;
mod hash;
mod twitter;
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
struct Args {
@ -87,8 +83,6 @@ enum Source {
Other,
}
use crate::twitter::parse_tweet_id;
fn expand_shorthand_to_url(path: &str, source: &Source) -> String {
if *source == Source::X && (path.starts_with("tweet:media:") || path.starts_with("x:media:")) {
if let Some(tweet_id) = path.split(':').next_back().and_then(parse_tweet_id) {