import { Except } from 'type-fest'; import { Filter, FilterSingular, thumbnail, thumbnails as tb } from '../types'; import * as parser_bT from '../parsers/browsing.types'; import { parsePlaylistItemsReturn } from '../parsers/playlists.types'; import { parseAlbumHeaderReturn } from '../parsers/albums.types'; /**search */ export declare type searchResponse = { contents: tabbedSerachResultsRenderer | searchResults; }; declare type tabbedSerachResultsRenderer = { tabbedSearchResultsRenderer: { tabs: { tabRenderer: { content: searchResults; }; }[]; }; }; export declare type searchResults = { sectionListRenderer: { contents: searchResultsNav; }; }; export declare type searchResultsNav = { musicShelfRenderer: { contents: searchContentsAndMusicShelfRenderer[]; title: { runs: { text: Filter; }[]; }; }; }[]; export declare type searchContentsAndMusicShelfRenderer = searchResult & { musicShelfRenderer: { title: { runs: { text: string; }[]; }; }; }; export declare type parseResults = parseResult[]; export declare type parseResult = searchResult; export declare type searchResult = { musicResponsiveListItemRenderer: { navigationEndpoint: { watchEndpoint: { videoId: string; playlistId: string; }; browseEndpoint: { browseId: any; }; }; overlay: { musicItemThumbnailOverlayRenderer: { content: { musicPlayButtonRenderer: { playNavigationEndpoint: { watchEndpoint: { videoId: string; }; }; }; }; }; }; badges: { musicInlineBadgeRenderer: { accessibilityData: { accessibilityData: { label: string; }; }; }; }[]; thumbnail: { musicThumbnailRenderer: { thumbnail: { thumbnails: thumbnails; }; }; }; }; }; export declare type resultType = FilterSingular; export declare type resultTypes = (Extract | parseSearchResultsAdditionalResultTypes)[]; export declare type parseSearchResultsAdditionalResultTypes = 'station'; /**getArtist */ export declare type getArtistResponse = { contents: { singleColumnBrowseResultsRenderer: { tabs: Array<{ tabRenderer: { content: { sectionListRenderer: { contents: Array<{ musicShelfRenderer: { title: { runs: Array<{ navigationEndpoint: any; }>; }; contents: any; }; musicCarouselShelfRenderer: { contents: any; header: { musicCarouselShelfBasicHeaderRenderer: { title: { runs: Array<{ text: string; navigationEndpoint: { browseEndpoint: { browseId: string; }; }; }>; }; }; }; }; }>; }; }; }; }>; }; }; header: { musicImmersiveHeaderRenderer: { title: { runs: Array<{ text: string; }>; }; subscriptionButton: { subscribeButtonRenderer: { channelId: string; subscribed: boolean; subscriberCountText: { runs: Array<{ text: string; }>; }; }; }; playButton: { buttonRenderer: { navigationEndpoint: { watchPlaylistEndpoint: { playlistId: string; }; }; }; }; startRadioButton: { buttonRenderer: { navigationEndpoint: { watchPlaylistEndpoint: { playlistId: string; }; }; }; }; thumbnail: { musicThumbnailRenderer: { thumbnail: { thumbnails: thumbnails; }; }; }; }; }; }; export declare type getArtistResults = getArtistResponse['contents']['singleColumnBrowseResultsRenderer']['tabs'][number]['tabRenderer']['content']['sectionListRenderer']['contents']; /** * search */ export declare type thumbnails = tb; declare type duration = string | null; declare type artist = { name: string; id: string; }; declare type artists = artist[]; declare type searchVideo = { category: 'Videos'; resultType: 'video'; videoId: string; title: string; artists: artists; views?: string; duration: duration; duration_seconds: number; }; declare type searchSong = { category: 'Songs'; resultType: 'song'; videoId: string; title: string; artists: artists; album: { name: string; id: string; } | null; duration: duration; duration_seconds: number; isExplicit: boolean; feedbackTokens: { add: any | null; remove: any | null; }; }; declare type searchAlbum = { category: 'Albums'; resultType: 'album'; browseId: string; title: string; type: 'Album'; artist: string; year: string | null; isExplicit: boolean; }; declare type searchCommunityPlaylists = { category: 'Community playlists'; resultType: 'playlist'; browseId: string; title: string; author: string; itemCount: string; }; declare type searchFeaturedPlaylists = { category: 'Featured playlists'; resultType: 'playlist'; browseId: string; title: string; author: string; itemCount: string; }; declare type searchArtist = { category: 'Artists'; resultType: 'artist'; browseId: string; artist: string; shuffleId: string; radioId: string; }; declare type searchReturnHelper = Omit & { category: T['category'] | 'Top result'; thumbnails: thumbnails; }; declare type searchAllUnion = searchReturnHelper | searchReturnHelper | searchReturnHelper | searchReturnHelper | searchReturnHelper; export declare type searchMappedHelper = { songs: searchReturnHelper[]; videos: searchReturnHelper[]; albums: searchReturnHelper[]; artists: searchReturnHelper[]; playlists: (searchReturnHelper | searchReturnHelper)[]; community_playlists: searchReturnHelper[]; featured_playlists: searchReturnHelper[]; uploads: any[]; null: searchAllUnion[]; }; export declare type searchReturn = searchMappedHelper[T]; /** * getArtist */ export declare type getArtistReturn = { name: string; description: string | null; views: string | null; channelId: string | null; shuffleId: string | null; radioId: string | null; subscribers: string; subscribed: boolean; thumbnails: thumbnails | null; songs: { browseId: string; results: parsePlaylistItemsReturn; } | { browseId: null; }; } & parser_bT.parseArtistContentsReturn; export declare type getUserReturn = { name: string; } & parser_bT.parseArtistContentsReturn; /** * getAlbum */ export declare type getAlbumReturn = parseAlbumHeaderReturn & { tracks: (Except & { album: string; artists: parseAlbumHeaderReturn['artists']; })[]; }; /** * getSong */ declare type getSongFormats = Partial<{ width: number; hiehgt: number; fps: number; qualityLabel: string; signatureCipher: string; itag: number; url: string; mimeType: string; bitrate: number; initRange: { start: string; end: string; }; indexRange: { start: string; end: string; }; lastModified: string; contentLength: string; quality: string; projectionType: string; averageBitrate: number; highReplication: boolean; audioQuality: string; approxDurationMs: string; audioSampleRate: string; audioChannels: number; loudnessDb: number; }>[]; export declare type getSongRequest = { playabilityStatus: { status: string; playableInEmbed: boolean; audioOnlyPlayability: { audioOnlyPlayabilityRenderer: { trackingParams: string; audioOnlyAvailability: string; }; }; miniplayer: { miniplayerRenderer: { playbackMode: string; }; }; contextParams: string; }; streamingData: { expiresIn: string; formats: getSongFormats[]; adaptiveFormats: getSongFormats; }; videoDetails: { videoId: string; title: string; lengthSeconds: string; channelId: string; isOwnerViewing: boolean; isCrawlable: boolean; thumbnail: { thumbnails: thumbnails; }; allowRatings: boolean; viewCount: string; author: string; isPrivate: boolean; isUnpluggedCorpus: boolean; musicVideoType: string; isLiveContent: boolean; }; microformat: { microformatDataRenderer: { urlCanonical: `https://music.youtube.com/watch?v=${T}`; title: string; description: string; thumbnail: thumbnail; siteName: 'YouTube Music'; appName: 'YouTube Music'; androidPackage: 'com.google.android.apps.youtube.music'; iosAppStoreId: '1017492454'; iosAppArguments: `https://music.youtube.com/watch?v=${T}`; ogType: 'video.other'; urlApplinksIos: `vnd.youtube.music://music.youtube.com/watch?v=${T}&feature=applinks`; urlApplinksAndroid: `vnd.youtube.music://music.youtube.com/watch?v=${T}&feature=applinks`; urlTwitterIos: `vnd.youtube.music://music.youtube.com/watch?v=${T}&feature=twitter-deep-link`; urlTwitterAndroid: `vnd.youtube.music://music.youtube.com/watch?v=${T}&feature=twitter-deep-link`; twitterCardType: 'player'; twitterSiteHandle: '@YouTubeMusic'; schemaDotOrgType: 'http://schema.org/VideoObject'; noindex: boolean; unlisted: boolean; paid: boolean; familySafe: boolean; tags: string[]; availableCountries?: any; pageOwnerDetails: { name: string; externalChannelId: `${U}`; youtubeProfileUrl: `http://www.youtube.com/channel/${U}`; }; videoDetails: { externalVideoId: string; durationSeconds: string; durationIso8601: string; }; linkAlternates: { hrefUrl: string; title?: string; alternateType: string; }; viewCount: string; publishDate: `${string}-${string}-${string}`; category: string; uploadDate: `${string}-${string}-${string}`; }; }; }; /** * getLyrics */ export declare type getLyricsReturn = { lyrics: string | null; source: string | null; }; export {}; /** * getBaseJSUrl */ /** * getSignatureTimestamp */