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:
parent
0b2afe6398
commit
3cf2c9cd3a
14 changed files with 34 additions and 13 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue