get_charts: removed trending category (no longer available on YTM)

This commit is contained in:
sigma67 2024-02-04 16:29:27 +01:00 • committed by sigma67
commit da492e49f6
7 changed files with 14 additions and 15 deletions

View file

@ -6,7 +6,7 @@ import pytest
class TestBrowsing:
def test_get_home(self, yt, yt_auth):
result = yt.get_home()
assert len(result) == 2
assert len(result) >= 2
result = yt_auth.get_home(limit=15)
assert len(result) >= 15

View file

@ -9,9 +9,10 @@ class TestExplore:
def test_get_charts(self, yt, yt_oauth):
charts = yt_oauth.get_charts()
# songs section appears to be removed currently (US)
assert len(charts) >= 3
assert len(charts) == 4
charts = yt.get_charts(country="US")
assert len(charts) == 4
charts = yt_oauth.get_charts(country="US")
assert len(charts) == 5
charts = yt.get_charts(country="BE")
assert len(charts) == 4
assert len(charts) == 3

View file

@ -66,7 +66,7 @@ class TestPlaylists:
)
assert response["status"] == "STATUS_SUCCEEDED", "Adding playlist item failed"
assert len(response["playlistEditResults"]) > 0, "Adding playlist item failed"
time.sleep(3)
time.sleep(5)
yt_brand.edit_playlist(playlist_id, addToTop=False)
playlist = yt_brand.get_playlist(playlist_id, related=True)
assert len(playlist["tracks"]) == 46, "Getting playlist items failed"

View file

@ -17,7 +17,7 @@ yt_brand = YTMusic(Path(__file__).parent.joinpath("oauth.json").as_posix(), bran
def populate_account():
"""idempotent requests to populate an account"""
# library
# subscribe to some artists
playlist_id = "RDCLAK5uy_l9ex2d91-Qb1i-W7d0MLCEl_ZjRXss0Dk" # fixed playlist with many artists
yt_playlist = yt_brand.get_playlist(playlist_id)
artists = [track["artists"] for track in yt_playlist["tracks"]]