File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
packages/metascraper-youtube Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,6 @@ const { isString } = require('lodash')
7
7
8
8
const getThumbnailUrl = id => `https://i.ytimg.com/vi/${ id } /maxresdefault.jpg`
9
9
10
- const getVideo = url => getVideoId ( url ) || { }
11
-
12
10
const wrap = rule => ( { htmlDom } ) => {
13
11
const value = rule ( htmlDom )
14
12
return isString ( value ) && ! isUrl ( value , { relative : false } ) && titleize (
@@ -23,11 +21,11 @@ module.exports = () => ({
23
21
wrap ( $ => getValue ( $ , $ ( '[class*="user-info"]' ) ) )
24
22
] ,
25
23
publisher : [
26
- ( { url} ) => getVideo ( url ) . service === 'youtube' && 'YouTube'
24
+ ( { url} ) => getVideoId ( url ) . service === 'youtube' && 'YouTube'
27
25
] ,
28
26
image : [
29
27
( { htmlDom, url } ) => {
30
- const { id, service} = getVideo ( url )
28
+ const { id, service} = getVideoId ( url )
31
29
return service === 'youtube' && id && getThumbnailUrl ( id )
32
30
}
33
31
]
Original file line number Diff line number Diff line change 21
21
" metascraper"
22
22
],
23
23
"dependencies" : {
24
- "get-video-id" : " ~2.1.7 "
24
+ "get-video-id" : " ~3.0.0 "
25
25
},
26
26
"devDependencies" : {
27
27
"clear-module" : " latest" ,
You can’t perform that action at this time.
0 commit comments