mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-18 20:12:12 +00:00
fix (tests): video used for tests is no longer available
This commit is contained in:
@@ -6,8 +6,7 @@ module.exports = {
|
||||
original_ntoken: 'PqjqqJjdB9K821VIisj',
|
||||
expected_ntoken: 'AxwyS-osUl1WhMUd1',
|
||||
client_version: '2.20211101.01.00',
|
||||
test_video_id: 'FT_nzxtgXEw',
|
||||
test_video_id_1: 'YE7VzlLtp-4',
|
||||
test_video_id: 'dQw4w9WgXcQ',
|
||||
sig_decipher_sc: `fB={RP:function(a,b){a.splice(0,b)},
|
||||
Td:function(a){a.reverse()},
|
||||
kq:function(a,b){var c=a[0];a[0]=a[b%a.length];a[b%a.length]=c};fB.kq(a,35);fB.RP(a,2);fB.kq(a,46);fB.Td(a,6);`,
|
||||
|
||||
@@ -22,10 +22,11 @@ async function performTests() {
|
||||
const comments = await youtube.getComments(Constants.test_video_id).catch((error) => error);
|
||||
assert(comments instanceof Error ? false : true, `should retrieve comments for ${Constants.test_video_id}`, comments);
|
||||
|
||||
const video = await downloadVideo(Constants.test_video_id_1, youtube).catch((error) => error);
|
||||
assert(video instanceof Error ? false : true, `should download video (${Constants.test_video_id_1})`, video);
|
||||
const video = await downloadVideo(Constants.test_video_id, youtube).catch((error) => error);
|
||||
assert(video instanceof Error ? false : true, `should download video (${Constants.test_video_id})`, video);
|
||||
}
|
||||
|
||||
|
||||
const n_token = new NToken(Constants.n_scramble_sc).transform(Constants.original_ntoken);
|
||||
assert(n_token == Constants.expected_ntoken, `should transform n token into ${Constants.expected_ntoken}`, n_token);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user