Skip to main content

Module parse

Module parse 

Source
Expand description

Results from parsing Innertube queries.

§Implementation example

use serde::Deserialize;
#[derive(Debug, Deserialize)]
struct Date {
    date_string: String,
    date_timestamp: usize,
}
impl ytmapi_rs::parse::ParseFrom<GetDateQuery> for Date {
    fn parse_from(
        p: ytmapi_rs::parse::ProcessedResult<GetDateQuery>,
    ) -> ytmapi_rs::Result<Self> {
        ytmapi_rs::json::from_json(p.json)
    }
}

§Alternative implementation

An alternative to working directly with crate::json::Json is to add json-crawler as a dependency and use the provided From<ProcessedResult> for JsonCrawlerOwned implementation.

Structs§

AddPlaylistItem
Provides a SetVideoID and VideoID for each video added to the playlist.
AlbumResult
AlbumSong
ArtistSong
Episode
GetAlbum
GetArtist
GetArtistAlbums
The Albums section of the Browse Artist page. The browse_id and params can be used to get the full list of artist’s albums. If they aren’t set, and results is not empty, you can assume that all albums are displayed here already.
GetArtistAlbumsAlbum
GetArtistRelated
GetArtistSongs
GetArtistTopReleases
GetArtistVideos
GetEpisode
GetLibraryArtistSubscription
GetLibraryUploadAlbum
GetLibraryUploadAlbumSong
GetPlaylistDetails
GetPodcast
GetPodcastChannel
GetPodcastChannelPlaylist
GetPodcastChannelPodcast
GetUser
HistoryItemEpisode
HistoryItemSong
HistoryItemUploadSong
HistoryItemVideo
HistoryPeriod
LibraryArtist
LibraryArtistSubscription
LibraryChannel
LibraryPlaylist
LibraryPodcast
Lyrics
MoodCategory
MoodCategorySection
MoodPlaylist
MoodPlaylistCategory
ParsedPodcastChannel
ParsedSongAlbum
ParsedSongArtist
ParsedUploadArtist
ParsedUploadSongAlbum
PlaylistEpisode
PlaylistSong
PlaylistUploadSong
PlaylistVideo
ProcessedResult
A result from the api that has been checked for errors and processed into JSON.
RelatedResult
SearchResultAlbum
An album search result.
SearchResultArtist
An artist search result.
SearchResultCommunityPlaylist
A community playlist search result.
SearchResultEpisode
A podcast episode search result.
SearchResultFeaturedPlaylist
A featured playlist search result.
SearchResultPodcast
A podcast search result.
SearchResultProfile
A profile search result.
SearchResultSong
SearchResults
TableListSong
TableListUploadSong
TasteProfileArtist
TopResult
Dynamically defined top result. Some fields are optional as they are not defined for all result types.
UploadAlbum
UploadArtist
UserPlaylist
UserVideo
WatchPlaylistTrack

Enums§

BasicSearchResultCommunityPlaylist
EpisodeDate
EpisodeDuration
HistoryItem
InLikedSongs
In some contexts, dislike will also be classified as indifferent.
IsSaved
PlaylistItem
PodcastChannelTopResult
PodcastSource
SearchResultPlaylist
SearchResultVideo
A video search result. May be a video or a video episode of a podcast.
TopResultType
Each Top Result has it’s own type.

Traits§

ParseFrom
Describes how to parse the ProcessedResult from a Query into the target type.