diff --git a/src/ms_data_source.rs b/src/ms_data_source.rs index 535c524..db9ca00 100644 --- a/src/ms_data_source.rs +++ b/src/ms_data_source.rs @@ -7,7 +7,7 @@ use crate::Champion; pub struct MSDataSource; -const CHAMP_PATTERN: &str = " href=\"https://www.metasrc.com/5v5/champion/"; +const CHAMP_PATTERN: &str = " href=https://www.metasrc.com/5v5/champion/"; impl DataSource for MSDataSource { fn get_alias(&self) -> &str { @@ -36,11 +36,11 @@ impl DataSource for MSDataSource { while let Some(mut p) = pos { p += CHAMP_PATTERN.len(); let role = - &page[p + page[p..].find('/').unwrap() + 1..p + page[p..].find('"').unwrap()]; + &page[p + page[p..].find('/').unwrap() + 1..p + page[p..].find('>').unwrap()]; - let k = p + page[p..].find("data-search-terms-like=\"").unwrap() + 24; + let k = p + page[p..].find("data-search-terms-like=").unwrap() + 23; let pipe = k + page[k..].find('|').unwrap() + 1; - let key = &page[pipe..pipe + page[pipe..].find('"').unwrap()]; + let key = &page[pipe..pipe + page[pipe..].find(' ').unwrap()].replace("\"", ""); let id = champion.data.get(key).unwrap().key.parse::().unwrap();