mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-25 22:38:59 +01:00
make loading faster
This commit is contained in:
parent
cb5c0244cf
commit
9cb9099807
1 changed files with 9 additions and 6 deletions
|
@ -66,7 +66,7 @@ class InnerTubePokeVidious {
|
||||||
* @param {string} v - Video ID.
|
* @param {string} v - Video ID.
|
||||||
* @returns {Promise<object>} Promise resolving to the video information.
|
* @returns {Promise<object>} Promise resolving to the video information.
|
||||||
*/
|
*/
|
||||||
async getYouTubeApiVideo(v, contentlang, contentregion) {
|
async getYouTubeApiVideo(f, v, contentlang, contentregion) {
|
||||||
|
|
||||||
const { fetch } = await import("undici");
|
const { fetch } = await import("undici");
|
||||||
|
|
||||||
|
@ -99,10 +99,13 @@ class InnerTubePokeVidious {
|
||||||
const vid = await this.getJson(videoInfo);
|
const vid = await this.getJson(videoInfo);
|
||||||
const { json, video } = videoData;
|
const { json, video } = videoData;
|
||||||
|
|
||||||
const channel_uploads = await fetch(
|
let channel_uploads = null;
|
||||||
|
if (f) {
|
||||||
|
channel_uploads = await fetch(
|
||||||
`${this.config.invapi}/channels/${vid.authorId}?hl=${contentlang}®ion=${contentregion}`
|
`${this.config.invapi}/channels/${vid.authorId}?hl=${contentlang}®ion=${contentregion}`
|
||||||
);
|
);
|
||||||
const p = this.getJson(await channel_uploads.text());
|
channel_uploads = this.getJson(await channel_uploads.text());
|
||||||
|
}
|
||||||
|
|
||||||
if (!vid) {
|
if (!vid) {
|
||||||
console.log(
|
console.log(
|
||||||
|
@ -123,7 +126,7 @@ class InnerTubePokeVidious {
|
||||||
video,
|
video,
|
||||||
vid,
|
vid,
|
||||||
comments,
|
comments,
|
||||||
channel_uploads:p,
|
channel_uploads,
|
||||||
engagement: fe.engagement,
|
engagement: fe.engagement,
|
||||||
wiki: "",
|
wiki: "",
|
||||||
desc: "",
|
desc: "",
|
||||||
|
|
Loading…
Reference in a new issue