youtubei 0.0.1-rc.34 → 0.0.1-rc.35

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.
@@ -55,7 +55,7 @@ class BaseVideo extends _1.Base {
55
55
  ((_c = videoInfo.description) === null || _c === void 0 ? void 0 : _c.runs.map((d) => d.text).join("")) || "";
56
56
  // Up Next and related videos
57
57
  this.related = [];
58
- const secondaryContents = data.response.contents.twoColumnWatchNextResults.secondaryResults.secondaryResults
58
+ const secondaryContents = data[3].response.contents.twoColumnWatchNextResults.secondaryResults.secondaryResults
59
59
  .results;
60
60
  if (secondaryContents) {
61
61
  this.related.push(...BaseVideo.parseRelated(secondaryContents, this.client));
@@ -97,11 +97,11 @@ class BaseVideo extends _1.Base {
97
97
  }
98
98
  /** @hidden */
99
99
  static parseRawData(data) {
100
- const contents = data.response.contents.twoColumnWatchNextResults.results.results.contents;
100
+ const contents = data[3].response.contents.twoColumnWatchNextResults.results.results.contents;
101
101
  const primaryInfo = contents.find((c) => "videoPrimaryInfoRenderer" in c)
102
102
  .videoPrimaryInfoRenderer;
103
103
  const secondaryInfo = contents.find((c) => "videoSecondaryInfoRenderer" in c).videoSecondaryInfoRenderer;
104
- const videoDetails = data.playerResponse.videoDetails;
104
+ const videoDetails = data[2].playerResponse.videoDetails;
105
105
  return Object.assign(Object.assign(Object.assign({}, secondaryInfo), primaryInfo), { videoDetails });
106
106
  }
107
107
  static parseRelated(secondaryContents, client) {
@@ -73,9 +73,9 @@ class Client {
73
73
  const response = yield this.http.get(`${constants_1.WATCH_END_POINT}`, {
74
74
  params: { v: videoId, pbj: "1" },
75
75
  });
76
- if (!response.data.response.contents)
76
+ if (!response.data[3].response.contents)
77
77
  return undefined;
78
- return (!response.data.playerResponse.playabilityStatus.liveStreamability
78
+ return (!response.data[2].playerResponse.playabilityStatus.liveStreamability
79
79
  ? new _1.Video({ client: this }).load(response.data)
80
80
  : new _1.LiveVideo({ client: this }).load(response.data));
81
81
  });
@@ -37,7 +37,7 @@ class LiveVideo extends _1.BaseVideo {
37
37
  .map((r) => r.text)
38
38
  .join(" ")
39
39
  .replace(/[^0-9]/g, "");
40
- this.chatContinuation = (_a = data.response.contents.twoColumnWatchNextResults.conversationBar.liveChatRenderer) === null || _a === void 0 ? void 0 : _a.continuations[0].reloadContinuationData.continuation;
40
+ this.chatContinuation = (_a = data[3].response.contents.twoColumnWatchNextResults.conversationBar.liveChatRenderer) === null || _a === void 0 ? void 0 : _a.continuations[0].reloadContinuationData.continuation;
41
41
  return this;
42
42
  }
43
43
  /**
@@ -36,7 +36,7 @@ class Video extends _1.BaseVideo {
36
36
  // Duration
37
37
  const videoInfo = _1.BaseVideo.parseRawData(data);
38
38
  this.duration = +videoInfo.videoDetails.lengthSeconds;
39
- const itemSectionRenderer = data.response.contents.twoColumnWatchNextResults.results.results.contents.find((c) => c.itemSectionRenderer).itemSectionRenderer;
39
+ const itemSectionRenderer = data[3].response.contents.twoColumnWatchNextResults.results.results.contents.find((c) => c.itemSectionRenderer).itemSectionRenderer;
40
40
  this.commentContinuation = common_1.getContinuationFromItems(itemSectionRenderer.contents);
41
41
  return this;
42
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "youtubei",
3
- "version": "0.0.1-rc.34",
3
+ "version": "0.0.1-rc.35",
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/index.js",
6
6
  "types": "dist/index.d.ts",