get_playlist fails if some track has invalid duration_seconds
adwait-thattey opened this issue · 0 comments
adwait-thattey commented
Describe the bug
Some tracks in Yt music can have invalid entry for field duration_seconds
. I typically saw this with unavailable tracks (that were live radios, but now removed) but maybe others can have similar issue. See attached sample json for the track below.
Due to this, if a playlist contains such tracks and we call get_playlist
, the internal helper function sum_total_duration fails because duration_seconds
is not an int.
See screenshot for failure below
2 sample tracks with invalid duration_seconds entry:
Error when get_playlist is called
To Reproduce
Steps to reproduce the behavior:
- Have a playlist with a track that has invalid duration_seconds
- call get_playlist on the playlist
- See error
Fix
I have fixed this locally. Submitting a PR