For the first 11 tracks, everything works as normal.
When it reached the 12th track ("name": "Memory Fiction", "id": "swAvmmkBCzs"), KeyError is raised because of missing track.
It seems that YTDL API doesn't always provide that field (probably based on the video metadata?).
Hi, nice catch! I hadn't personally encountered this in the wild, but really awesome that you were able to identify, locate and fix the issue. Your PR is much appreciated :slightly_smiling_face:
Fix a (rare?) missing field error that I encountered.
For example, I tried
YouTubeMusicDL.download_album
operation with link: https://music.youtube.com/playlist?list=OLAK5uy_nmme7IwmAAjP8_ISwrCD-mwfwbY_DolPoFor the first 11 tracks, everything works as normal. When it reached the 12th track (
"name": "Memory Fiction", "id": "swAvmmkBCzs"
),KeyError
is raised because of missingtrack
. It seems that YTDL API doesn't always provide that field (probably based on the video metadata?).