Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1 Migration Guide #54

Closed
SuspiciousLookingOwl opened this issue Jul 15, 2022 · 0 comments
Closed

v1 Migration Guide #54

SuspiciousLookingOwl opened this issue Jul 15, 2022 · 0 comments

Comments

@SuspiciousLookingOwl
Copy link
Owner

SuspiciousLookingOwl commented Jul 15, 2022

v1 is now finally on RC!

The 0-rc version won't be maintained anymore.

New v1 docs: https://suspiciouslookingowl.github.io/youtubei

Migration Guide

List of breaking changes on v1:

  1. youtubei now requires Node version >= 16
  2. ChannelCompact renamed to BaseChannel
  3. Comment#isPinnedComment renamed to Comment#isPinned
  4. Client constructor parameters changes:
    1. cookie renamed to initialCookie
    2. requestOptions changed to fetchOptions (which is a node-fetch request options)
    3. https removed
  5. Remove URL support from Client#getVideo and Client#getPlaylist, you will have to extract video / playlist id from URL string before passing it
  6. SearchResult now is a Continuable (look below)
  7. Continuable implementations. All .next*() methods in all classes will be removed (e.g. Channel#nextVideos, Channel#nextPlaylists, or Video#nextComments), and the property used to store fetched data (e.g Channel.videos, Channel.playlists, or Video.comments) will be replaced with a Continuable. Instead of doing:
await channel.nextVideos();
await channel.nextPlaylists();
await video.nextComments();

console.log(channel.videos, channel.playlists, video.comments);

on v1:

await channel.videos.next();
await channel.playlists.next();
await video.comments.next();

console.log(channel.videos.items, channel.playlists.items, video.comments.items);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant