Skip to content

Commit a256f0c

Browse files
authored
Update dependencies (#132)
1 parent cf8cd92 commit a256f0c

File tree

8 files changed

+24
-11
lines changed

8 files changed

+24
-11
lines changed

packages/metascraper-clearbit-logo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"metascraper"
2222
],
2323
"dependencies": {
24-
"got": "~9.2.0"
24+
"got": "~9.3.2"
2525
},
2626
"devDependencies": {
2727
"mocha": "latest",

packages/metascraper-helpers/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const isIso = require('isostring')
2929
const toTitle = require('title')
3030

3131
const { URL } = require('url')
32+
const urlLib = require('url')
3233

3334
const MIMES_EXTENSIONS = {
3435
audio: audioExtensions,
@@ -105,7 +106,12 @@ const isAudioExtension = createExtensionValidator(audioExtensions)
105106

106107
const isImageExtension = createExtensionValidator(imageExtensions)
107108

108-
const extension = url => fileExtension(url).split('?')[0]
109+
const extension = (str = '') => {
110+
const urlObj = urlLib.parse(str)
111+
urlObj.hash = ''
112+
urlObj.search = ''
113+
return fileExtension(urlLib.format(urlObj))
114+
}
109115

110116
const description = value => isString(value) && getDescription(value)
111117

packages/metascraper-helpers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"isostring": "0.0.1",
2323
"lodash": "~4.17.11",
2424
"mime-types": "~2.1.21",
25-
"normalize-url": "~3.3.0",
25+
"normalize-url": "~4.0.0",
2626
"smartquotes": "~2.3.1",
2727
"title": "~3.4.0",
2828
"url-regex": "~4.1.1",

packages/metascraper-helpers/test/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
const should = require('should')
44

5-
const { absoluteUrl } = require('../')
5+
const { extension, absoluteUrl } = require('../')
66

77
describe('metascraper-helpers', () => {
8-
it('absoluteUrl', () => {
8+
it('.absoluteUrl', () => {
99
should(absoluteUrl('https://kikobeats.com/', 'blog')).be.equal(
1010
'https://kikobeats.com/blog'
1111
)
@@ -19,4 +19,11 @@ describe('metascraper-helpers', () => {
1919
'http://kikobeats.com/blog'
2020
)
2121
})
22+
23+
it('.extension', () => {
24+
should(extension('.mp4')).be.equal('mp4')
25+
should(extension('.mp4#t=0')).be.equal('mp4')
26+
should(extension('.mp4?foo=bar')).be.equal('mp4')
27+
should(extension('.mp4?foo=bar#t=0')).be.equal('mp4')
28+
})
2229
})

packages/metascraper-logo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"dependencies": {
1515
"@metascraper/helpers": "^4.5.5",
16+
"got": "~9.3.2",
1617
"lodash": "~4.17.10"
1718
},
1819
"devDependencies": {

packages/metascraper-media-provider/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
},
1414
"dependencies": {
1515
"@metascraper/helpers": "^4.5.5",
16-
"got": "~9.2.0",
16+
"got": "~9.3.2",
1717
"lodash": "~4.17.10",
18-
"memoize-one": "~4.0.2",
18+
"memoize-one": "~4.0.3",
1919
"memoize-token": "~1.1.0",
2020
"tunnel": "0.0.6",
2121
"youtube-dl": "~1.12.2"
2222
},
2323
"devDependencies": {
24-
"browserless": "~4.1.3",
24+
"browserless": "~4.2.1",
2525
"mocha": "latest",
2626
"nyc": "latest",
2727
"puppeteer": "latest",

packages/metascraper-video/__snapshots__/index.js.snap-shot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exports['single src 1'] = {
1515

1616
exports['clips.twitch.tv 1'] = {
1717
"image": "https://clips-media-assets.twitch.tv/27434665136-offset-2366-preview.jpg",
18-
"video": "https://clips-media-assets.twitch.tv/AT-27434665136-offset-2366-1280x720.mp4"
18+
"video": "https://clips-media-assets.twitch.tv/AT-27434665136-offset-2366-1280x720.mp4#t=0"
1919
}
2020

2121
exports['play.tv 1'] = {

packages/metascraper-video/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@ const wrapVideo = createWrapper((domNodes, url) => {
2929
.orderBy(videoUrl => extension(videoUrl) === 'mp4', ['desc'])
3030
.first()
3131
.value()
32-
3332
const urlValue = urlFn(videoUrl, { url })
3433
return isVideoUrl(urlValue) && urlValue
3534
})
3635

3736
const withContentType = (url, contentType) =>
38-
(isMime(contentType, 'video') ? url : false)
37+
isMime(contentType, 'video') ? url : false
3938

4039
/**
4140
* Rules.

0 commit comments

Comments
 (0)