Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

feat(platforms): add support for P2P share codes in from_url method

Tonho40b8b0de67e1
diff --git a/src-tauri/omniget-core/src/platforms/mod.rs b/src-tauri/omniget-core/src/platforms/mod.rs
index 45cd15f1..37262e47 100644
--- a/src-tauri/omniget-core/src/platforms/mod.rs
+++ b/src-tauri/omniget-core/src/platforms/mod.rs
@@ -67,6 +67,11 @@ impl FromStr for Platform {
impl Platform {
pub fn from_url(url_str: &str) -> Option<Self> {
+ // P2P share codes: "p2p:word-word-word-word"
+ if url_str.starts_with("p2p:") {
+ return Some(Platform::Other("p2p".to_string()));
+ }
+
// Magnet links have no hostname, detect by scheme prefix
// .torrent URLs are also handled by the magnet downloader
if url_str.starts_with("magnet:") || url_str.ends_with(".torrent") {