mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-15 02:22:11 +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.
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import NavigationEndpoint from './NavigationEndpoint.js';
|
|
import { YTNode } from '../helpers.js';
|
|
import type { RawNode } from '../index.js';
|
|
|
|
export default class ThumbnailOverlayToggleButton extends YTNode {
|
|
static type = 'ThumbnailOverlayToggleButton';
|
|
|
|
is_toggled?: boolean;
|
|
|
|
icon_type: {
|
|
toggled: string;
|
|
untoggled: string;
|
|
};
|
|
|
|
tooltip: {
|
|
toggled: string;
|
|
untoggled: string;
|
|
};
|
|
|
|
toggled_endpoint?: NavigationEndpoint;
|
|
untoggled_endpoint?: NavigationEndpoint;
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
if (Reflect.has(data, 'isToggled')) {
|
|
this.is_toggled = data.isToggled;
|
|
}
|
|
|
|
this.icon_type = {
|
|
toggled: data.toggledIcon.iconType,
|
|
untoggled: data.untoggledIcon.iconType
|
|
};
|
|
|
|
this.tooltip = {
|
|
toggled: data.toggledTooltip,
|
|
untoggled: data.untoggledTooltip
|
|
};
|
|
|
|
if (data.toggledServiceEndpoint)
|
|
this.toggled_endpoint = new NavigationEndpoint(data.toggledServiceEndpoint);
|
|
|
|
if (data.untoggledServiceEndpoint)
|
|
this.untoggled_endpoint = new NavigationEndpoint(data.untoggledServiceEndpoint);
|
|
}
|
|
} |