[TelegramBridge] Fix forwarded videos (#1202)

Videos forwarded from other channels use a slightly different format, This fixes it.
This commit is contained in:
triatic 2019-07-06 10:52:56 +01:00 committed by LogMANOriginal
parent 50162f52b6
commit a31e518a07

View file

@ -224,7 +224,11 @@ EOD;
$this->itemTitle = '@' . $this->processUsername() . ' posted a video';
}
preg_match($this->backgroundImageRegex, $messageDiv->find('i.tgme_widget_message_video_thumb', 0)->style, $photo);
if ($messageDiv->find('i.tgme_widget_message_video_thumb')) {
preg_match($this->backgroundImageRegex, $messageDiv->find('i.tgme_widget_message_video_thumb', 0)->style, $photo);
} elseif ($messageDiv->find('i.link_preview_video_thumb')) {
preg_match($this->backgroundImageRegex, $messageDiv->find('i.link_preview_video_thumb', 0)->style, $photo);
}
$this->enclosures[] = $photo[1];
@ -261,7 +265,11 @@ EOD;
$this->itemTitle = '@' . $this->processUsername() . ' posted a video';
}
preg_match($this->backgroundImageRegex, $messageDiv->find('i.tgme_widget_message_video_thumb', 0)->style, $photo);
if ($messageDiv->find('i.tgme_widget_message_video_thumb')) {
preg_match($this->backgroundImageRegex, $messageDiv->find('i.tgme_widget_message_video_thumb', 0)->style, $photo);
} elseif ($messageDiv->find('i.link_preview_video_thumb')) {
preg_match($this->backgroundImageRegex, $messageDiv->find('i.link_preview_video_thumb', 0)->style, $photo);
}
$this->enclosures[] = $photo[1];