Files
mostlymatter/server/channels/app/oembed/providers_gen.go
Harrison Healey 76021c76a0 MM-60351 Use oEmbed for YouTube links (#28312)
* Split up handling of permalinks and other links in getLinkMetadata

* MM-60351 Use oEmbed for YouTube links

* Explicitly request json from the oEmbed provider

* Fix linter

* Fix type of CacheAge field

* Address feedback
2024-10-01 14:06:45 -04:00

36 строки
1.1 KiB
Go

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// Code generated by "go generate ./channels/app/oembed"
// DO NOT EDIT
//go:generate go run ./generator/providers_generator.go
package oembed
import (
"regexp"
)
var providers []*ProviderEndpoint
func init() {
providers = []*ProviderEndpoint{
{
URL: "https://www.youtube.com/oembed",
Patterns: []*regexp.Regexp{
regexp.MustCompile(`^https://[^/]*?\.youtube\.com/watch.*?$`),
regexp.MustCompile(`^https://[^/]*?\.youtube\.com/v/.*?$`),
regexp.MustCompile(`^https://youtu\.be/.*?$`),
regexp.MustCompile(`^https://[^/]*?\.youtube\.com/playlist\?list=.*?$`),
regexp.MustCompile(`^https://youtube\.com/playlist\?list=.*?$`),
regexp.MustCompile(`^https://[^/]*?\.youtube\.com/shorts.*?$`),
regexp.MustCompile(`^https://youtube\.com/shorts.*?$`),
regexp.MustCompile(`^https://[^/]*?\.youtube\.com/embed/.*?$`),
regexp.MustCompile(`^https://[^/]*?\.youtube\.com/live.*?$`),
regexp.MustCompile(`^https://youtube\.com/live.*?$`),
},
},
}
}