podcasts features ✨ (#559)

This commit is contained in:
sigma67 2024-03-06 23:02:19 +01:00 • committed by GitHub
commit 90d172b1d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
46 changed files with 802 additions and 318 deletions

View file

@ -15,7 +15,7 @@ brand_account = "114511851949139689139"
yt_brand = YTMusic(Path(__file__).parent.joinpath("oauth.json").as_posix(), brand_account)
def populate_account():
def populate_music():
"""idempotent requests to populate an account"""
# library
playlist_id = "RDCLAK5uy_l9ex2d91-Qb1i-W7d0MLCEl_ZjRXss0Dk" # fixed playlist with many artists
@ -53,10 +53,18 @@ def populate_account():
)
print(f"Created playlist {playlistId}, don't forget to set this in test.cfg playlists/own")
# podcasts
def populate_podcasts():
yt_brand.rate_playlist(config["podcasts"]["podcast_id"], rating="LIKE")
yt_brand.add_playlist_items("SE", [config["podcasts"]["episode_id"]])
podcasts = yt_brand.search("podcast", filter="podcasts", limit=40)
for podcast in podcasts:
playlist_id = podcast["browseId"][4:]
yt_brand.rate_playlist(playlist_id, rating="LIKE")
podcast = yt_brand.get_podcast(playlist_id)
yt_brand.subscribe_artists([podcast["author"]["id"]])
if __name__ == "__main__":
populate_account()
populate_music()
populate_podcasts()