mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-22 14:08:06 +00:00
Other changes: - Renamed "getShortsWatchItem" to "getShortsVideoInfo". - Fixed `ShortFormVideoInfo`. This never worked for me ever since it was introduced. Turned out it was just implemented incorrectly. - Moved `basic_info` extraction to `MediaInfo`. Less of a pain to maintain as we only have to modify one file. - Removed unneeded tsdoc comments. - Fixed `Innertube#getStreamingData()`. Now it actually returns a deciphered format. - Simplified some types.
22 lines
738 B
TypeScript
22 lines
738 B
TypeScript
import { Parser } from '../index.js';
|
|
import GuideSection from '../classes/GuideSection.js';
|
|
import GuideSubscriptionsSection from '../classes/GuideSubscriptionsSection.js';
|
|
|
|
import type { ObservedArray } from '../helpers.js';
|
|
import type { IGuideResponse } from '../types/index.js';
|
|
import type { IRawResponse } from '../index.js';
|
|
|
|
export default class Guide {
|
|
#page: IGuideResponse;
|
|
contents?: ObservedArray<GuideSection | GuideSubscriptionsSection>;
|
|
|
|
constructor(data: IRawResponse) {
|
|
this.#page = Parser.parseResponse<IGuideResponse>(data);
|
|
if (this.#page.items)
|
|
this.contents = this.#page.items.array().as(GuideSection, GuideSubscriptionsSection);
|
|
}
|
|
|
|
get page(): IGuideResponse {
|
|
return this.#page;
|
|
}
|
|
} |