youtubei 1.5.1 → 1.5.2
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.
|
@@ -186,13 +186,7 @@ class MusicAllSearchResultParser {
|
|
|
186
186
|
return album;
|
|
187
187
|
}
|
|
188
188
|
static parseArtists(items, client) {
|
|
189
|
-
return items
|
|
190
|
-
.filter((r) => {
|
|
191
|
-
var _a;
|
|
192
|
-
const pageType = (_a = r.navigationEndpoint) === null || _a === void 0 ? void 0 : _a.browseEndpoint.browseEndpointContextSupportedConfigs.browseEndpointContextMusicConfig.pageType;
|
|
193
|
-
return pageType === "MUSIC_PAGE_TYPE_ARTIST";
|
|
194
|
-
})
|
|
195
|
-
.map((r) => {
|
|
189
|
+
return this.parseArtistsOrChannel(items).map((r) => {
|
|
196
190
|
var _a;
|
|
197
191
|
return new MusicBaseArtist_1.MusicBaseArtist({
|
|
198
192
|
client,
|
|
@@ -203,11 +197,7 @@ class MusicAllSearchResultParser {
|
|
|
203
197
|
}
|
|
204
198
|
static parseChannel(items, client) {
|
|
205
199
|
var _a;
|
|
206
|
-
const channelRaw =
|
|
207
|
-
var _a;
|
|
208
|
-
const pageType = (_a = r.navigationEndpoint) === null || _a === void 0 ? void 0 : _a.browseEndpoint.browseEndpointContextSupportedConfigs.browseEndpointContextMusicConfig.pageType;
|
|
209
|
-
return pageType === "MUSIC_PAGE_TYPE_USER_CHANNEL";
|
|
210
|
-
});
|
|
200
|
+
const [channelRaw] = this.parseArtistsOrChannel(items);
|
|
211
201
|
if (!channelRaw)
|
|
212
202
|
return;
|
|
213
203
|
const channel = new MusicBaseChannel_1.MusicBaseChannel({
|
|
@@ -217,5 +207,12 @@ class MusicAllSearchResultParser {
|
|
|
217
207
|
});
|
|
218
208
|
return channel;
|
|
219
209
|
}
|
|
210
|
+
static parseArtistsOrChannel(items) {
|
|
211
|
+
return items.filter((i) => {
|
|
212
|
+
var _a;
|
|
213
|
+
const pageType = (_a = i.navigationEndpoint) === null || _a === void 0 ? void 0 : _a.browseEndpoint.browseEndpointContextSupportedConfigs.browseEndpointContextMusicConfig.pageType;
|
|
214
|
+
return (pageType === "MUSIC_PAGE_TYPE_ARTIST" || pageType == "MUSIC_PAGE_TYPE_USER_CHANNEL");
|
|
215
|
+
});
|
|
216
|
+
}
|
|
220
217
|
}
|
|
221
218
|
exports.MusicAllSearchResultParser = MusicAllSearchResultParser;
|
|
@@ -201,13 +201,7 @@ var MusicAllSearchResultParser = /** @class */ (function () {
|
|
|
201
201
|
return album;
|
|
202
202
|
};
|
|
203
203
|
MusicAllSearchResultParser.parseArtists = function (items, client) {
|
|
204
|
-
return items
|
|
205
|
-
.filter(function (r) {
|
|
206
|
-
var _a;
|
|
207
|
-
var pageType = (_a = r.navigationEndpoint) === null || _a === void 0 ? void 0 : _a.browseEndpoint.browseEndpointContextSupportedConfigs.browseEndpointContextMusicConfig.pageType;
|
|
208
|
-
return pageType === "MUSIC_PAGE_TYPE_ARTIST";
|
|
209
|
-
})
|
|
210
|
-
.map(function (r) {
|
|
204
|
+
return this.parseArtistsOrChannel(items).map(function (r) {
|
|
211
205
|
var _a;
|
|
212
206
|
return new MusicBaseArtist({
|
|
213
207
|
client: client,
|
|
@@ -218,11 +212,7 @@ var MusicAllSearchResultParser = /** @class */ (function () {
|
|
|
218
212
|
};
|
|
219
213
|
MusicAllSearchResultParser.parseChannel = function (items, client) {
|
|
220
214
|
var _a;
|
|
221
|
-
var
|
|
222
|
-
var _a;
|
|
223
|
-
var pageType = (_a = r.navigationEndpoint) === null || _a === void 0 ? void 0 : _a.browseEndpoint.browseEndpointContextSupportedConfigs.browseEndpointContextMusicConfig.pageType;
|
|
224
|
-
return pageType === "MUSIC_PAGE_TYPE_USER_CHANNEL";
|
|
225
|
-
});
|
|
215
|
+
var _b = __read(this.parseArtistsOrChannel(items), 1), channelRaw = _b[0];
|
|
226
216
|
if (!channelRaw)
|
|
227
217
|
return;
|
|
228
218
|
var channel = new MusicBaseChannel({
|
|
@@ -232,6 +222,13 @@ var MusicAllSearchResultParser = /** @class */ (function () {
|
|
|
232
222
|
});
|
|
233
223
|
return channel;
|
|
234
224
|
};
|
|
225
|
+
MusicAllSearchResultParser.parseArtistsOrChannel = function (items) {
|
|
226
|
+
return items.filter(function (i) {
|
|
227
|
+
var _a;
|
|
228
|
+
var pageType = (_a = i.navigationEndpoint) === null || _a === void 0 ? void 0 : _a.browseEndpoint.browseEndpointContextSupportedConfigs.browseEndpointContextMusicConfig.pageType;
|
|
229
|
+
return (pageType === "MUSIC_PAGE_TYPE_ARTIST" || pageType == "MUSIC_PAGE_TYPE_USER_CHANNEL");
|
|
230
|
+
});
|
|
231
|
+
};
|
|
235
232
|
return MusicAllSearchResultParser;
|
|
236
233
|
}());
|
|
237
234
|
export { MusicAllSearchResultParser };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "youtubei",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
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",
|