Skip to content

Commit

Permalink
Support for Instagram TV. Fix issue #279.
Browse files Browse the repository at this point in the history
  • Loading branch information
jatorresrcn authored and m4olivei committed Aug 29, 2022
1 parent 3d95d5f commit 2a8023d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Pass/InstagramTransformPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ protected function getShortcodeAndUrl(DOMQuery $el)
foreach ($links as $link) {
$href = $link->attr('href');
$matches = [];
if (preg_match('&(*UTF8)instagram.com/p/([^/]+)/?&i', $href, $matches)) {
if (!empty($matches[1])) {
$shortcode = $matches[1];
if (preg_match('&(*UTF8)instagram.com/(p|tv)/([^/]+)/?&i', $href, $matches)) {
if (!empty($matches[2])) {
$shortcode = $matches[2];
$url = $href;
break;
}
Expand Down

0 comments on commit 2a8023d

Please sign in to comment.