Skip to content

Commit

Permalink
support Loom, VK Clips, and Loom in /cobalt_download
Browse files Browse the repository at this point in the history
  • Loading branch information
jelni committed Jul 8, 2024
1 parent 57d6223 commit c42655a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/apis/cobalt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,16 @@ pub enum Service {
Odnoklassniki,
Dailymotion,
Twitter,
Loom,
Vimeo,
Streamable,
Vk,
Tiktok,
Reddit,
TwitchClips,
YoutubeShorts,
#[serde(untagged)]
Vine,
#[serde(other)]
Unknown,
}

Expand All @@ -129,13 +131,15 @@ impl Service {
Self::Odnoklassniki => Some("Odnoklassniki"),
Self::Dailymotion => Some("Dailymotion"),
Self::Twitter => Some("Twitter"),
Self::Loom => Some("Loom"),
Self::Vimeo => Some("Vimeo"),
Self::Streamable => Some("Streamable"),
Self::Vk => Some("VK"),
Self::Tiktok => Some("TikTok"),
Self::Reddit => Some("Reddit"),
Self::TwitchClips => Some("Twitch (Clips)"),
Self::YoutubeShorts => Some("YouTube (Shorts)"),
Self::Vine => Some("Vine"),
Self::Unknown => None,
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/commands/cobalt_download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ const SERVICE_URLS: &[(Service, &[&str])] = &[
(Service::Odnoklassniki, &["ok.ru/"]),
(Service::Dailymotion, &["www.dailymotion.com/video/", "dailymotion.com/video/"]),
(Service::Twitter, &["x.com/", "twitter.com/"]),
(Service::Loom, &["www.loom.com/share/", "loom.com/share/"]),
(Service::Vimeo, &["vimeo.com/"]),
(Service::Streamable, &["streamable.com/"]),
(Service::Vk, &["https://vk.com/video-"]),
(Service::Vk, &["vk.com/video-", "vk.com/clip-"]),
(Service::Tiktok, &["www.tiktok.com/", "tiktok.com/", "vm.tiktok.com/"]),
(Service::Reddit, &["www.reddit.com/", "reddit.com/"]),
(Service::TwitchClips, &["clips.twitch.tv/"]),
(Service::YoutubeShorts, &["www.youtube.com/shorts/", "youtube.com/shorts/"]),
(Service::Vine, &["vine.co/v/"]),
];

pub struct CobaltDownload {
Expand Down

0 comments on commit c42655a

Please sign in to comment.