Added tests for get_lyrics
This commit is contained in:
parent
aac93a3010
commit
0d81ec9dcd
2 changed files with 12 additions and 0 deletions
|
|
@ -92,6 +92,17 @@ class TestYTMusic(unittest.TestCase):
|
|||
streaming_data = youtube_auth.get_streaming_data("ZrOKjDZOtkA")
|
||||
self.assertEqual(len(streaming_data), 3)
|
||||
|
||||
def test_get_lyrics(self):
|
||||
lyrics_song = youtube.get_lyrics("ZrOKjDZOtkA")
|
||||
self.assertIsNotNone(lyrics_song["browseId"])
|
||||
self.assertIsNotNone(lyrics_song["lyrics"])
|
||||
self.assertIsNotNone(lyrics_song["source"])
|
||||
|
||||
no_lyrics_song = youtube.get_lyrics("9TnpB8WgW4s")
|
||||
self.assertIsNotNone(no_lyrics_song["browseId"])
|
||||
self.assertIsNotNone(no_lyrics_song["lyrics"])
|
||||
self.assertIsNotNone(no_lyrics_song["source"])
|
||||
|
||||
###############
|
||||
# WATCH
|
||||
###############
|
||||
|
|
|
|||
|
|
@ -658,6 +658,7 @@ class BrowsingMixin:
|
|||
'videoId': videoId,
|
||||
'browseId': None,
|
||||
'lyrics': None,
|
||||
'source': None,
|
||||
}
|
||||
browseIdResponse = self._send_request('next', body)
|
||||
for tab in browseIdResponse['contents']['singleColumnMusicWatchNextResultsRenderer']['tabbedRenderer']['watchNextTabbedResultsRenderer']['tabs']:
|
||||
|
|
|
|||
Loading…
Reference in a new issue