FUMR / tidal-async

Python Tidal streaming service unofficial API in async fashion supporting OAuth2 authentication
GNU Lesser General Public License v2.1
21 stars 4 forks source link

Downloading lyrics #3

Closed github-actions[bot] closed 3 years ago

github-actions[bot] commented 4 years ago

_This issue has been automatically created by todo-actions based on a TODO comment found in tidal_async/api.py:100. It will automatically be closed when the TODO comment is removed from master._

divadsn commented 4 years ago

Are there any example tracks on Tidal that have actual Lyrics provided?

JuniorJPDJ commented 4 years ago

I didn't find one and I was looking for it for a while. We could create baaad loop over hundreds of tracks to find one XD

JuniorJPDJ commented 4 years ago

@divadsn I found something ;)

        for track in tracks:
            try:
                resp = await sess.get(f"/v1/tracks/{track.id}/lyrics", params={"countryCode": sess.country_code})
            except ClientResponseError:
                pass
            else:
                print("FOUND LYRICS!")
                print(track)
                print(await resp.text())
                break
FOUND LYRICS!
<tidal_async.api.Track (22563745): Drake - Tuscan Leather>
{"trackId":22563745,"lyricsProvider":"MUSIXMATCH","providerCommontrackId":"12516902","providerLyricsId":"21254456","lyrics":"Yeah\nAlright\nYeah\n\nComin' off the last record\nI'm gettin' 20 million off the record\nJust to off these records\nNigga, that's a record\n\nI'm livin' like I'm out here on my last adventure\nPast the present when you have to mention\nThis is nothin' for the radio\nBut they'll still play it though\n'Cause it's that new Drizzy Drake\nThat's just the way it go\nHeavy airplay all day with no chorus\n\nWe keep it thorough, nigga\nRap like this for all of my borough niggas\nI reached the point\nWhere don't shit matter to me, nigga\nI reached heights that\nDwight Howard couldn't reach, nigga\nPrince Akeem, they throw flowers at my feet, nigga\n\nI could go a hour on this beat, nigga, yeah\nI'm just as famous as my mentor\nBut that's still the boss, don't get sent for\nGet hype on tracks\nAnd jump in front of a bullet you wasn't meant for\n'Cause you don't really wanna hear me vent more\n\nHot temper, scary outcome\nHere's a reason for niggas that's hatin' without one\nThat always let they mouth run\nBench players talkin' like starters, I hate it\n\nStarted from the bottom\nNow we here, nigga, we made it\nYeah, Tom Ford Tuscan Leather\nSmelling like a brick\nDegenerates, but even Ellen love our shit\n\nRich enough\nThat I don't have to tell 'em that I'm rich\nSelf explanatory\nYou just here to spread the story, wassup\n\nSittin' Gucci Row like they say up at UNLV\nYoung rebel, Young Money\nNothin' you could tell me\nPaperwork takin' too long\nMaybe they don't understand me\n\nI'll compromise if I have to\nI gotta stay with the family\nNot even talkin' to Nicki\nCommunication is breakin'\nI dropped the ball on some personal shit\n\nI need to embrace it\nI'm honest, I make mistakes\nI'd be the second to admit it\nThink that's why I need her in my life\nTo check me when I'm trippin'\n\nOn a mission tryna shift the culture\nTell me who dissin'\nI got some things that'll hit the culprit\nThem strep throat flows\nThem shits to stop all of the talkin'\n\nAll of the talkin'\nGot one reply for all of your comments\nFuck what you think\nI'm too busy, that's why you leave a message\nBorn a perfectionist\nGuess that makes me a bit obsessive\nThat shit I heard from you lately\nReally relieved some pressure\n\nLike aye, B, I got your CD\nYou get an E for effort\nI piece letters together\nAnd get to talkin' reckless\nOwl chains like credentials\nYou know you see the necklace\nMy life's a completed checklist\n\nI'm tired of hearin'\n'Bout who you checkin' for now\nJust give it time\nWe'll see who's still around a decade from now\nThat's real\n\nHow much time is this nigga spendin' on the intro?\nLately I've been feelin' like Guy Pearce in Memento\nI just set the bar\nNiggas fall under it like a limbo\nThe family all that matters\nI'm just out here with my kinfolk\n\nOff everything my pen wrote\nWe went from Bundy to Winslow\nThis for shorty up on Glengrove\nWho love when I catch my tempo\nI sip the Pora and listen to Cappadonna\nThe Fresh Prince just had dinner with Tatyana, no lie\n\nAll these 90's fantasies on my mind\nThe difference is that with mine\nThey all come true in due time\nI might come through without security\nTo check if you're fine\n\nThat's just me on my solo like fuck it, like YOLO\nWanted to tell you, \"Accept yourself\"\nYou don't have to prove shit to no one except yourself\nAnd if you end up needin' some extra help\nThen I could help\nYou know, back on your feet and shit\nTryna get my karma up\nFuck the guilty and greedy shit\n\nHow much time is this nigga spendin' on the intro?\nHow this nigga workin' like\nHe got a fuckin' twin though?\nLife is soundin' crazy, 40 on Martin Scorcese\nAnd I wouldn't change a thing if you paid me\nNow real nigga, wassup?\nHey, yeah, hey\n\nHow much time is this nigga spendin' on the intro?\nIf there's hell below\nI'll see you when you get there\nAre you enjoying yourselves?\nIf we may we would just like to close off with something\nA bit inspirational\nHopefully, or something a bit relevant\nAs to us all are having the same fears\nShedding similar tears\nAnd of course dying in so many years\nIt don't mean that we can't have a good life\nSo we'd like to just maybe close out with something\nFor food for thought","subtitles":"[00:23.80] Yeah\n[00:27.32] Alright\n[00:29.06] Yeah\n[00:30.27] Comin' off the last record\n[00:31.95] I'm gettin' 20 million off the record\n[00:33.67] Just to off these records\n[00:34.91] Nigga, that's a record\n[00:36.67] I'm livin' like I'm out here on my last adventure\n[00:39.23] Past the present when you have to mention\n[00:42.11] This is nothin' for the radio\n[00:43.97] But they'll still play it though\n[00:45.56] 'Cause it's that new Drizzy Drake\n[00:46.93] That's just the way it go\n[00:48.20] Heavy airplay all day with no chorus\n[00:50.65] We keep it thorough, nigga\n[00:51.91] Rap like this for all of my borough niggas\n[00:54.58] I reached the point\n[00:55.12] Where don't shit matter to me, nigga\n[00:57.57] I reached heights that\n[00:58.38] Dwight Howard couldn't reach, nigga\n[01:00.49] Prince Akeem, they throw flowers at my feet, nigga\n[01:03.57] I could go a hour on this beat, nigga, yeah\n[01:06.60] I'm just as famous as my mentor\n[01:09.33] But that's still the boss, don't get sent for\n[01:11.22] Get hype on tracks\n[01:12.42] And jump in front of a bullet you wasn't meant for\n[01:15.18] 'Cause you don't really wanna hear me vent more\n[01:17.40] Hot temper, scary outcome\n[01:19.75] Here's a reason for niggas that's hatin' without one\n[01:22.65] That always let they mouth run\n[01:24.15] Bench players talkin' like starters, I hate it\n[01:27.05] Started from the bottom\n[01:27.98] Now we here, nigga, we made it\n[01:29.62] Yeah, Tom Ford Tuscan Leather\n[01:31.23] Smelling like a brick\n[01:33.43] Degenerates, but even Ellen love our shit\n[01:36.19] Rich enough\n[01:36.83] That I don't have to tell 'em that I'm rich\n[01:39.00] Self explanatory\n[01:40.03] You just here to spread the story, wassup\n[01:44.31] \n[02:08.53] Sittin' Gucci Row like they say up at UNLV\n[02:12.08] Young rebel, Young Money\n[02:13.27] Nothin' you could tell me\n[02:14.65] Paperwork takin' too long\n[02:16.29] Maybe they don't understand me\n[02:17.53] I'll compromise if I have to\n[02:19.07] I gotta stay with the family\n[02:20.77] Not even talkin' to Nicki\n[02:22.15] Communication is breakin'\n[02:23.54] I dropped the ball on some personal shit\n[02:25.45] I need to embrace it\n[02:26.75] I'm honest, I make mistakes\n[02:28.31] I'd be the second to admit it\n[02:29.87] Think that's why I need her in my life\n[02:31.37] To check me when I'm trippin'\n[02:32.81] On a mission tryna shift the culture\n[02:34.78] Tell me who dissin'\n[02:35.75] I got some things that'll hit the culprit\n[02:37.62] Them strep throat flows\n[02:38.93] Them shits to stop all of the talkin'\n[02:40.82] All of the talkin'\n[02:41.78] Got one reply for all of your comments\n[02:43.69] Fuck what you think\n[02:44.60] I'm too busy, that's why you leave a message\n[02:46.79] Born a perfectionist\n[02:47.83] Guess that makes me a bit obsessive\n[02:49.84] That shit I heard from you lately\n[02:51.08] Really relieved some pressure\n[02:52.75] Like aye, B, I got your CD\n[02:54.35] You get an E for effort\n[02:55.70] I piece letters together\n[02:57.39] And get to talkin' reckless\n[02:58.73] Owl chains like credentials\n[03:00.28] You know you see the necklace\n[03:01.45] My life's a completed checklist\n[03:03.43] I'm tired of hearin'\n[03:04.11] 'Bout who you checkin' for now\n[03:05.72] Just give it time\n[03:06.70] We'll see who's still around a decade from now\n[03:08.47] That's real\n[03:11.09] \n[03:42.15] How much time is this nigga spendin' on the intro?\n[03:45.24] Lately I've been feelin' like Guy Pearce in Memento\n[03:47.92] I just set the bar\n[03:48.56] Niggas fall under it like a limbo\n[03:51.31] The family all that matters\n[03:52.19] I'm just out here with my kinfolk\n[03:54.06] Off everything my pen wrote\n[03:55.29] We went from Bundy to Winslow\n[03:56.85] This for shorty up on Glengrove\n[03:58.28] Who love when I catch my tempo\n[04:00.02] I sip the Pora and listen to Cappadonna\n[04:03.05] The Fresh Prince just had dinner with Tatyana, no lie\n[04:06.26] All these 90's fantasies on my mind\n[04:08.41] The difference is that with mine\n[04:10.16] They all come true in due time\n[04:11.66] I might come through without security\n[04:13.44] To check if you're fine\n[04:14.68] That's just me on my solo like fuck it, like YOLO\n[04:17.35] Wanted to tell you, \"Accept yourself\"\n[04:19.39] You don't have to prove shit to no one except yourself\n[04:22.32] And if you end up needin' some extra help\n[04:24.14] Then I could help\n[04:24.98] You know, back on your feet and shit\n[04:27.15] Tryna get my karma up\n[04:28.24] Fuck the guilty and greedy shit\n[04:30.14] How much time is this nigga spendin' on the intro?\n[04:32.88] How this nigga workin' like\n[04:34.36] He got a fuckin' twin though?\n[04:36.05] Life is soundin' crazy, 40 on Martin Scorcese\n[04:38.77] And I wouldn't change a thing if you paid me\n[04:40.93] Now real nigga, wassup?\n[04:43.22] Hey, yeah, hey\n[04:48.21] How much time is this nigga spendin' on the intro?\n[04:54.04] If there's hell below\n[04:56.77] I'll see you when you get there\n[05:00.02] Are you enjoying yourselves?\n[05:06.33] If we may we would just like to close off with something\n[05:09.43] A bit inspirational\n[05:12.12] Hopefully, or something a bit relevant\n[05:15.08] As to us all are having the same fears\n[05:17.73] Shedding similar tears\n[05:19.74] And of course dying in so many years\n[05:22.63] It don't mean that we can't have a good life\n[05:25.29] So we'd like to just maybe close out with something\n[05:28.25] For food for thought\n[06:00.49] "}
JuniorJPDJ commented 4 years ago

Even better:

https://gist.github.com/JuniorJPDJ/16fd2a8133d37da099422c4bc2a43bd4

JuniorJPDJ commented 3 years ago
resp = await sess.get(f"/v1/tracks/22563746/lyrics", params={"countryCode": sess.country_code})
t = await resp.json()
t
Out[20]: 
{'trackId': 22563746,
 'lyricsProvider': 'MUSIXMATCH',
 'providerCommontrackId': '12516899',
 'providerLyricsId': '19466389',
 'lyrics': "Somewhere between psychotic and iconic\nSomewhere between I want it and I got it\nSomewhere between I'm sober and I'm lifted\nSomewhere between a mistress and commitment\nBut I stay down, girl I always stay down\nGet down, have her lay down\nPromise to break everybody off before I break down\nEveryone just wait now\nSo much on my plate now\nPeople I believed in they don't even show their face now\nWhat they got to say now?\nNothing they can say now\nNothing really changed, but still they look at me a way now\nWhat more can I say now?\nWhat more can I say now?\nYou might feel like nothing was the same\nI still been drinking on the low\nMobbin on the low\nFuckin on the low\nSmokin on the low\n\nI still been plotting on the low\nScheming on the low\nThe furthest thing from perfect like everyone I know\nI just been drinking on the low\nMobbin on the low\nFuckin on the low\nSmokin on the low\nI just been plotting on the low\nScheming on the low\nThe furthest thing from perfect Like everyone I know\nAnd I hate that you don't think that I belong to ya\nJust too busy running shit to run home to ya\nYou know that paper my passion\n\nBittersweet celebrations, I know I can't change what happened\n\nI can't help it, I can't help it\n\nI was young and I was selfish\n\nI made every woman feel like she was mine and no one else's\nNow you hate me, stop pretending\nStop that fronting, I can't take it\nGirl don't treat me like a stranger\nGirl you know I seen ya naked\nGirl you know that I remember, don't be a pretender\nGetting high at the condo, that's when it all comes together\nYou know I stay remniscing and makeup sex is tradition\nBut you've been missing girl and you might feel like nothing was the same\nI still been drinking on the low\nMobbin on the low\nFuckin on the low\nSmokin on the low\nI still been plotting on the low\nScheming on the low\nThe furthest thing from perfect\nLike everyone I know\nI just been drinking on the low\n\nMobbin on the low\nFuckin on the low\n\nSmokin on the low\n\nI just been plotting on the low\n\nScheming on the low\nThe furthest thing from perfect like everyone I know\n\n(Girl you know that I remember...)\n\nDrinking\nSmoking\n\nFucking\nPlotting\nScheming\nPlotting\nScheming\nGetting money\nDrinking\nFucking\nSmoking\nPlotting\nScheming\nPlotting\nScheming\nGetting money\nUhh\nThis the life for me\nMy mama told me this was right for me\nI got em worried like make sure you save a slice for me\nI should have spoons serve you up with a fork and knife for me\nYour actions make us doubt you\nYour lack of effort got me rapping different\nThis the shit I wanna go out to\nPlay this shit at my funeral if they catch me slippin\nNaked women swimming that's just how I'm living\nDonate a million to some children that's just how I'm feeling\nA nigga filling up arenas who the fuck can see us\nI had to Derrick Rose the knee up 'fore I got the re-up\nYours truly the boy\nI just build and build more y'all niggas build and destroy\nY'all niggas party too much man I just chill and record\nNo filler you feel it now if you ain't feel it before\nYes Lord\nThis the shit I wanna go out to\nYeah.yeah\nThis the shit I wanna go out to",
 'subtitles': "[00:14.75] Somewhere between psychotic and iconic\n[00:18.12] Somewhere between I want it and I got it\n[00:21.86] Somewhere between I'm sober and I'm lifted\n[00:25.10] Somewhere between a mistress and commitment\n[00:27.69] But I stay down, girl I always stay down\n[00:30.35] Get down, have her lay down\n[00:32.28] Promise to break everybody off before I break down\n[00:35.69] Everyone just wait now\n[00:37.55] So much on my plate now\n[00:39.24] People I believed in they don't even show their face now\n[00:42.64] What they got to say now?\n[00:44.34] Nothing they can say now\n[00:46.24] Nothing really changed, but still they look at me a way now\n[00:49.78] What more can I say now?\n[00:51.44] What more can I say now?\n[00:53.21] You might feel like nothing was the same\n[00:55.47] I still been drinking on the low\n[00:57.02] Mobbin on the low\n[00:59.02] Fuckin on the low\n[01:00.74] Smokin on the low\n[01:02.66] I still been plotting on the low\n[01:04.67] Scheming on the low\n[01:06.09] The furthest thing from perfect like everyone I know\n[01:09.48] I just been drinking on the low\n[01:11.42] Mobbin on the low\n[01:13.62] Fuckin on the low\n[01:14.99] Smokin on the low\n[01:16.99] I just been plotting on the low\n[01:19.20] Scheming on the low\n[01:20.91] The furthest thing from perfect Like everyone I know\n[01:23.73] \n[01:25.96] And I hate that you don't think that I belong to ya\n[01:29.33] Just too busy running shit to run home to ya\n[01:32.76] You know that paper my passion\n[01:34.42] Bittersweet celebrations, I know I can't change what happened\n[01:38.15] I can't help it, I can't help it\n[01:39.65] I was young and I was selfish\n[01:41.08] I made every woman feel like she was mine and no one else's\n[01:44.57] Now you hate me, stop pretending\n[01:46.56] Stop that fronting, I can't take it\n[01:48.17] Girl don't treat me like a stranger\n[01:50.06] Girl you know I seen ya naked\n[01:51.72] Girl you know that I remember, don't be a pretender\n[01:55.11] Getting high at the condo, that's when it all comes together\n[01:58.75] You know I stay remniscing and makeup sex is tradition\n[02:01.74] But you've been missing girl and you might feel like nothing was the same\n[02:05.18] I still been drinking on the low\n[02:06.95] Mobbin on the low\n[02:08.49] Fuckin on the low\n[02:11.32] Smokin on the low\n[02:13.08] I still been plotting on the low\n[02:15.03] Scheming on the low\n[02:16.58] The furthest thing from perfect\n[02:18.35] Like everyone I know\n[02:19.83] I just been drinking on the low\n[02:21.67] Mobbin on the low\n[02:24.07] Fuckin on the low\n[02:25.55] Smokin on the low\n[02:26.67] I just been plotting on the low\n[02:28.66] Scheming on the low\n[02:30.45] The furthest thing from perfect like everyone I know\n[02:33.38] \n[02:44.66] (Girl you know that I remember...)\n[02:47.61] \n[02:54.72] Drinking\n[02:55.59] Smoking\n[02:56.23] Fucking\n[02:57.05] Plotting\n[02:57.84] Scheming\n[02:58.68] Plotting\n[02:59.33] Scheming\n[03:00.22] Getting money\n[03:00.94] Drinking\n[03:01.70] Fucking\n[03:02.48] Smoking\n[03:03.27] Plotting\n[03:04.02] Scheming\n[03:04.73] Plotting\n[03:05.42] Scheming\n[03:06.31] Getting money\n[03:07.49] Uhh\n[03:09.21] This the life for me\n[03:11.43] My mama told me this was right for me\n[03:14.27] I got em worried like make sure you save a slice for me\n[03:16.95] I should have spoons serve you up with a fork and knife for me\n[03:20.92] Your actions make us doubt you\n[03:24.22] Your lack of effort got me rapping different\n[03:27.38] This the shit I wanna go out to\n[03:29.69] Play this shit at my funeral if they catch me slippin\n[03:33.10] Naked women swimming that's just how I'm living\n[03:36.03] Donate a million to some children that's just how I'm feeling\n[03:38.86] A nigga filling up arenas who the fuck can see us\n[03:42.26] I had to Derrick Rose the knee up 'fore I got the re-up\n[03:46.19] Yours truly the boy\n[03:47.82] I just build and build more y'all niggas build and destroy\n[03:50.98] Y'all niggas party too much man I just chill and record\n[03:53.98] No filler you feel it now if you ain't feel it before\n[03:57.36] Yes Lord\n[03:58.83] This the shit I wanna go out to\n[04:01.63] Yeah.yeah\n[04:05.14] This the shit I wanna go out to\n[04:05.86] "}

Should we use t["lyrics"] or t["subtitles"]? What format of subtitles is this? Timestamps seems cool! Maybe two functions? One for subtitles one for lyrics?

EDIT: It looks like it's LRC format