mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Re-add embed attribute as html
This commit is contained in:
parent
f5730fce7e
commit
579ec7e7dc
@ -39,11 +39,13 @@ const oEmbedProviders = JSON.parse(oEmbedProvidersFile)
|
||||
|
||||
const fetchEmbed = async targetUrl => {
|
||||
const url = new URL(targetUrl)
|
||||
const {
|
||||
endpoints: [endpoint],
|
||||
} = oEmbedProviders.find(provider => {
|
||||
const provider = oEmbedProviders.find(provider => {
|
||||
return provider.provider_url.includes(url.hostname)
|
||||
})
|
||||
if (!provider) return {}
|
||||
const {
|
||||
endpoints: [endpoint],
|
||||
} = provider
|
||||
const endpointUrl = new URL(endpoint.url)
|
||||
endpointUrl.searchParams.append('url', targetUrl)
|
||||
endpointUrl.searchParams.append('format', 'json')
|
||||
|
||||
@ -11,6 +11,7 @@ type Embed {
|
||||
video: String
|
||||
lang: String
|
||||
logo: String
|
||||
html: String
|
||||
sources: [String]
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user