librespot-org / librespot

Open Source Spotify client library
MIT License
4.46k stars 540 forks source link

translation of lyrics #1262

Open ErfanM98 opened 3 months ago

ErfanM98 commented 3 months ago

Is your feature request related to a problem? Please describe. When I was searching through this awesome repo, I came across this :

pub struct LyricsInner {
    // TODO: 'alternatives' field as an array but I don't know what it's meant for
    pub fullscreen_action: String,
    pub is_dense_typeface: bool,
    pub is_rtl_language: bool,
    pub language: String,
    pub lines: Vec<Line>,
    pub provider: String,
    pub provider_display_name: String,
    pub provider_lyrics_id: String,
    pub sync_lyrics_uri: String,
    pub sync_type: SyncType,
}

I want to add that the 'alternatives' field is actually the translation of the lyric. This is a Chinese repo that manipulates Spotify to translate the result to Chinese. Describe the solution you'd like I did not see any tracks on the official Spotify app that has the translation. However, I modified my requests according to the mentioned script and I managed to see the feature that is something like this (on iOS):

Additional context By the way, I did not find any .proto files related to lyrics. Could you please help me to locate that files?

roderickvd commented 3 months ago

Great! Could you open a PR to document that?

I don't remember where I got the lyrics struct from. Maybe deserialising the JSON, I think that was it.