youtubei 1.3.5 → 1.3.6

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,11 +74,12 @@ class Client {
74
74
  }
75
75
  /** Get video information by video id or URL */
76
76
  getVideo(videoId) {
77
+ var _a;
77
78
  return __awaiter(this, void 0, void 0, function* () {
78
79
  const response = yield this.http.get(`${constants_1.WATCH_END_POINT}`, {
79
80
  params: { v: videoId, pbj: "1" },
80
81
  });
81
- if (!response.data[3].response.contents ||
82
+ if (!((_a = response.data[3]) === null || _a === void 0 ? void 0 : _a.response.contents) ||
82
83
  response.data[2].playerResponse.playabilityStatus.status === "ERROR") {
83
84
  return undefined;
84
85
  }
@@ -134,16 +134,17 @@ var Client = /** @class */ (function () {
134
134
  };
135
135
  /** Get video information by video id or URL */
136
136
  Client.prototype.getVideo = function (videoId) {
137
+ var _a;
137
138
  return __awaiter(this, void 0, void 0, function () {
138
139
  var response;
139
- return __generator(this, function (_a) {
140
- switch (_a.label) {
140
+ return __generator(this, function (_b) {
141
+ switch (_b.label) {
141
142
  case 0: return [4 /*yield*/, this.http.get("" + WATCH_END_POINT, {
142
143
  params: { v: videoId, pbj: "1" },
143
144
  })];
144
145
  case 1:
145
- response = _a.sent();
146
- if (!response.data[3].response.contents ||
146
+ response = _b.sent();
147
+ if (!((_a = response.data[3]) === null || _a === void 0 ? void 0 : _a.response.contents) ||
147
148
  response.data[2].playerResponse.playabilityStatus.status === "ERROR") {
148
149
  return [2 /*return*/, undefined];
149
150
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "youtubei",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
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",