youtubei 1.4.4 → 1.4.5
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.
|
@@ -73,7 +73,7 @@ class Client {
|
|
|
73
73
|
}
|
|
74
74
|
/** Get video information by video id or URL */
|
|
75
75
|
getVideo(videoId) {
|
|
76
|
-
var _a;
|
|
76
|
+
var _a, _b;
|
|
77
77
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
78
|
const response = yield this.http.get(`${constants_1.WATCH_END_POINT}`, {
|
|
79
79
|
params: { v: videoId, pbj: "1" },
|
|
@@ -81,7 +81,8 @@ class Client {
|
|
|
81
81
|
const data = Array.isArray(response.data)
|
|
82
82
|
? response.data.reduce((prev, curr) => (Object.assign(Object.assign({}, prev), curr)), {})
|
|
83
83
|
: response.data;
|
|
84
|
-
if (!((_a = data.response) === null || _a === void 0 ? void 0 : _a.contents) ||
|
|
84
|
+
if (!((_b = (_a = data.response) === null || _a === void 0 ? void 0 : _a.contents) === null || _b === void 0 ? void 0 : _b.twoColumnWatchNextResults.results.results.contents) ||
|
|
85
|
+
data.playerResponse.playabilityStatus.status === "ERROR") {
|
|
85
86
|
return undefined;
|
|
86
87
|
}
|
|
87
88
|
return (!data.playerResponse.playabilityStatus.liveStreamability
|
|
@@ -133,20 +133,21 @@ var Client = /** @class */ (function () {
|
|
|
133
133
|
};
|
|
134
134
|
/** Get video information by video id or URL */
|
|
135
135
|
Client.prototype.getVideo = function (videoId) {
|
|
136
|
-
var _a;
|
|
136
|
+
var _a, _b;
|
|
137
137
|
return __awaiter(this, void 0, void 0, function () {
|
|
138
138
|
var response, data;
|
|
139
|
-
return __generator(this, function (
|
|
140
|
-
switch (
|
|
139
|
+
return __generator(this, function (_c) {
|
|
140
|
+
switch (_c.label) {
|
|
141
141
|
case 0: return [4 /*yield*/, this.http.get("" + WATCH_END_POINT, {
|
|
142
142
|
params: { v: videoId, pbj: "1" },
|
|
143
143
|
})];
|
|
144
144
|
case 1:
|
|
145
|
-
response =
|
|
145
|
+
response = _c.sent();
|
|
146
146
|
data = Array.isArray(response.data)
|
|
147
147
|
? response.data.reduce(function (prev, curr) { return (__assign(__assign({}, prev), curr)); }, {})
|
|
148
148
|
: response.data;
|
|
149
|
-
if (!((_a = data.response) === null || _a === void 0 ? void 0 : _a.contents) ||
|
|
149
|
+
if (!((_b = (_a = data.response) === null || _a === void 0 ? void 0 : _a.contents) === null || _b === void 0 ? void 0 : _b.twoColumnWatchNextResults.results.results.contents) ||
|
|
150
|
+
data.playerResponse.playabilityStatus.status === "ERROR") {
|
|
150
151
|
return [2 /*return*/, undefined];
|
|
151
152
|
}
|
|
152
153
|
return [2 /*return*/, (!data.playerResponse.playabilityStatus.liveStreamability
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "youtubei",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
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",
|