mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-15 18:42:11 +00:00
* deps: update linkedom
* refactor!: remove YTNodeGenerator in favour of namespaced pure functions
BREAKING CHANGES:
- Removes `YTNodeGenerator` from `import('youtubei.js').Generator` and exposes its functions directly in `import('youtubei.js').Generator`
* refactor!: replace Parser class with pure functions
- Remove Parser class in favour of pure functions
- Merge duplicate classes `AppendContinuationItemsAction` into a single class
- Move continuation parsers into a seperate file
- Add better custom logging support to parser methods as per issue #460
* refactor!: replace Proto class with pure functions
* chore: update package-lock.json
* refactor!: replace FormatUtils with pure functions and JSX components
- Replace linkedom DASH manifest generation with a dependency free JSX implementation
- Remove FormatUtils class in favour of pure functions
- Remove DOMParser requirement
- Remove duplicate types
* refactor: implement changes from #462
* chore: lint
* fix: deno support
* fix: render valid xml document
* fix: wrong function call in DashUtils
* fix: typo in parser
Co-authored-by: LuanRT <luan.lrt4@gmail.com>
* refactor!: move streaming info logic into seperate function
This allows users to access the same data available in the dash manifest while also simplifying the manifest generation
* chore: lint
* refactor: readability improvements & fixes
Remove redundant getAudioTrackGroups
General readability improvements in StreamingInfo.ts
Share response object between `getBitrate` and `getMimeType` as to not make duplicate requests
* build: remove unnecessary step in deno build
Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
* refactor: move types to `types` directory
* docs: add back comments lost during refactor
* chore: lint
---------
Co-authored-by: LuanRT <luan.lrt4@gmail.com>
Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
import { YTNode } from '../helpers.js';
|
|
import type { RawNode } from '../index.js';
|
|
import * as Parser from '../parser.js';
|
|
import BackstagePost from './BackstagePost.js';
|
|
import Button from './Button.js';
|
|
import Menu from './menus/Menu.js';
|
|
import Author from './misc/Author.js';
|
|
import Text from './misc/Text.js';
|
|
import Thumbnail from './misc/Thumbnail.js';
|
|
import NavigationEndpoint from './NavigationEndpoint.js';
|
|
|
|
export default class SharedPost extends YTNode {
|
|
static type = 'SharedPost';
|
|
|
|
thumbnail: Thumbnail[];
|
|
content: Text;
|
|
published: Text;
|
|
menu: Menu | null;
|
|
original_post: BackstagePost | null;
|
|
id: string;
|
|
endpoint: NavigationEndpoint;
|
|
expand_button: Button | null;
|
|
author: Author;
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
this.thumbnail = Thumbnail.fromResponse(data.thumbnail);
|
|
this.content = new Text(data.content);
|
|
this.published = new Text(data.publishedTimeText);
|
|
this.menu = Parser.parseItem(data.actionMenu, Menu);
|
|
this.original_post = Parser.parseItem(data.originalPost, BackstagePost);
|
|
this.id = data.postId;
|
|
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
|
|
this.expand_button = Parser.parseItem(data.expandButton, Button);
|
|
this.author = new Author(data.displayName, undefined);
|
|
}
|
|
} |