Skip to content

Preserve VideoInfo and StreamingData pairing during local extraction #141

Description

@coderabbitai

Summary

Keep each InnerTube.VideoInfo paired with its originating InnerTube.StreamingData during local stream extraction.

Rationale

In Sources/YouTubeKit/YouTube.swift, streamingData removes VideoInfo responses that do not contain StreamingData. The streams implementation then uses zip(allStreamingData, videoInfos). If an earlier response has no streaming data, this can pair a later stream manifest with the wrong VideoInfo.

Extraction.applySignature(streamManifest:videoInfo:js:) does not currently use the supplied VideoInfo, so this does not cause a known behavior change. The code should be corrected before stream processing depends on VideoInfo metadata.

Affected area

  • Sources/YouTubeKit/YouTube.swift
    • YouTube.streamingData
    • Local extraction in YouTube.streams

Required changes

Use a representation that preserves the VideoInfo and StreamingData relationship. For example, iterate over videoInfos and skip responses without streamingData, or return and consume paired values.

Acceptance criteria

  • Each processed StreamingData uses its source VideoInfo.
  • Responses without streamingData do not change the pairing of later responses.
  • The change does not alter the intended fallback behavior.

Backlinks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions