metascraper-media-provider 5.42.5 → 5.43.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.
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "metascraper-media-provider",
|
|
3
3
|
"description": "Get video property from HTML markup",
|
|
4
4
|
"homepage": "https://github.com/microlinkhq/metascraper/packages/metascraper-media-provider",
|
|
5
|
-
"version": "5.
|
|
5
|
+
"version": "5.43.0",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"types": "src/index.d.ts",
|
|
8
8
|
"author": {
|
|
@@ -24,12 +24,11 @@
|
|
|
24
24
|
"youtube-dl"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@metascraper/helpers": "^5.
|
|
27
|
+
"@metascraper/helpers": "^5.43.0",
|
|
28
28
|
"async-memoize-one": "~1.1.3",
|
|
29
29
|
"debug-logfmt": "~1.0.4",
|
|
30
30
|
"got": "~11.8.6",
|
|
31
31
|
"lodash": "~4.17.21",
|
|
32
|
-
"p-do-whilst": "~1.1.0",
|
|
33
32
|
"p-reflect": "~2.1.0",
|
|
34
33
|
"p-retry": "~4.6.1",
|
|
35
34
|
"p-timeout": "~4.1.0",
|
|
@@ -60,5 +59,5 @@
|
|
|
60
59
|
"!test/fixtures/generate.js"
|
|
61
60
|
]
|
|
62
61
|
},
|
|
63
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "f3618bfad5ee6b806c272e2a69ed9d9255334beb"
|
|
64
63
|
}
|
|
@@ -6,7 +6,6 @@ const debug = require('debug-logfmt')(
|
|
|
6
6
|
const { serializeError } = require('serialize-error')
|
|
7
7
|
const youtubedl = require('youtube-dl-exec')
|
|
8
8
|
const { get, constant } = require('lodash')
|
|
9
|
-
const pDoWhilst = require('p-do-whilst')
|
|
10
9
|
const pTimeout = require('p-timeout')
|
|
11
10
|
|
|
12
11
|
const RE_UNSUPORTED_URL = /Unsupported URL/
|
|
@@ -53,16 +52,19 @@ module.exports = ({
|
|
|
53
52
|
const userAgent = get(gotOpts, 'headers.user-agent')
|
|
54
53
|
|
|
55
54
|
const task = async () => {
|
|
56
|
-
|
|
55
|
+
do {
|
|
57
56
|
try {
|
|
58
57
|
const proxy = getProxy({ url, retryCount: retryCount++ })
|
|
59
58
|
const flags = getFlags({ url, proxy, userAgent, cacheDir })
|
|
60
59
|
data = await youtubedl(url, flags, { timeout, ...props })
|
|
61
60
|
} catch (error) {
|
|
62
|
-
if (condition()) {
|
|
61
|
+
if (condition()) {
|
|
62
|
+
debug('getInfo:error', { retryCount }, serializeError(error))
|
|
63
|
+
}
|
|
63
64
|
isSupportedURL = !RE_UNSUPORTED_URL.test(error.stderr)
|
|
65
|
+
console.log('catch', { isSupportedURL })
|
|
64
66
|
}
|
|
65
|
-
}
|
|
67
|
+
} while (condition())
|
|
66
68
|
|
|
67
69
|
return data
|
|
68
70
|
}
|