Re-add embed attribute as html

This commit is contained in:
Robert Schäfer 2019-07-20 17:49:03 +02:00
parent f5730fce7e
commit 579ec7e7dc
2 changed files with 6 additions and 3 deletions

View File

@ -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')

View File

@ -11,6 +11,7 @@ type Embed {
video: String
lang: String
logo: String
html: String
sources: [String]
}