Skip to content

Commit

Permalink
fix: Regex failed to match valid embeds
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoniePhiline committed Jan 21, 2023
1 parent 1ab8ffc commit c717c8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async fn extract_and_download(state: Arc<State>, url: &str) -> Result<()> {
async fn process_simple_embeds(page_body: &str, referer: &str, state: Arc<State>) -> Result<()> {
lazy_static! {
static ref RE: Regex = Regex::new(
r#"<iframe[^>]+ src="(?P<embed_url>https://player\.vimeo\.com/video/[^"]+)""#
r#"<iframe[^>]* src="(?P<embed_url>https://player\.vimeo\.com/video/[^"]+)""#
)
.unwrap();
}
Expand Down Expand Up @@ -160,7 +160,7 @@ async fn extract_simple_embed_title(video: Arc<Video>, referer: &str) -> Result<
async fn process_showcases(page_body: &str, referer: &str, state: Arc<State>) -> Result<()> {
lazy_static! {
static ref RE: Regex =
Regex::new(r#"<iframe[^>]+ src="(?P<embed_url>https://vimeo\.com/showcase/[^"]+)""#)
Regex::new(r#"<iframe[^>]* src="(?P<embed_url>https://vimeo\.com/showcase/[^"]+)""#)
.unwrap();
}

Expand Down

0 comments on commit c717c8d

Please sign in to comment.