Skip to content

Commit

Permalink
Merge pull request #67 from sumeetweb/fix-wistia-27-nov
Browse files Browse the repository at this point in the history
Updated wisitia url patterns
  • Loading branch information
sumeetweb authored Nov 27, 2024
2 parents 1c1a3bc + f7f6b6b commit afcaa5e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions include/downloader.functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ function chapterwise_download($datas)
}
}

# Find a string similar to https://fast.wistia.net/embed/iframe/*
$regex = '/https:\/\/fast.wistia.net\/embed\/iframe\/[a-zA-Z0-9]+/';
# Find a string similar to //fast.wistia.net/embed/iframe/*
// $regex = '/\/\/fast.wistia.net\/embed\/iframe\/[a-zA-Z0-9]+/';
$regex = '/(?:\w+\.)?(wistia\.(?:com|net)|wi\.st)\/(?:medias|embed(?:\/(?:iframe|medias))?)\/([a-zA-Z0-9]+)/';

preg_match_all($regex, $temp2, $matches, PREG_SET_ORDER, 0);
$first_set_matches = array_unique($matches, SORT_REGULAR);

Expand Down Expand Up @@ -218,7 +220,8 @@ function chapterwise_download($datas)

$decoded_prompt = unicode_decode($qs["prompt"]);

$pattern = '/fast.wistia.net\/embed\/iframe\/[a-zA-Z0-9]+/';
// $pattern = '/fast.wistia.net\/embed\/iframe\/[a-zA-Z0-9]+/';
$pattern = '/(?:\w+\.)?(wistia\.(?:com|net)|wi\.st)\/(?:medias|embed(?:\/(?:iframe|medias))?)\/([a-zA-Z0-9]+)/';
preg_match_all($pattern, $decoded_prompt, $matches, PREG_SET_ORDER, 0);
$first_set_matches = array_unique($matches, SORT_REGULAR);
if(!empty($first_set_matches)) {
Expand Down

0 comments on commit afcaa5e

Please sign in to comment.