mirror of
https://github.com/storytold/artcraft.git
synced 2026-10-27 12:10:08 -04:00
Compare commits
26
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41e021fcf5 | ||
|
|
e45c7886eb | ||
|
|
163464c3ee | ||
|
|
94ff298cfa | ||
|
|
c98aca330b | ||
|
|
f9da20315e | ||
|
|
4134c648ab | ||
|
|
56d40c7800 | ||
|
|
69adc0d95a | ||
|
|
0613e6d3ca | ||
|
|
4b77e589e8 | ||
|
|
71ba9e7286 | ||
|
|
e219c4728b | ||
|
|
0b3cce75f3 | ||
|
|
339fb8263c | ||
|
|
8cd0f543fa | ||
|
|
a25c4005a9 | ||
|
|
dbd89cdd10 | ||
|
|
9c1136710d | ||
|
|
7054e3a381 | ||
|
|
bbc4b98b50 | ||
|
|
6c2f60801e | ||
|
|
68624e81d8 | ||
|
|
5bbb0fdb06 | ||
|
|
8273822a5c | ||
|
|
e1427094c3 |
Generated
+1
-1
@@ -11520,7 +11520,6 @@ dependencies = [
|
||||
"redis_common",
|
||||
"redis_schema",
|
||||
"regex",
|
||||
"reqwest 0.12.23",
|
||||
"resend-rs",
|
||||
"reusable_types",
|
||||
"rust-s3",
|
||||
@@ -11552,6 +11551,7 @@ dependencies = [
|
||||
"utoipa-swagger-ui",
|
||||
"videos",
|
||||
"workspace-build-acceleration",
|
||||
"wreq",
|
||||
"zip 0.6.6",
|
||||
]
|
||||
|
||||
|
||||
+1
-1
@@ -300,7 +300,7 @@ toml = "0.8.23"
|
||||
url = { version = "2.5.4", features = ["serde"] }
|
||||
uuid = "1.18.1"
|
||||
|
||||
# NB(1): wreq gets past fingerprinting, but we have to deal with platform-specific build issues.
|
||||
# NB: wreq gets past fingerprinting, but we have to deal with platform-specific build issues.
|
||||
#
|
||||
# Mac:
|
||||
# brew install --formula cmake pkg-config llvm
|
||||
|
||||
@@ -22,8 +22,5 @@ workspace-build-acceleration.workspace = true
|
||||
once_cell.workspace = true
|
||||
wreq.workspace = true
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
wreq = { workspace = true, features = ["prefix-symbols"] }
|
||||
|
||||
[dev-dependencies]
|
||||
# (None)
|
||||
|
||||
@@ -16,11 +16,11 @@ path = "src/lib.rs"
|
||||
normal = ["workspace-build-acceleration"]
|
||||
|
||||
[dependencies]
|
||||
# Internal
|
||||
errors = { path = "../errors" }
|
||||
# cargo-hakari workspace hack (faster compile times)
|
||||
workspace-build-acceleration.workspace = true
|
||||
|
||||
# Workspace hack (faster compile times)
|
||||
workspace-build-acceleration = { version = "0.1", path = "../../workspace-build-acceleration" }
|
||||
# Internal
|
||||
errors.workspace = true
|
||||
|
||||
# External
|
||||
# (None yet)
|
||||
|
||||
@@ -52,7 +52,6 @@ email_sender= { path = "../../../lib/email_sender" }
|
||||
enums.workspace = true
|
||||
enums_public.workspace = true
|
||||
errors.workspace = true
|
||||
seedance2pro.workspace = true
|
||||
fal_client.workspace = true
|
||||
filesys.workspace = true
|
||||
google_sign_in = { path = "../../../api_clients/google_sign_in" }
|
||||
@@ -66,7 +65,6 @@ memory_caching = { path = "../../../lib/caching/memory_caching" }
|
||||
migration = { path = "../../../lib/migration" }
|
||||
mimetypes.workspace = true
|
||||
mysql_queries = { path = "../../../schema/database/mysql_queries" }
|
||||
#openai_sora_client = { path = "../../../api_clients/openai_sora_client" }
|
||||
password = { path = "../../../lib/password" }
|
||||
primitives = { path = "../../../lib/data/primitives" }
|
||||
prompt_engineering = { path = "../../../lib/machine_learning/prompt_engineering" }
|
||||
@@ -74,6 +72,7 @@ redis_caching = { path = "../../../lib/caching/redis_caching" }
|
||||
redis_common = { path = "../../../schema/database/redis_common" }
|
||||
redis_schema = { path = "../../../schema/database/redis_schema" }
|
||||
reusable_types = { path = "../../../schema/public/reusable_types" }
|
||||
seedance2pro.workspace = true
|
||||
server_environment = { path = "../../../lib/server_environment" }
|
||||
thumbnail_generator = { path = "../../../api_clients/thumbnail_generator" }
|
||||
tokens.workspace = true
|
||||
@@ -112,10 +111,12 @@ language-tags = "0.3.2" # Parsing single tags richly
|
||||
|
||||
# HTTP
|
||||
# TODO/NB: This is just for Twitch, but we might need it later.
|
||||
reqwest.workspace = true
|
||||
# reqwest.workspace = true
|
||||
wreq.workspace = true
|
||||
|
||||
# Email
|
||||
resend-rs = { version = "0.21.0", default-features = false, features = ["rustls-tls"] }
|
||||
|
||||
# NB: Both ring (via reqwest 0.12/hyper-rustls) and aws-lc-rs (via quinn/resend-rs)
|
||||
# are features of rustls 0.23 in this binary. rustls requires an explicit default
|
||||
# provider when multiple crypto providers are compiled in.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
use bytes::Bytes;
|
||||
use errors::AnyhowResult;
|
||||
use reqwest::{Client, IntoUrl};
|
||||
use wreq::Client;
|
||||
|
||||
const USER_AGENT: &str = "storyteller-web/1.0";
|
||||
|
||||
// TODO(bt, 2025-06-03): Don't load the entire file into memory!
|
||||
|
||||
/// Downloads a (binary) file to memory. Good for images, etc. Not great for large files.
|
||||
pub async fn http_download_url_to_bytes<U: IntoUrl>(url: U) -> AnyhowResult<Bytes> {
|
||||
pub async fn http_download_url_to_bytes(url: &str) -> AnyhowResult<Bytes> {
|
||||
let client = Client::builder()
|
||||
.gzip(true)
|
||||
.build()?;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
use crate::util::http_download_url_to_bytes::http_download_url_to_bytes;
|
||||
use errors::AnyhowResult;
|
||||
use reqwest::IntoUrl;
|
||||
use std::io::Write;
|
||||
use tempfile::NamedTempFile;
|
||||
|
||||
const USER_AGENT: &str = "storyteller-web/1.0";
|
||||
|
||||
/// Downloads a (binary) file to a filesystem path. Good for images, etc. Not great for large files.
|
||||
pub async fn http_download_url_to_tempfile<U: IntoUrl>(url: U, temp_file: &mut NamedTempFile) -> AnyhowResult<()> {
|
||||
pub async fn http_download_url_to_tempfile(url: &str, temp_file: &mut NamedTempFile) -> AnyhowResult<()> {
|
||||
let bytes = http_download_url_to_bytes(url).await?;
|
||||
temp_file.write_all(&bytes)?;
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user