mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-24 23:32:32 +00:00
feat: Add Shorts endpoint (#512)
* chore: first try for shorts endpoints * chore: add shorts to index * fix: fix code style * chore: fix suggestions * fix: fix code style with spaces on curly brackets * chore: add curly rule to eslint * chore: run request in parallel * chore: remove console.logs and add other expect tests * chore: apply eslint suggestions * Update ReelPlayerOverlay.ts * Update VideoInfo.ts * chore: remove console.log from tests --------- Co-authored-by: absidue <48293849+absidue@users.noreply.github.com> Co-authored-by: LuanRT <luan.lrt4@gmail.com>
This commit is contained in:
28
src/parser/classes/PivotButton.ts
Normal file
28
src/parser/classes/PivotButton.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { type RawNode } from '../index.js';
|
||||
import { YTNode } from '../helpers.js';
|
||||
import Thumbnail from './misc/Thumbnail.js';
|
||||
import NavigationEndpoint from './NavigationEndpoint.js';
|
||||
import Text from './misc/Text.js';
|
||||
|
||||
export default class PivotButton extends YTNode {
|
||||
static type = 'PivotButton';
|
||||
|
||||
thumbnail: Thumbnail[];
|
||||
endpoint: NavigationEndpoint;
|
||||
content_description: Text;
|
||||
target_id: string;
|
||||
sound_attribution_title: Text;
|
||||
waveform_animation_style: string;
|
||||
background_animation_style: string;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.thumbnail = Thumbnail.fromResponse(data.thumbnail);
|
||||
this.endpoint = new NavigationEndpoint(data.onClickCommand);
|
||||
this.content_description = new Text(data.contentDescription);
|
||||
this.target_id = data.targetId;
|
||||
this.sound_attribution_title = new Text(data.soundAttributionTitle);
|
||||
this.waveform_animation_style = data.waveformAnimationStyle;
|
||||
this.background_animation_style = data.backgroundAnimationStyle;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user