Skip to content

Commit f8734db

Browse files
committed
Remove postinstall script
Related: ytdl-org/youtube-dl#17208 (comment)
1 parent c3bd078 commit f8734db

File tree

5 files changed

+1
-55
lines changed

5 files changed

+1
-55
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,3 @@ coverage
3131
# Other
3232
############################
3333
.node_history
34-
packages/metascraper-video-provider/providers.json

packages/metascraper-video-provider/index.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,23 @@
22

33
const { round, size, get, chain, find, isString } = require('lodash')
44
const { isUrl, titleize } = require('@metascraper/helpers')
5-
const parseDomain = require('parse-domain')
65
const youtubedl = require('youtube-dl')
76
const { promisify } = require('util')
87
const path = require('path')
98

10-
const providers = require('./providers')
11-
129
const getInfo = promisify(youtubedl.getInfo)
1310

1411
let cachedVideoInfoUrl
1512
let cachedVideoInfo
1613

17-
const isSupportedProvided = url => providers.includes(parseDomain(url).domain)
18-
1914
/**
2015
* Get the video info.
2116
* Avoid do more one request for the same URL.
2217
*/
2318
const getVideoInfo = async url => {
2419
if (url === cachedVideoInfoUrl) return cachedVideoInfo
25-
2620
cachedVideoInfoUrl = url
2721

28-
if (!isSupportedProvided(url)) {
29-
cachedVideoInfo = {}
30-
return cachedVideoInfo
31-
}
32-
3322
try {
3423
cachedVideoInfo = await getInfo(url)
3524
} catch (err) {

packages/metascraper-video-provider/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,14 @@
1919
"@metascraper/helpers": "^3.11.8",
2020
"json-future": "~2.1.2",
2121
"lodash": "~4.17.10",
22-
"parse-domain": "~2.1.2",
2322
"youtube-dl": "~1.12.2"
2423
},
2524
"devDependencies": {
2625
"mocha": "latest",
2726
"nyc": "latest",
2827
"should": "latest",
2928
"snap-shot": "latest",
30-
"standard": "latest",
31-
"time-span": "latest"
29+
"standard": "latest"
3230
},
3331
"engines": {
3432
"node": ">= 8"
@@ -38,7 +36,6 @@
3836
"scripts"
3937
],
4038
"scripts": {
41-
"postinstall": "node scripts/postinstall.js",
4239
"test": "NODE_PATH=.. TZ=UTC NODE_ENV=test nyc mocha test"
4340
},
4441
"license": "MIT",

packages/metascraper-video-provider/scripts/postinstall.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

packages/metascraper-video-provider/test/index.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
const { isUrl } = require('@metascraper/helpers')
44
const { isString } = require('lodash')
5-
const timeSpan = require('time-span')
65
const snapshot = require('snap-shot')
76
const { promisify } = require('util')
87
const { resolve } = require('path')
@@ -80,16 +79,4 @@ describe('metascraper-video-provider', () => {
8079
snapshot(meta)
8180
})
8281
})
83-
84-
describe('non supported', () => {
85-
it('exit early', async () => {
86-
const url = 'https://kikobeats.com'
87-
const html = '<html></html>'
88-
const time = timeSpan()
89-
const metadata = await metascraper({ html, url })
90-
91-
should(metadata.video).be.null()
92-
should(time() < 1000).be.true()
93-
})
94-
})
9582
})

0 commit comments

Comments
 (0)