Files
YouTube.js/src/parser/youtube/Guide.ts
Luan 9b9fb82131 refactor: Clean up & fix old code
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.
2024-07-30 18:49:24 -03:00

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;
}
}