youtubei 1.3.0 → 1.3.1

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.
@@ -43,8 +43,10 @@ var MusicSearchTypeEnum;
43
43
  */
44
44
  class MusicSearchResult extends MusicContinuable_1.MusicContinuable {
45
45
  /** @hidden */
46
- constructor({ client }) {
46
+ constructor({ client, type }) {
47
47
  super({ client });
48
+ if (type)
49
+ this.type = type;
48
50
  }
49
51
  /**
50
52
  * Initialize data from search
@@ -57,6 +59,7 @@ class MusicSearchResult extends MusicContinuable_1.MusicContinuable {
57
59
  search(query, type) {
58
60
  return __awaiter(this, void 0, void 0, function* () {
59
61
  this.items = [];
62
+ this.type = type;
60
63
  const bufferParams = proto_1.MusicSearchProto.encode(proto_1.optionsToProto(type)).finish();
61
64
  const response = yield this.client.http.post(`${constants_1.I_END_POINT}/search`, {
62
65
  data: {
@@ -19,5 +19,6 @@ __exportStar(require("./MusicBaseChannel"), exports);
19
19
  __exportStar(require("./MusicClient"), exports);
20
20
  __exportStar(require("./MusicLyrics"), exports);
21
21
  __exportStar(require("./MusicPlaylistCompact"), exports);
22
+ __exportStar(require("./MusicSearchResult"), exports);
22
23
  __exportStar(require("./MusicSongCompact"), exports);
23
24
  __exportStar(require("./MusicVideoCompact"), exports);
@@ -102,8 +102,11 @@ var MusicSearchResult = /** @class */ (function (_super) {
102
102
  __extends(MusicSearchResult, _super);
103
103
  /** @hidden */
104
104
  function MusicSearchResult(_a) {
105
- var client = _a.client;
106
- return _super.call(this, { client: client }) || this;
105
+ var client = _a.client, type = _a.type;
106
+ var _this = _super.call(this, { client: client }) || this;
107
+ if (type)
108
+ _this.type = type;
109
+ return _this;
107
110
  }
108
111
  /**
109
112
  * Initialize data from search
@@ -121,6 +124,7 @@ var MusicSearchResult = /** @class */ (function (_super) {
121
124
  switch (_c.label) {
122
125
  case 0:
123
126
  this.items = [];
127
+ this.type = type;
124
128
  bufferParams = MusicSearchProto.encode(optionsToProto(type)).finish();
125
129
  return [4 /*yield*/, this.client.http.post(I_END_POINT + "/search", {
126
130
  data: {
@@ -7,5 +7,6 @@ export * from "./MusicBaseChannel";
7
7
  export * from "./MusicClient";
8
8
  export * from "./MusicLyrics";
9
9
  export * from "./MusicPlaylistCompact";
10
+ export * from "./MusicSearchResult";
10
11
  export * from "./MusicSongCompact";
11
12
  export * from "./MusicVideoCompact";
@@ -7,6 +7,9 @@ export declare enum MusicSearchTypeEnum {
7
7
  }
8
8
  export declare type MusicSearchType = "song" | "video" | MusicSearchTypeEnum;
9
9
  export declare type MusicSearchResultItem<T = "song"> = T extends "song" ? MusicSongCompact : MusicVideoCompact;
10
+ declare type MusicLyricsProperties = MusicContinuableConstructorParams & {
11
+ type?: MusicSearchType;
12
+ };
10
13
  /**
11
14
  * Represents search result, usually returned from `client.search();`.
12
15
  *
@@ -32,7 +35,7 @@ export declare type MusicSearchResultItem<T = "song"> = T extends "song" ? Music
32
35
  export declare class MusicSearchResult<T extends MusicSearchType | undefined = "song"> extends MusicContinuable<MusicSearchResultItem<T>> {
33
36
  private type;
34
37
  /** @hidden */
35
- constructor({ client }: MusicContinuableConstructorParams);
38
+ constructor({ client, type }: MusicLyricsProperties);
36
39
  /**
37
40
  * Initialize data from search
38
41
  *
@@ -44,3 +47,4 @@ export declare class MusicSearchResult<T extends MusicSearchType | undefined = "
44
47
  search(query: string, type: MusicSearchType): Promise<MusicSearchResult<T>>;
45
48
  protected fetch(): Promise<FetchResult<MusicSearchResultItem<T>>>;
46
49
  }
50
+ export {};
@@ -7,5 +7,6 @@ export * from "./MusicBaseChannel";
7
7
  export * from "./MusicClient";
8
8
  export * from "./MusicLyrics";
9
9
  export * from "./MusicPlaylistCompact";
10
+ export * from "./MusicSearchResult";
10
11
  export * from "./MusicSongCompact";
11
12
  export * from "./MusicVideoCompact";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "youtubei",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
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",