Fix get_playlist for playlists with more than 1,000 songs (closes #25)
This commit is contained in:
parent
2fa0603694
commit
4aae905a02
2 changed files with 3 additions and 2 deletions
|
|
@ -115,7 +115,7 @@ class TestYTMusic(unittest.TestCase):
|
||||||
###############
|
###############
|
||||||
|
|
||||||
def test_get_foreign_playlist(self):
|
def test_get_foreign_playlist(self):
|
||||||
playlist = youtube.get_playlist("PLQwVIlKxHM6qv-o99iX9R85og7IzF9YS_", 300)
|
playlist = youtube.get_playlist("PL6bPxvf5dW5clc3y9wAoslzqUrmkZ5c-u", 300)
|
||||||
self.assertGreater(len(playlist['tracks']), 200)
|
self.assertGreater(len(playlist['tracks']), 200)
|
||||||
|
|
||||||
def test_get_owned_playlist(self):
|
def test_get_owned_playlist(self):
|
||||||
|
|
|
||||||
|
|
@ -754,7 +754,8 @@ class YTMusic:
|
||||||
playlist['year'] = nav(header, SUBTITLE3)
|
playlist['year'] = nav(header, SUBTITLE3)
|
||||||
|
|
||||||
if len(header['secondSubtitle']['runs']) > 1:
|
if len(header['secondSubtitle']['runs']) > 1:
|
||||||
song_count = int(header['secondSubtitle']['runs'][0]['text'].split(' ')[0])
|
song_count = \
|
||||||
|
int(header['secondSubtitle']['runs'][0]['text'].split(' ')[0].replace(',', ''))
|
||||||
playlist['duration'] = header['secondSubtitle']['runs'][2]['text']
|
playlist['duration'] = header['secondSubtitle']['runs'][2]['text']
|
||||||
else:
|
else:
|
||||||
playlist['duration'] = header['secondSubtitle']['runs'][0]['text']
|
playlist['duration'] = header['secondSubtitle']['runs'][0]['text']
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue