feat: add Streamable downloader endpoint + fix detect false-positive
Deploy Scraper / build-and-deploy (push) Canceled after 0s
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:
@@ -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(¶ms.url).await?;
|
||||
Ok(Json(DownloadResponse::ok(result)))
|
||||
}
|
||||
|
||||
/// Handler for _bilibili.
|
||||
pub async fn download_bilibili(
|
||||
Query(params): Query<DownloadParams>,
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user