metascraper-youtube 5.33.5 → 5.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +3 -14
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -1,17 +1,10 @@
1
1
  'use strict'
2
2
 
3
+ const { $filter, author, toRule, memoizeOne } = require('@metascraper/helpers')
3
4
  const reachableUrl = require('reachable-url')
4
5
  const getVideoId = require('get-video-id')
5
6
  const pLocate = require('p-locate')
6
7
 
7
- const {
8
- $filter,
9
- author,
10
- description,
11
- toRule,
12
- memoizeOne
13
- } = require('@metascraper/helpers')
14
-
15
8
  const THUMBAILS_RESOLUTIONS = [
16
9
  'maxresdefault.jpg',
17
10
  'sddefault.jpg',
@@ -32,8 +25,6 @@ const getThumbnailUrl = (id, gotOpts) => {
32
25
 
33
26
  const toAuthor = toRule(author)
34
27
 
35
- const toDescription = toRule(description)
36
-
37
28
  const getVideoInfo = memoizeOne(getVideoId)
38
29
 
39
30
  const test = memoizeOne(url => getVideoInfo(url).service === 'youtube')
@@ -41,11 +32,9 @@ const test = memoizeOne(url => getVideoInfo(url).service === 'youtube')
41
32
  module.exports = ({ gotOpts } = {}) => {
42
33
  const rules = {
43
34
  author: [
44
- toAuthor($ => $filter($, $('#owner-name'))),
45
- toAuthor($ => $filter($, $('#channel-title'))),
46
- toAuthor($ => $filter($, $('[class*="user-info" i]')))
35
+ toAuthor($ => $filter($, $('[class*="user-info" i]'))),
36
+ toAuthor($ => $('[itemprop="author"] [itemprop="name"]').attr('content'))
47
37
  ],
48
- description: [toDescription($ => $filter($, $('#description')))],
49
38
  publisher: () => 'YouTube',
50
39
  image: [
51
40
  ({ url }) => {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "metascraper-youtube",
3
3
  "description": "Metascraper integration with YouTube",
4
4
  "homepage": "https://nicedoc.io/microlinkhq/metascraper/packages/metascraper-youtube",
5
- "version": "5.33.5",
5
+ "version": "5.34.0",
6
6
  "main": "index.js",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",
@@ -23,7 +23,7 @@
23
23
  "youtube"
24
24
  ],
25
25
  "dependencies": {
26
- "@metascraper/helpers": "^5.33.5",
26
+ "@metascraper/helpers": "^5.33.7",
27
27
  "get-video-id": "~3.6.5",
28
28
  "p-locate": "~5.0.0",
29
29
  "reachable-url": "~1.7.1"
@@ -47,5 +47,5 @@
47
47
  "!test/helpers.js"
48
48
  ]
49
49
  },
50
- "gitHead": "6cd369d2522c238f72b411e67b7399ebf8808b1c"
50
+ "gitHead": "28a9f7b05f8f8a2d1551837035dbcffae8f9eaf4"
51
51
  }