uploaders
This commit is contained in:
@@ -474,6 +474,19 @@ impl NoodlemagazineProvider {
|
||||
if normalized.is_empty() || !self.is_allowed_thumb_url(&normalized) {
|
||||
return String::new();
|
||||
}
|
||||
let Some(url) = Url::parse(&normalized).ok() else {
|
||||
return String::new();
|
||||
};
|
||||
if url
|
||||
.host_str()
|
||||
.is_some_and(|host| host.eq_ignore_ascii_case("img.pvvstream.pro"))
|
||||
{
|
||||
return crate::providers::build_proxy_url(
|
||||
_options,
|
||||
"noodlemagazine-thumb",
|
||||
&crate::providers::strip_url_scheme(&normalized),
|
||||
);
|
||||
}
|
||||
normalized
|
||||
}
|
||||
|
||||
@@ -707,7 +720,7 @@ mod tests {
|
||||
assert_eq!(items.len(), 1);
|
||||
assert_eq!(
|
||||
items[0].thumb,
|
||||
"https://img.pvvstream.pro/preview/abc/-111_222/240/iv.okcdn.ru/getVideoPreview?id=1&type=39&fn=vid_l"
|
||||
"https://example.com/proxy/noodlemagazine-thumb/img.pvvstream.pro/preview/abc/-111_222/240/iv.okcdn.ru/getVideoPreview?id=1&type=39&fn=vid_l"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user