metascraper-spotify 5.28.1 → 5.28.2
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.
- package/index.js +7 -2
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const { composeRule, memoizeOne } = require('@metascraper/helpers')
|
|
4
3
|
const asyncMemoizeOne = require('async-memoize-one')
|
|
5
4
|
const { getDomainWithoutSuffix } = require('tldts')
|
|
6
5
|
const memoize = require('@keyvhq/memoize')
|
|
7
6
|
const got = require('got')
|
|
8
7
|
|
|
8
|
+
const {
|
|
9
|
+
composeRule,
|
|
10
|
+
memoizeOne,
|
|
11
|
+
normalizeUrl
|
|
12
|
+
} = require('@metascraper/helpers')
|
|
13
|
+
|
|
9
14
|
const { getPreview } = require('spotify-url-info')((url, opts) =>
|
|
10
15
|
got(url, opts).then(res => ({
|
|
11
16
|
text: () => Promise.resolve(res.body)
|
|
@@ -29,7 +34,7 @@ const isValidUrl = memoizeOne(url => getDomainWithoutSuffix(url) === 'spotify')
|
|
|
29
34
|
|
|
30
35
|
module.exports = ({ gotOpts, keyvOpts } = {}) => {
|
|
31
36
|
const spotify = createSpotify({ gotOpts, keyvOpts })
|
|
32
|
-
const getSpotify = composeRule(($, url) => spotify(url))
|
|
37
|
+
const getSpotify = composeRule(($, url) => spotify(normalizeUrl(url)))
|
|
33
38
|
|
|
34
39
|
const rules = {
|
|
35
40
|
audio: getSpotify({ from: 'audio', ext: 'mp3' }),
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "metascraper-spotify",
|
|
3
3
|
"description": "Metascraper integration with Spotify",
|
|
4
4
|
"homepage": "https://nicedoc.io/microlinkhq/metascraper/packages/metascraper-spotify",
|
|
5
|
-
"version": "5.28.
|
|
5
|
+
"version": "5.28.2",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"author": {
|
|
8
8
|
"email": "hello@microlink.io",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@keyvhq/memoize": "~1.6.6",
|
|
27
|
-
"@metascraper/helpers": "^5.
|
|
27
|
+
"@metascraper/helpers": "^5.28.2",
|
|
28
28
|
"async-memoize-one": "~1.1.0",
|
|
29
29
|
"got": "~11.8.3",
|
|
30
30
|
"spotify-url-info": "~3.0.0",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"test": "NODE_PATH=.. TZ=UTC NODE_ENV=test mocha test"
|
|
48
48
|
},
|
|
49
49
|
"license": "MIT",
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "373d7f2b46ca3d1f163c412c1735daaf9434568d"
|
|
51
51
|
}
|