diff --git a/src/core/Player.ts b/src/core/Player.ts index 4eb2577b3..bb2dd3117 100644 --- a/src/core/Player.ts +++ b/src/core/Player.ts @@ -10,7 +10,6 @@ import type { FetchFunction } from '../types/PlatformShim.js'; */ export default class Player { #nsig_sc; - #nsig_cache; #sig_sc; #sig_sc_timestamp; #player_id; @@ -22,8 +21,6 @@ export default class Player { this.#sig_sc_timestamp = signature_timestamp; this.#player_id = player_id; - - this.#nsig_cache = new Map(); } static async create(cache: ICache | undefined, fetch: FetchFunction = Platform.shim.fetch): Promise { diff --git a/src/parser/classes/misc/Author.ts b/src/parser/classes/misc/Author.ts index 8fcb65f04..754ad13c0 100644 --- a/src/parser/classes/misc/Author.ts +++ b/src/parser/classes/misc/Author.ts @@ -8,8 +8,6 @@ import type TextRun from './TextRun.js'; import Thumbnail from './Thumbnail.js'; export default class Author { - #nav_text; - id: string; name: string; thumbnails: Thumbnail[]; @@ -21,12 +19,12 @@ export default class Author { url: string; constructor(item: RawNode, badges?: any, thumbs?: any, id?: string) { - this.#nav_text = new Text(item); + const nav_text = new Text(item); - this.id = id || (this.#nav_text?.runs?.[0] as TextRun)?.endpoint?.payload?.browseId || this.#nav_text?.endpoint?.payload?.browseId || 'N/A'; - this.name = this.#nav_text?.text || 'N/A'; + this.id = id || (nav_text?.runs?.[0] as TextRun)?.endpoint?.payload?.browseId || nav_text?.endpoint?.payload?.browseId || 'N/A'; + this.name = nav_text?.text || 'N/A'; this.thumbnails = thumbs ? Thumbnail.fromResponse(thumbs) : []; - this.endpoint = ((this.#nav_text?.runs?.[0] as TextRun) as TextRun)?.endpoint || this.#nav_text?.endpoint; + this.endpoint = ((nav_text?.runs?.[0] as TextRun) as TextRun)?.endpoint || nav_text?.endpoint; this.badges = Array.isArray(badges) ? Parser.parseArray(badges) : observe([] as YTNode[]); this.is_moderator = this.badges?.some((badge: any) => badge.icon_type == 'MODERATOR'); this.is_verified = this.badges?.some((badge: any) => badge.style == 'BADGE_STYLE_TYPE_VERIFIED'); @@ -34,9 +32,9 @@ export default class Author { // @TODO: Refactor this mess. this.url = - (this.#nav_text?.runs?.[0] as TextRun)?.endpoint?.metadata?.api_url === '/browse' && - `${Constants.URLS.YT_BASE}${(this.#nav_text?.runs?.[0] as TextRun)?.endpoint?.payload?.canonicalBaseUrl || `/u/${(this.#nav_text?.runs?.[0] as TextRun)?.endpoint?.payload?.browseId}`}` || - `${Constants.URLS.YT_BASE}${this.#nav_text?.endpoint?.payload?.canonicalBaseUrl || `/u/${this.#nav_text?.endpoint?.payload?.browseId}`}`; + (nav_text?.runs?.[0] as TextRun)?.endpoint?.metadata?.api_url === '/browse' && + `${Constants.URLS.YT_BASE}${(nav_text?.runs?.[0] as TextRun)?.endpoint?.payload?.canonicalBaseUrl || `/u/${(nav_text?.runs?.[0] as TextRun)?.endpoint?.payload?.browseId}`}` || + `${Constants.URLS.YT_BASE}${nav_text?.endpoint?.payload?.canonicalBaseUrl || `/u/${nav_text?.endpoint?.payload?.browseId}`}`; } get best_thumbnail(): Thumbnail | undefined {