youtubei 0.0.1-rc.33 → 0.0.1-rc.36

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.
@@ -55,7 +55,7 @@ class BaseVideo extends _1.Base {
55
55
  ((_c = videoInfo.description) === null || _c === void 0 ? void 0 : _c.runs.map((d) => d.text).join("")) || "";
56
56
  // Up Next and related videos
57
57
  this.related = [];
58
- const secondaryContents = data.response.contents.twoColumnWatchNextResults.secondaryResults.secondaryResults
58
+ const secondaryContents = data[3].response.contents.twoColumnWatchNextResults.secondaryResults.secondaryResults
59
59
  .results;
60
60
  if (secondaryContents) {
61
61
  this.related.push(...BaseVideo.parseRelated(secondaryContents, this.client));
@@ -97,11 +97,11 @@ class BaseVideo extends _1.Base {
97
97
  }
98
98
  /** @hidden */
99
99
  static parseRawData(data) {
100
- const contents = data.response.contents.twoColumnWatchNextResults.results.results.contents;
100
+ const contents = data[3].response.contents.twoColumnWatchNextResults.results.results.contents;
101
101
  const primaryInfo = contents.find((c) => "videoPrimaryInfoRenderer" in c)
102
102
  .videoPrimaryInfoRenderer;
103
103
  const secondaryInfo = contents.find((c) => "videoSecondaryInfoRenderer" in c).videoSecondaryInfoRenderer;
104
- const videoDetails = data.playerResponse.videoDetails;
104
+ const videoDetails = data[2].playerResponse.videoDetails;
105
105
  return Object.assign(Object.assign(Object.assign({}, secondaryInfo), primaryInfo), { videoDetails });
106
106
  }
107
107
  static parseRelated(secondaryContents, client) {
@@ -73,9 +73,9 @@ class Client {
73
73
  const response = yield this.http.get(`${constants_1.WATCH_END_POINT}`, {
74
74
  params: { v: videoId, pbj: "1" },
75
75
  });
76
- if (!response.data.response.contents)
76
+ if (!response.data[3].response.contents)
77
77
  return undefined;
78
- return (!response.data.playerResponse.playabilityStatus.liveStreamability
78
+ return (!response.data[2].playerResponse.playabilityStatus.liveStreamability
79
79
  ? new _1.Video({ client: this }).load(response.data)
80
80
  : new _1.LiveVideo({ client: this }).load(response.data));
81
81
  });
@@ -37,7 +37,7 @@ class LiveVideo extends _1.BaseVideo {
37
37
  .map((r) => r.text)
38
38
  .join(" ")
39
39
  .replace(/[^0-9]/g, "");
40
- this.chatContinuation = (_a = data.response.contents.twoColumnWatchNextResults.conversationBar.liveChatRenderer) === null || _a === void 0 ? void 0 : _a.continuations[0].reloadContinuationData.continuation;
40
+ this.chatContinuation = (_a = data[3].response.contents.twoColumnWatchNextResults.conversationBar.liveChatRenderer) === null || _a === void 0 ? void 0 : _a.continuations[0].reloadContinuationData.continuation;
41
41
  return this;
42
42
  }
43
43
  /**
@@ -36,7 +36,9 @@ class Video extends _1.BaseVideo {
36
36
  // Duration
37
37
  const videoInfo = _1.BaseVideo.parseRawData(data);
38
38
  this.duration = +videoInfo.videoDetails.lengthSeconds;
39
- const itemSectionRenderer = data.response.contents.twoColumnWatchNextResults.results.results.contents.find((c) => c.itemSectionRenderer).itemSectionRenderer;
39
+ const itemSectionRenderer = data[3].response.contents.twoColumnWatchNextResults.results.results.contents
40
+ .reverse()
41
+ .find((c) => c.itemSectionRenderer).itemSectionRenderer;
40
42
  this.commentContinuation = common_1.getContinuationFromItems(itemSectionRenderer.contents);
41
43
  return this;
42
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "youtubei",
3
- "version": "0.0.1-rc.33",
3
+ "version": "0.0.1-rc.36",
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/index.js",
6
6
  "types": "dist/index.d.ts",
package/CHANGELOG.md DELETED
@@ -1,6 +0,0 @@
1
- # Changelog
2
- All notable changes to this project will be documented in this file.
3
-
4
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
-
package/website/README.md DELETED
@@ -1,33 +0,0 @@
1
- # Website
2
-
3
- This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.
4
-
5
- ## Installation
6
-
7
- ```console
8
- yarn install
9
- ```
10
-
11
- ## Local Development
12
-
13
- ```console
14
- yarn start
15
- ```
16
-
17
- This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
18
-
19
- ## Build
20
-
21
- ```console
22
- yarn build
23
- ```
24
-
25
- This command generates static content into the `build` directory and can be served using any static contents hosting service.
26
-
27
- ## Deployment
28
-
29
- ```console
30
- GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
31
- ```
32
-
33
- If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.