Skip to content

fix: don't skip tracks with missing videoType from API - #165

Open
raiden076 wants to merge 1 commit into
guillevc:masterfrom
raiden076:fix/missing-videotype-skip
Open

fix: don't skip tracks with missing videoType from API#165
raiden076 wants to merge 1 commit into
guillevc:masterfrom
raiden076:fix/missing-videotype-skip

Conversation

@raiden076

@raiden076 raiden076 commented Jul 31, 2026

Copy link
Copy Markdown

Closes #166

Problem

Tracks whose videoType field is absent (null) in the YouTube Music API response are skipped as "unsupported video type", even though they have valid videoId and isAvailable: true.

Example: playlist PLSJ8iGpQtYU8me1ZkQWfw2TZBybZoLijH — track 1 has videoType: null while tracks 2–7 are MUSIC_VIDEO_TYPE_UGC. Only tracks 2–7 sync; track 1 is silently dropped.

Root Cause

_extract_single_track in extractor.py treats video_type is None uniformly — both genuinely unsupported video types AND the case where the API simply omits the field. The UGC fallback only fires when track.video_type is a non-null string, so null-typed tracks fall through to the UNSUPPORTED_VIDEO_TYPE skip.

Fix

When track.video_type is None (missing from the API), create fallback metadata with VideoType.UGC / MatchResult.UNOFFICIAL — same treatment as explicit UGC tracks. These are typically user-uploaded tracks that lack proper tagging. They flow through when YUBAL_DOWNLOAD_UGC is enabled; when disabled, _create_fallback_metadata rejects them as before. No behavioral change for users with UGC downloads off.

Testing

Tested on the playlist above: all 7 tracks now sync successfully.

Tracks whose videoType field is absent (None/null) in the YouTube Music API
response are currently skipped as 'unsupported video type', even though they
have valid videoIds and are downloadable. This happens because
_extract_single_track treats video_type is None uniformly - both genuinely
unsupported types AND the case where the API omits the field.

When track.video_type is None (missing), create fallback metadata as unofficial
content - these are typically user-uploaded tracks that lack proper tagging.
They now flow through when YUBAL_DOWNLOAD_UGC is enabled.

Example: playlist PLSJ8iGpQtYU8me1ZkQWfw2TZBybZoLijH - track 1 has
videoType=null while tracks 2-7 are MUSIC_VIDEO_TYPE_UGC. Only tracks 2-7
were synced; track 1 was silently skipped.
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

Successfully merging this pull request may close these issues.

Tracks with missing videoType silently skipped during sync

1 participant