feat: add Streamable downloader endpoint + fix detect false-positive
Deploy Scraper / build-and-deploy (push) Canceled after 0s

- /download/streamable: real MP4 via yt-dlp (verified ftypisom)
- Fix detect_platform: t.co substring greedily matched reddit.com
  ('.reddit.com' contains 't.co') - now requires t.co/ path
- Removed duplicate reddit branch in detect chain
This commit is contained in:
asepharyana
2026-09-01 18:23:49 +07:00
parent 7850b5fa03
commit dfa37f86e3
4 changed files with 123 additions and 3 deletions
+8
View File
@@ -211,6 +211,14 @@ pub async fn download_reddit(
Ok(Json(DownloadResponse::ok(result)))
}
/// Handler for _streamable.
pub async fn download_streamable(
Query(params): Query<DownloadParams>,
) -> Result<Json<DownloadResponse>, AppError> {
let result = use_cases::download_streamable(&params.url).await?;
Ok(Json(DownloadResponse::ok(result)))
}
/// Handler for _bilibili.
pub async fn download_bilibili(
Query(params): Query<DownloadParams>,
+4
View File
@@ -244,6 +244,10 @@ pub fn build_router(app_state: Arc<AppState>) -> anyhow::Result<Router> {
"/download/reddit",
axum::routing::get(crate::presentation::handler::downloader::download_reddit),
)
.route(
"/download/streamable",
axum::routing::get(crate::presentation::handler::downloader::download_streamable),
)
.route(
"/download/bilibili",
axum::routing::get(crate::presentation::handler::downloader::download_bilibili),