diff --git a/Cargo.toml b/Cargo.toml index cf5e710..b91eccf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,3 +20,4 @@ wreq = { version = "5", features = ["full"] } wreq-util = "2" percent-encoding = "2.1" capitalize = "0.3.4" +md5 = "0.8.0" diff --git a/src/providers/hentaimoon.rs b/src/providers/hentaimoon.rs index 2b504d6..7e6867a 100644 --- a/src/providers/hentaimoon.rs +++ b/src/providers/hentaimoon.rs @@ -13,6 +13,7 @@ use std::env; use std::vec; use wreq::{Client, Proxy}; use wreq_util::Emulation; +use md5; error_chain! { foreign_links { @@ -212,7 +213,7 @@ impl HentaimoonProvider { .to_string(); // html decode title = decode(title.as_bytes()).to_string().unwrap_or(title); - let id = video_url.split("/").collect::>()[4].to_string(); + let id = format!("{:x}", md5::compute(title.clone())); let raw_duration = video_segment.split("
").collect::>()[1] .split("<") .collect::>()[0]