Skip to content

Commit 99a52ef

Browse files
committed
Tweaks
1 parent 6fd95b4 commit 99a52ef

File tree

1 file changed

+4
-8
lines changed
  • packages/metascraper-media-provider/src

1 file changed

+4
-8
lines changed

packages/metascraper-media-provider/src/index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const {
77
has,
88
isEmpty,
99
isNil,
10-
isString,
1110
negate,
1211
overEvery
1312
} = require('lodash')
@@ -18,7 +17,8 @@ const {
1817
author: authorFn,
1918
description: descriptionFn,
2019
title: titleFn,
21-
url: urlFn
20+
url: urlFn,
21+
publisher
2222
} = require('@metascraper/helpers')
2323

2424
const createGetVideoInfo = require('./get-video-info')
@@ -85,7 +85,7 @@ const getAuthor = ({ uploader, creator, uploader_id: uploaderId }) =>
8585
find([creator, uploader, uploaderId], str => authorFn(str))
8686

8787
const getPublisher = ({ extractor_key: extractorKey }) =>
88-
isString(extractorKey) && extractorKey
88+
publisher(extractorKey)
8989

9090
const getTitle = ({ title: mainTitle, alt_title: secondaryTitle }) =>
9191
find([mainTitle, secondaryTitle], titleFn)
@@ -101,11 +101,7 @@ module.exports = opts => {
101101
const getVideoInfo = createGetVideoInfo(opts)
102102

103103
return {
104-
video: async ({ url }) => {
105-
const payload = await getVideoInfo(url)
106-
// console.log(JSON.stringify(payload))
107-
return getVideo(payload)
108-
},
104+
video: async ({ url }) => getVideo(await getVideoInfo(url)),
109105
audio: async ({ url }) => getAudio(await getVideoInfo(url)),
110106
author: async ({ url }) => getAuthor(await getVideoInfo(url)),
111107
publisher: async ({ url }) => getPublisher(await getVideoInfo(url)),

0 commit comments

Comments
 (0)