youtubei 1.0.0-rc.8 → 1.0.0

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.
@@ -74,7 +74,8 @@ class BaseVideoParser {
74
74
  }
75
75
  static parseButtonRenderer(data) {
76
76
  var _a;
77
- const buttonRenderer = data.toggleButtonRenderer || data.buttonRenderer;
77
+ const likeButton = data.segmentedLikeDislikeButtonRenderer.likeButton;
78
+ const buttonRenderer = likeButton.toggleButtonRenderer || likeButton.buttonRenderer;
78
79
  const accessibilityData = (((_a = buttonRenderer.defaultText) === null || _a === void 0 ? void 0 : _a.accessibility) || buttonRenderer.accessibilityData).accessibilityData;
79
80
  return accessibilityData.label;
80
81
  }
@@ -7,14 +7,14 @@ const Comment_1 = require("../Comment");
7
7
  const Thumbnails_1 = require("../Thumbnails");
8
8
  class VideoParser {
9
9
  static loadVideo(target, data) {
10
- var _a, _b;
10
+ var _a, _b, _c;
11
11
  const videoInfo = BaseVideo_1.BaseVideoParser.parseRawData(data);
12
12
  target.duration = +videoInfo.videoDetails.lengthSeconds;
13
13
  const itemSectionRenderer = (_a = data[3].response.contents.twoColumnWatchNextResults.results.results.contents
14
14
  .reverse()
15
15
  .find((c) => c.itemSectionRenderer)) === null || _a === void 0 ? void 0 : _a.itemSectionRenderer;
16
16
  target.comments.continuation = common_1.getContinuationFromItems((itemSectionRenderer === null || itemSectionRenderer === void 0 ? void 0 : itemSectionRenderer.contents) || []);
17
- const chapters = (_b = data[3].response.playerOverlays.playerOverlayRenderer.decoratedPlayerBarRenderer) === null || _b === void 0 ? void 0 : _b.decoratedPlayerBarRenderer.playerBar.multiMarkersPlayerBarRenderer.markersMap[0].value.chapters;
17
+ const chapters = (_c = (_b = data[3].response.playerOverlays.playerOverlayRenderer.decoratedPlayerBarRenderer) === null || _b === void 0 ? void 0 : _b.decoratedPlayerBarRenderer.playerBar.multiMarkersPlayerBarRenderer.markersMap) === null || _c === void 0 ? void 0 : _c[0].value.chapters;
18
18
  target.chapters =
19
19
  (chapters === null || chapters === void 0 ? void 0 : chapters.map(({ chapterRenderer: c }) => ({
20
20
  title: c.title.simpleText,
@@ -84,7 +84,8 @@ var BaseVideoParser = /** @class */ (function () {
84
84
  };
85
85
  BaseVideoParser.parseButtonRenderer = function (data) {
86
86
  var _a;
87
- var buttonRenderer = data.toggleButtonRenderer || data.buttonRenderer;
87
+ var likeButton = data.segmentedLikeDislikeButtonRenderer.likeButton;
88
+ var buttonRenderer = likeButton.toggleButtonRenderer || likeButton.buttonRenderer;
88
89
  var accessibilityData = (((_a = buttonRenderer.defaultText) === null || _a === void 0 ? void 0 : _a.accessibility) || buttonRenderer.accessibilityData).accessibilityData;
89
90
  return accessibilityData.label;
90
91
  };
@@ -6,14 +6,14 @@ var VideoParser = /** @class */ (function () {
6
6
  function VideoParser() {
7
7
  }
8
8
  VideoParser.loadVideo = function (target, data) {
9
- var _a, _b;
9
+ var _a, _b, _c;
10
10
  var videoInfo = BaseVideoParser.parseRawData(data);
11
11
  target.duration = +videoInfo.videoDetails.lengthSeconds;
12
12
  var itemSectionRenderer = (_a = data[3].response.contents.twoColumnWatchNextResults.results.results.contents
13
13
  .reverse()
14
14
  .find(function (c) { return c.itemSectionRenderer; })) === null || _a === void 0 ? void 0 : _a.itemSectionRenderer;
15
15
  target.comments.continuation = getContinuationFromItems((itemSectionRenderer === null || itemSectionRenderer === void 0 ? void 0 : itemSectionRenderer.contents) || []);
16
- var chapters = (_b = data[3].response.playerOverlays.playerOverlayRenderer.decoratedPlayerBarRenderer) === null || _b === void 0 ? void 0 : _b.decoratedPlayerBarRenderer.playerBar.multiMarkersPlayerBarRenderer.markersMap[0].value.chapters;
16
+ var chapters = (_c = (_b = data[3].response.playerOverlays.playerOverlayRenderer.decoratedPlayerBarRenderer) === null || _b === void 0 ? void 0 : _b.decoratedPlayerBarRenderer.playerBar.multiMarkersPlayerBarRenderer.markersMap) === null || _c === void 0 ? void 0 : _c[0].value.chapters;
17
17
  target.chapters =
18
18
  (chapters === null || chapters === void 0 ? void 0 : chapters.map(function (_a) {
19
19
  var c = _a.chapterRenderer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "youtubei",
3
- "version": "1.0.0-rc.8",
3
+ "version": "1.0.0",
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",