mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-17 06:34:40 -05:00
rename fetcher to dislikes :3
This commit is contained in:
parent
6006946ce5
commit
7c035cafac
1 changed files with 2 additions and 9 deletions
|
@ -28,12 +28,6 @@ class PokeTubeAPI {
|
||||||
this.headers = {};
|
this.headers = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated This method is deprecated. Please use the `video()` function defined in `libpoketube-core` to retrieve video data.
|
|
||||||
*/
|
|
||||||
async _getInnerTubeData() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a JSON string and returns the resulting object.
|
* Parses a JSON string and returns the resulting object.
|
||||||
|
@ -48,6 +42,7 @@ class PokeTubeAPI {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves engagement data for the YouTube video.
|
* Retrieves engagement data for the YouTube video.
|
||||||
* @returns {Promise<object|null>} A Promise that resolves with the engagement data, or null if an error occurs.
|
* @returns {Promise<object|null>} A Promise that resolves with the engagement data, or null if an error occurs.
|
||||||
|
@ -78,11 +73,9 @@ class PokeTubeAPI {
|
||||||
* @returns {Promise<object>} A Promise that resolves with an object containing video and engagement data.
|
* @returns {Promise<object>} A Promise that resolves with an object containing video and engagement data.
|
||||||
*/
|
*/
|
||||||
async getData() {
|
async getData() {
|
||||||
this.videoData = await this._getInnerTubeData();
|
|
||||||
this.engagement = await this._getEngagementData();
|
this.engagement = await this._getEngagementData();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
video: this.videoData,
|
|
||||||
engagement: this.engagement,
|
engagement: this.engagement,
|
||||||
videoUrlYoutube: `${YOUTUBE_URL}${this.videoId}`,
|
videoUrlYoutube: `${YOUTUBE_URL}${this.videoId}`,
|
||||||
};
|
};
|
||||||
|
@ -103,7 +96,7 @@ Returns basic data about a given YouTube video using PokeTubeAPI.
|
||||||
@async
|
@async
|
||||||
@function
|
@function
|
||||||
@param {string} videoId - The YouTube video ID to get data for.
|
@param {string} videoId - The YouTube video ID to get data for.
|
||||||
@returns {Promise<Object>} An object containing the video data and engagement data, as well as the YouTube URL for the video.
|
@returns {Promise<Object>} An object containing the engagement data, as well as the YouTube URL for the video.
|
||||||
@throws {Error} If the video ID is invalid or the request fails.
|
@throws {Error} If the video ID is invalid or the request fails.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue