Skip to Content Skip to Menu

youtube link throwing error in gallery

  • mjl1817
  • mjl1817
  • ONLINE
  • Posts: 57
  • Thanks: 7
  • Karma: 1
2 hours 30 minutes ago #344684 by mjl1817
Hi Kyle,We diagnosed a YouTube link problem and installed a working local workaround.Environment: Joomla 6.2.0, CB 2.12.0, CB Gallery 4.1.3, PHP 8.3.36.Both short youtu.be links and full YouTube watch URLs failed during Share Media with “Invalid or unsupported media link.”In FileHelper::getFileFromUrl(), Gallery’s server-side request received HTTP 200, but YouTube returned “Sign in to confirm you’re not a bot” instead of the normal video page. The response lacked the og metadata Gallery needs. YouTube’s official oEmbed endpoint successfully returned the video information from the same server.Our workaround adds a YouTube-only resolver after initial URL validation and before the disk-cache lookup:• Recognize approved YouTube hosts and validate the video ID.
• Request www.youtube.com/oembed with the canonical watch URL and format=json.
• Require a valid YouTube video response.
• Populate Gallery’s video metadata, title, dimensions and thumbnail.
• Construct
directly rather than inserting returned HTML.
• Leave non-YouTube links and Gallery’s subsequent permission/domain/storage checks on their existing paths.The request retains TLS verification, disables redirects and cookies, and uses bounded timeouts.We also corrected our Links acceptlist from youtube.com/youtu.be to youtube/youtu to match the installed domain comparison. That was a configuration issue on our end, but correcting it alone still left the YouTube metadata failure.After the workaround, the original failing link successfully saved and played in the native Gallery viewer. Bunny storage was not the cause.This appears to be a compatibility issue with scraping YouTube watch pages when YouTube serves a bot challenge to the server. Could Gallery use YouTube’s oEmbed endpoint for metadata, similar to its existing Vimeo handling?Thanks,
Mike

I wish I knew, Then we would both know.

Please Log in or Create an account to join the conversation.

Moderators: beat, nant, krileon
Powered by Kunena Forum