From 4850a8ddd307dec6447c2e266ac8fb74a64442f2 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Mon, 17 Mar 2025 00:30:35 +0100 Subject: [PATCH] config.php: add WIP embedding_2 --- inc/config.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/inc/config.php b/inc/config.php index 25031bfb..a604bb84 100644 --- a/inc/config.php +++ b/inc/config.php @@ -1265,6 +1265,36 @@ $config['embed_width'] = 300; $config['embed_height'] = 246; + /** + * Replacement parameters: + * - $1-$N: matched arguments from 'match_regex'. + * - %%thumbnail_path%%: Path to the downloaded thumbnail. + */ + $config['embedding_2'] = [ + [ + 'match_regex' => '/^(?:(?:https?:)?\/\/)?((?:www|m)\.)?(?:(?:youtube(?:-nocookie)?\.com|youtu\.be))(?:\/(?:[\w\-]+\?v=|embed\/|live\/|v\/)?)([\w\-]{11})((?:\?|\&)\S+)?$/i', + 'type' => 'regex', + 'thumbnail_url' => 'https://img.youtube.com/vi/$2/0.jpg', + 'html' => '
+ + + +
' + ], + [ + 'match_regex' => '/^https?:\/\/(\w+\.)?tiktok\.com\/@[a-z0-9\-_]+\/video\/([0-9]+)\?.*$/i', + 'type' => 'oembed', + 'provider' => 'https://www.youtube.com/oembed', + 'thumb_width' => 288, + 'thumb_height' => 512, + 'html' => '
+ + + +
' + ] + ]; + /* * ==================== * Error messages