PT URL format has changed and doesn't match the /video/watch/ pattern check

Created on 15 September 2021, over 3 years ago
Updated 17 May 2025, 17 days ago

After an update PT is now generating URLs in the format
domain.com/w/XXX

for videos vs the old format
domain.com/videos/watch/XXX

Which no longer passes the URL regex.

I have solved it temporarily with the following change in src/Plugin/video_embed_field/Provider/Peertube.php

 54       preg_match('/^https?:\/\/(www\.)?' . $domain . '\/videos\/(watch|embed)\/(?<id>[0-9A-Za-z_-]*)/', $input, $matches);
 55       if(empty($matches)) {
 56         preg_match('/^https?:\/\/(www\.)?' . $domain . '\/w\/(?<id>[0-9A-Za-z_-]*)/', $input, $matches);
 57       }
🐛 Bug report
Status

Active

Version

1.2

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024