diff --git a/src/providers/vrporn.rs b/src/providers/vrporn.rs index 902f08f..17c16f7 100644 --- a/src/providers/vrporn.rs +++ b/src/providers/vrporn.rs @@ -8,7 +8,7 @@ use crate::util::cache::VideoCache; use crate::util::parse_abbreviated_number; use crate::util::requester::Requester; use crate::util::time::parse_time_to_seconds; -use crate::videos::{ServerOptions, VideoEmbed, VideoFormat, VideoItem}; +use crate::videos::{ServerOptions, VideoFormat, VideoItem}; use async_trait::async_trait; use chrono::{DateTime, Utc}; use error_chain::error_chain; @@ -959,16 +959,6 @@ impl VrpornProvider { } } - if let Some(embed_url) = json_ld.get("embedUrl").and_then(Value::as_str) { - item.embed = Some(VideoEmbed { - html: format!( - "", - self.normalize_url(embed_url) - ), - source: self.normalize_url(embed_url), - }); - } - if let Some(content_url) = json_ld.get("contentUrl").and_then(Value::as_str) { let mut format = VideoFormat::new( content_url.to_string(), @@ -1220,4 +1210,40 @@ mod tests { assert!(formats[0].url.contains("free_4k.mp4")); assert!(formats[1].url.contains("free_6k.mp4")); } + + #[test] + fn detail_parser_ignores_embed_url() { + let provider = provider(); + let item = VideoItem::new( + "test".to_string(), + "Original".to_string(), + "https://vrporn.com/videos/test/".to_string(), + CHANNEL_ID.to_string(), + String::new(), + 0, + ); + let parsed = provider + .apply_detail_video( + item, + r#" + + + + + + + "#, + ) + .expect("detail HTML should parse"); + + assert_eq!(parsed.title, "Updated Title"); + assert!(parsed.embed.is_none()); + } }