tombulled / python-youtube-music

Python 3 YouTube Music Web API Client
GNU General Public License v3.0
64 stars 13 forks source link

Fix missing track #11

Closed fmigneault closed 3 years ago

fmigneault commented 3 years ago

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_DolPo

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?).

tombulled commented 3 years ago

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: