Gracefully retrieve uploaded songs with a blank duration (#578) (#580)

* add unit test that attempts to retrieve a song after its been uploaded

* prevent parsing errors when an uploaded song lacks a duration

* update unit test to delete/re-upload song if it already is uploaded

* format

* fix test

* add another sleep to end2end playlist

---------

Co-authored-by: sigma67 <ytmusicapi@gmail.com>
This commit is contained in:
Alex Pastel 2024-05-11 10:23:11 -06:00 • committed by GitHub
commit ae966bb96a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 41 additions and 2 deletions

View file

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