Revert "fix: remove instagram session file"

This reverts commit ebffa20ec9.

Revert "fix: env var"

This reverts commit d20d825905.
This commit is contained in:
Kristofers Solo 2025-10-27 07:57:56 +02:00
parent 6a50806fa5
commit ff21c5c519
Signed by: kristoferssolo
GPG Key ID: 74FF8144483D82C8
2 changed files with 9 additions and 1 deletions

View File

@ -13,7 +13,7 @@ COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
# Build application
COPY . .
RUN cargo build --release --no-default-features --features youtube
RUN cargo build --release
FROM ghcr.io/astral-sh/uv:trixie-slim AS builder-py

View File

@ -8,6 +8,7 @@ use crate::{
use futures::{StreamExt, stream};
use std::{
cmp::min,
env,
ffi::OsStr,
fs::{self, metadata},
path::{Path, PathBuf},
@ -110,7 +111,14 @@ async fn run_command_in_tempdir(cmd: &str, args: &[&str]) -> Result<DownloadResu
/// - Propagates `run_command_in_tempdir` errors.
#[cfg(feature = "instagram")]
pub async fn download_instaloader(shortcode: &str) -> Result<DownloadResult> {
fn get_env_var(name: &str) -> Result<String> {
env::var(name).map_err(|_| Error::env(name))
}
let session_file = get_env_var("IG_SESSION_PATH")?;
let args = [
"--sessionfile",
&session_file,
"--dirname-pattern=.",
"--no-metadata-json",
"--no-compress-json",