fix: don't skip tracks with missing videoType from API - #165
Open
raiden076 wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #166
Problem
Tracks whose
videoTypefield is absent (null) in the YouTube Music API response are skipped as "unsupported video type", even though they have validvideoIdandisAvailable: true.Example: playlist
PLSJ8iGpQtYU8me1ZkQWfw2TZBybZoLijH— track 1 hasvideoType: nullwhile tracks 2–7 areMUSIC_VIDEO_TYPE_UGC. Only tracks 2–7 sync; track 1 is silently dropped.Root Cause
_extract_single_trackinextractor.pytreatsvideo_type is Noneuniformly — both genuinely unsupported video types AND the case where the API simply omits the field. The UGC fallback only fires whentrack.video_typeis a non-null string, so null-typed tracks fall through to theUNSUPPORTED_VIDEO_TYPEskip.Fix
When
track.video_typeisNone(missing from the API), create fallback metadata withVideoType.UGC/MatchResult.UNOFFICIAL— same treatment as explicit UGC tracks. These are typically user-uploaded tracks that lack proper tagging. They flow through whenYUBAL_DOWNLOAD_UGCis enabled; when disabled,_create_fallback_metadatarejects them as before. No behavioral change for users with UGC downloads off.Testing
Tested on the playlist above: all 7 tracks now sync successfully.