Closed dnicolson closed 3 months ago
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
0793980
) to head (776bfc9
). Report is 1 commits behind head on master.
Hi @avallete, if this gets merged, further optimizations like this are possible:
const youtube = await Innertube.create({
cookie: document.cookie,
fetch: (...args) => fetch(...args),
})
let playlist = await youtube.getPlaylist(playlistName);
let videoIds = playlist.videos.map(video => video.id);
while (playlist.has_continuation) {
playlist = await playlist.getContinuation();
videoIds = videoIds.concat(playlist.videos.map(video => video.id));
}
console.log(videoIds);
Hi @avallete, if this gets merged, further optimizations like this are possible:
const youtube = await Innertube.create({ cookie: document.cookie, fetch: (...args) => fetch(...args), }) let playlist = await youtube.getPlaylist(playlistName); let videoIds = playlist.videos.map(video => video.id); while (playlist.has_continuation) { playlist = await playlist.getContinuation(); videoIds = videoIds.concat(playlist.videos.map(video => video.id)); } console.log(videoIds);
Nice ! Looks good !
Description
This replaces the YouTube API calls with functionality from https://github.com/LuanRT/YouTube.js.
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
Closing issues
Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).