youtubei 1.0.0-rc.2 → 1.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  `Youtubei` is made to replace my other library [scrape-yt](https://github.com/SuspiciousLookingOwl/scrape-yt/). Instead of scrapping data from Youtube page, `youtubei` fetches data by sending a request directly to `https://www.youtube.com/youtubei/v1`, which should be faster and provide more reliable result.
4
4
 
5
- <b>Requires Node >= 12</b>
5
+ <b>Requires Node >= 16</b>
6
6
 
7
7
  #### [Documentation](https://suspiciouslookingowl.github.io/youtubei)
8
8
 
@@ -15,10 +15,10 @@ class BaseChannelParser {
15
15
  }
16
16
  /** Parse tab data from request, tab name is ignored if it's a continuation data */
17
17
  static parseTabData(name, data) {
18
- var _a;
18
+ var _a, _b, _c;
19
19
  const index = name === "videos" ? 1 : 2;
20
- return (((_a = data.contents) === null || _a === void 0 ? void 0 : _a.twoColumnBrowseResultsRenderer.tabs[index].tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].gridRenderer.items) ||
21
- data.onResponseReceivedActions[0].appendContinuationItemsAction.continuationItems);
20
+ return (((_b = (_a = data.contents) === null || _a === void 0 ? void 0 : _a.twoColumnBrowseResultsRenderer.tabs[index].tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].gridRenderer) === null || _b === void 0 ? void 0 : _b.items) || ((_c = data.onResponseReceivedActions) === null || _c === void 0 ? void 0 : _c[0].appendContinuationItemsAction.continuationItems) ||
21
+ []);
22
22
  }
23
23
  }
24
24
  exports.BaseChannelParser = BaseChannelParser;
@@ -49,7 +49,7 @@ class ChannelPlaylists extends Continuable_1.Continuable {
49
49
  const data = common_1.mapFilter(items, "gridPlaylistRenderer");
50
50
  return {
51
51
  continuation,
52
- items: data.map((i) => new PlaylistCompact_1.PlaylistCompact({ client: this.client }).load(i)),
52
+ items: data.map((i) => new PlaylistCompact_1.PlaylistCompact({ client: this.client, channel: this.channel }).load(i)),
53
53
  };
54
54
  });
55
55
  }
@@ -49,7 +49,7 @@ class ChannelVideos extends Continuable_1.Continuable {
49
49
  const data = common_1.mapFilter(items, "gridVideoRenderer");
50
50
  return {
51
51
  continuation,
52
- items: data.map((i) => new VideoCompact_1.VideoCompact({ client: this.client }).load(i)),
52
+ items: data.map((i) => new VideoCompact_1.VideoCompact({ client: this.client, channel: this.channel }).load(i)),
53
53
  };
54
54
  });
55
55
  }
@@ -14,10 +14,10 @@ var BaseChannelParser = /** @class */ (function () {
14
14
  };
15
15
  /** Parse tab data from request, tab name is ignored if it's a continuation data */
16
16
  BaseChannelParser.parseTabData = function (name, data) {
17
- var _a;
17
+ var _a, _b, _c;
18
18
  var index = name === "videos" ? 1 : 2;
19
- return (((_a = data.contents) === null || _a === void 0 ? void 0 : _a.twoColumnBrowseResultsRenderer.tabs[index].tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].gridRenderer.items) ||
20
- data.onResponseReceivedActions[0].appendContinuationItemsAction.continuationItems);
19
+ return (((_b = (_a = data.contents) === null || _a === void 0 ? void 0 : _a.twoColumnBrowseResultsRenderer.tabs[index].tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].gridRenderer) === null || _b === void 0 ? void 0 : _b.items) || ((_c = data.onResponseReceivedActions) === null || _c === void 0 ? void 0 : _c[0].appendContinuationItemsAction.continuationItems) ||
20
+ []);
21
21
  };
22
22
  return BaseChannelParser;
23
23
  }());
@@ -97,7 +97,7 @@ var ChannelPlaylists = /** @class */ (function (_super) {
97
97
  return [2 /*return*/, {
98
98
  continuation: continuation,
99
99
  items: data.map(function (i) {
100
- return new PlaylistCompact({ client: _this.client }).load(i);
100
+ return new PlaylistCompact({ client: _this.client, channel: _this.channel }).load(i);
101
101
  }),
102
102
  }];
103
103
  }
@@ -97,7 +97,7 @@ var ChannelVideos = /** @class */ (function (_super) {
97
97
  return [2 /*return*/, {
98
98
  continuation: continuation,
99
99
  items: data.map(function (i) {
100
- return new VideoCompact({ client: _this.client }).load(i);
100
+ return new VideoCompact({ client: _this.client, channel: _this.channel }).load(i);
101
101
  }),
102
102
  }];
103
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "youtubei",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0-rc.3",
4
4
  "description": "Simple package to get information from youtube such as videos, playlists, channels, video information & comments, related videos, up next video, and more!",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",