fallback to link type where possible

This commit is contained in:
Grzegorz Leoniec 2018-12-28 19:43:29 +01:00
parent f8f0ff3d06
commit 8e71c27b52
No known key found for this signature in database
GPG Key ID: 3AA43686D4EB1377

View File

@ -140,7 +140,7 @@ const scraper = {
}
if (data) {
let output = {
type: data.type,
type: data.type || 'link',
embed: data.html,
author: data.author_name,
date: data.upload_date ? new Date(data.upload_date).toISOString() : null
@ -163,6 +163,7 @@ const scraper = {
const metadata = await metascraper({ html, url })
metadata.sources = ['resource']
metadata.type = 'link'
return metadata
}