From 4c3a8bdccc630051d79d3d2ccccc6888672b7f6c Mon Sep 17 00:00:00 2001 From: vaaski Date: Thu, 27 May 2021 18:17:36 +0200 Subject: [PATCH] fix: add html5 param to fetching of VideoInfoPage (#924) * fix: fix age restricted video test * fix:: add html5=1 param for fetching VideoInfoPage --- lib/info.js | 1 + test/irl-test.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/info.js b/lib/info.js index e4e13d29..0d07fccf 100644 --- a/lib/info.js +++ b/lib/info.js @@ -330,6 +330,7 @@ const getVideoInfoPage = async(id, options) => { url.searchParams.set('ps', 'default'); url.searchParams.set('gl', 'US'); url.searchParams.set('hl', options.lang || 'en'); + url.searchParams.set('html5', '1'); const body = await utils.exposedMiniget(url.toString(), options).text(); let info = querystring.parse(body); info.player_response = findPlayerResponse('get_video_info', info); diff --git a/test/irl-test.js b/test/irl-test.js index 8fbbce04..6209a4c6 100644 --- a/test/irl-test.js +++ b/test/irl-test.js @@ -5,7 +5,7 @@ const ytdl = require('..'); const videos = { 'Regular video': 'mgOS64BF2eU', - 'Age restricted': 'LuZu9N53Vd0', + 'Age restricted': 'Zc09khxyXfA', 'Embed domain restricted': 'B3eAMGXFw1o', 'No embed allowed': 'GFg8BP01F5Q', Offensive: 'hCKDsjLt_qU',