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:
1 parent
7850b5fa03
commit
dfa37f86e3
4 files changed
+123
-3
No files matched your search
@@ -115,6 +115,10 @@ pub async fn download_reddit(url: &str) -> Result<DownloadResult, ScrapingError>
|
||||
DownloaderRepository::download_reddit(url).await
|
||||
}
|
||||
|
||||
pub async fn download_streamable(url: &str) -> Result<DownloadResult, ScrapingError> {
|
||||
DownloaderRepository::download_streamable(url).await
|
||||
}
|
||||
|
||||
pub async fn download_bilibili(url: &str) -> Result<DownloadResult, ScrapingError> {
|
||||
DownloaderRepository::download_bilibili(url).await
|
||||
}
|
||||
@@ -131,10 +135,12 @@ pub fn detect_platform(url: &str) -> String {
|
||||
"youtube".to_string()
|
||||
} else if url.contains("open.spotify.com") || url.contains("spotify.link") {
|
||||
"spotify".to_string()
|
||||
} else if url.contains("twitter.com") || url.contains("x.com") || url.contains("t.co") {
|
||||
} else if url.contains("twitter.com") || url.contains("x.com") || url.contains("t.co/") {
|
||||
"twitter".to_string()
|
||||
} else if url.contains("pinterest") {
|
||||
"pinterest".to_string()
|
||||
} else if url.contains("reddit.com") || url.contains("redd.it") {
|
||||
"reddit".to_string()
|
||||
} else if url.contains("mega.nz") || url.contains("mega.io") {
|
||||
"mega".to_string()
|
||||
} else if url.contains("terabox") || url.contains("nfile") {
|
||||
@@ -157,8 +163,8 @@ pub fn detect_platform(url: &str) -> String {
|
||||
"soundcloud".to_string()
|
||||
} else if url.contains("dailymotion.com") {
|
||||
"dailymotion".to_string()
|
||||
} else if url.contains("reddit.com") || url.contains("redd.it") {
|
||||
"reddit".to_string()
|
||||
} else if url.contains("streamable.com") {
|
||||
"streamable".to_string()
|
||||
} else if url.contains("bilibili.com") || url.contains("b23.tv") {
|
||||
"bilibili".to_string()
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user