Closed tombulled closed 2 years ago
>>> import ytm >>> api = ytm.YouTubeMusic() >>> songs = api.search_songs('cry') >>> pprint(songs['items'][:5]) [{'album': {'id': 'MPREb_uwlsuFTTmSO', 'name': 'Back to Bedlam'}, 'artists': [{'id': 'UCCEzq-Gv6gU-bdM82rtZN4g', 'name': 'James Blunt'}], 'duration': 247, 'explicit': True, 'id': 'm9w4LE51A4U', 'name': 'Cry', 'radio': {'params': 'wAEB', 'playlist_id': 'RDAMVMm9w4LE51A4U'}, 'thumbnail': {'height': 120, 'url': 'https://lh3.googleusercontent.com/QRPrcFOvhFSY4Yx_yPqwgmI3MeSZHrQvW2fm-OAEtqw6uJE7yGDK0vLrYn8cdW2WNRNMid_AP4HmQAVw=w120-h120-s-l90-rj', 'width': 120}}, {'album': {'id': 'MPREb_tttyhHE6nvb', 'name': 'Def Jam Sessions, Vol. 1'}, 'artists': [{'id': 'UCvWtix2TtWGe9kffqnwdaMw', 'name': 'Rihanna'}], 'duration': 235, 'explicit': True, 'id': 'GUVrPNTcD4M', 'name': 'Cry', 'radio': {'params': 'wAEB', 'playlist_id': 'RDAMVMGUVrPNTcD4M'}, 'thumbnail': {'height': 120, 'url': 'https://lh3.googleusercontent.com/fgIxUTO49TLbvsXtaWvAdHmvnJUSgdY6I2IK0QRJyUBM0CyyDmLzmZ9mxCwKAOyN-UewCP4zIB9jpxGX0A=w120-h120-s-l90-rj', 'width': 120}}, {'album': {'id': 'MPREb_YG7RB0QR8u9', 'name': 'The Complete Sun Releases and Columbia Singles 1955-62, ' 'Vol. 1'}, 'artists': [{'id': 'UCiGs21G3KeE2tpbbMPzn9Qg', 'name': 'Johnny Cash'}], 'duration': 148, 'explicit': False, 'id': 'KoXuGhdZijY', 'name': 'Cry! Cry! Cry! (feat. Tennessee Two)', 'radio': {'params': 'wAEB', 'playlist_id': 'RDAMVMKoXuGhdZijY'}, 'thumbnail': {'height': 120, 'url': 'https://lh3.googleusercontent.com/-c4z0LUol4kGbUY9PAq6CehaxxqoaYG23EIgTHswj07QDSvhcxBAXArzqhS5Z590zkPP6RHYvhq1x_UGQA=w120-h120-l90-rj', 'width': 120}}, {'album': {'id': 'MPREb_pJ2pbt2tOyh', 'name': "Rock 'N Soul"}, 'artists': [{'id': 'UCwIioEkBeMVDvsq0i6o5nvw', 'name': 'Solomon Burke'}], 'duration': 154, 'explicit': False, 'id': 'h1U2GfCGIEs', 'name': 'Cry to Me', 'radio': {'params': 'wAEB', 'playlist_id': 'RDAMVMh1U2GfCGIEs'}, 'thumbnail': {'height': 120, 'url': 'https://lh3.googleusercontent.com/6Ux5aD7ATOuZ6Yi8S20MXqPJRbVyElsny0R2gv_YCG9vKhwT0IgS7HTNn0W3zQe8pTdtFwH9kVsdc1oh=w120-h120-l90-rj', 'width': 120}}, {'album': {'id': 'MPREb_lMwnCCnXwKZ', 'name': "A Hard Day's Night"}, 'artists': [{'id': 'UC2XdaAVUannpujzv32jcouQ', 'name': 'The Beatles'}], 'duration': 106, 'explicit': False, 'id': 'zfnkMBOSIUQ', 'name': "I'll Cry Instead (Remastered 2009)", 'radio': {'params': 'wAEB', 'playlist_id': 'RDAMVMzfnkMBOSIUQ'}, 'thumbnail': {'height': 120, 'url': 'https://lh3.googleusercontent.com/EO81br_-ABNZsAoWN24yJnsNfxHoo0KGB_XEXkW-PFFT74JlNDPZlO48yONoQiQ2bbXxtn184eez2zk=w120-h120-l90-rj', 'width': 120}}]