Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_playlist fails if some track has invalid duration_seconds #597

Open
adwait-thattey opened this issue May 31, 2024 · 0 comments
Open

Comments

@adwait-thattey
Copy link

adwait-thattey commented May 31, 2024

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:
image
image

Sample track in my playlist
image

Error when get_playlist is called
image

To Reproduce
Steps to reproduce the behavior:

  1. Have a playlist with a track that has invalid duration_seconds
  2. call get_playlist on the playlist
  3. See error

Fix
I have fixed this locally. Submitting a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant