From 568b35e469d1bc0678aaabc74afae49fd6501c11 Mon Sep 17 00:00:00 2001 From: Angelo Verlain Date: Fri, 14 Jul 2023 23:37:43 +0200 Subject: [PATCH] `get_user` -> `get_channel` --- mixins/browsing.ts | 7 ++++++- nav.ts | 1 + parsers/browsing.ts | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mixins/browsing.ts b/mixins/browsing.ts index 2b79ac0..33b1cb5 100644 --- a/mixins/browsing.ts +++ b/mixins/browsing.ts @@ -475,7 +475,7 @@ export interface UserPage extends UserContents { } | null; } -export async function get_user( +export async function get_channel( channelId: string, options: AbortOptions = {}, ): Promise { @@ -503,6 +503,11 @@ export async function get_user( return user; } +/** + * @deprecated Use `get_channel` instead. + */ +export const get_user = get_channel; + export async function get_user_playlists( channelId: string, params: string, diff --git a/nav.ts b/nav.ts index 3f282b0..812262a 100644 --- a/nav.ts +++ b/nav.ts @@ -28,6 +28,7 @@ export const NAVIGATION_BROWSE_ID = `${NAVIGATION_BROWSE}.browseId`; export const NAVIGATION_PARAMS = `${NAVIGATION_BROWSE}.params`; export const PAGE_TYPE = "browseEndpointContextSupportedConfigs.browseEndpointContextMusicConfig.pageType"; +export const NAVIGATION_PAGE_TYPE = `${NAVIGATION_BROWSE}.${PAGE_TYPE}`; export const NAVIGATION_VIDEO_ID = "navigationEndpoint.watchEndpoint.videoId"; export const NAVIGATION_PLAYLIST_ID = "navigationEndpoint.watchEndpoint.playlistId"; diff --git a/parsers/browsing.ts b/parsers/browsing.ts index 67c0349..30deda3 100644 --- a/parsers/browsing.ts +++ b/parsers/browsing.ts @@ -546,7 +546,7 @@ export function parse_video(result: any): ParsedVideo { artists: parse_song_artists_runs(runs.slice(0, artists_len)), playlistId: jo(result, NAVIGATION_PLAYLIST_ID), thumbnails: j(result, THUMBNAIL_RENDERER), - views: runs[runs.length - 1].text.split(" ")[0], + views: runs[runs.length - 1].text, }; }