Skip to content

Commit f1595f1

Browse files
committed
Ensure to return a http protocol url
1 parent ded6cc4 commit f1595f1

File tree

1 file changed

+5
-1
lines changed
  • packages/metascraper-video-provider

1 file changed

+5
-1
lines changed

packages/metascraper-video-provider/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ const getVideoInfo = promisify(youtubedl.getInfo)
1212
*/
1313
const getVideoUrl = ({formats}) => {
1414
const urls = formats
15-
.filter(item => item.ext === 'mp4' || path.extname(item.url).startsWith('.mp4'))
15+
.filter(item =>
16+
item.protocol === 'https' &&
17+
(item.ext === 'mp4' ||
18+
path.extname(item.url).startsWith('.mp4'))
19+
)
1620
.map(item => item.url)
1721

1822
const index = Math.round(urls.length / 2) - 1

0 commit comments

Comments
 (0)