Skip to content

Add Samsung TV client to default extraction - #145

Merged
alexeichhorn merged 1 commit into
mainfrom
feature/samsung-tv-client
Oct 24, 2026
Merged

alexeichhorn merged 1 commit into
mainfrom
feature/samsung-tv-client

Conversation

@alexeichhorn

@alexeichhorn alexeichhorn commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner
  • Problem: The existing default clients miss formats for some videos, including content marked as made for kids.
  • Solution: Add yt-dlp's Samsung TV client profile and prioritize it before visionOS and web during local extraction.

Note

Overview Adds Samsung TV to default video extraction through tvSamsung, queried concurrently alongside the existing visionOS and web clients.

Samsung TV client Introduces a TVHTML5 profile with client version 5.20260707, a Samsung Smart TV user agent, and device metadata identifying a Samsung UKS9800 running Tizen 2.4.0.

@alexeichhorn
alexeichhorn added this pull request to stack #148 October 23, 2026 17:16
@alexeichhorn
alexeichhorn marked this pull request as ready for review October 23, 2026 18:04
@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 36 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 14a91cb9-3bbc-4d82-a20c-6393747f9d84
📥 Commits

Reviewing files that changed from the base of the PR and between e5b7d03 and be62671.

📒 Files selected for processing: 2
  • Sources/YouTubeKit/InnerTube.swift
  • Sources/YouTubeKit/YouTube.swift
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T18:08:43.725496Z be62671 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be6267180a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

let ytcfg = try await ytcfg

let innertubeClients: [InnerTube.ClientType] = [.visionOS, .web]
let innertubeClients: [InnerTube.ClientType] = [.tvSamsung, .visionOS, .web]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Filter DRM streams before prioritizing Samsung

When YouTube returns drmFamilies on formats for the Samsung TV client, these streams require a DRM license and cannot be played through the current Stream API. StreamingData.Format does not decode or filter that marker, and because this client is now first, the itag deduplication at lines 268–272 retains its DRM URL while discarding a usable response with the same itag from visionOS or web. Filter DRM-marked formats before deduplication (or otherwise ensure a non-DRM response wins), or affected sessions will receive apparently valid but unplayable streams.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 049a6a6 via #149, at the top of this stack. Formats with nonempty drmFamilies are removed before signature processing and itag deduplication, preserving clear alternatives from later clients.

let ytcfg = try await ytcfg

let innertubeClients: [InnerTube.ClientType] = [.visionOS, .web]
let innertubeClients: [InnerTube.ClientType] = [.tvSamsung, .visionOS, .web]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep spherical variants when prioritizing Samsung

For 360° videos, the Samsung TV profile can return a flat viewport variant for an itag whose spherical/equirectangular variant is returned by another client. Since Samsung is now first and streams deduplicates solely by itag at lines 268–272, its URL wins and the correctly projected variant from visionOS or web is discarded, causing VR/360 consumers to receive the wrong projection. Avoid prioritizing Samsung for these videos, or decode projectionType and account for it during selection and deduplication.

Useful? React with 👍 / 👎.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit be62671. Configure here.

let ytcfg = try await ytcfg

let innertubeClients: [InnerTube.ClientType] = [.visionOS, .web]
let innertubeClients: [InnerTube.ClientType] = [.tvSamsung, .visionOS, .web]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DRM formats override playable streams

Medium Severity

Prioritizing tvSamsung can replace playable streams from visionOS and web. That client is known to return DRM-protected HTTPS formats, and those still win the per-itag merge because nothing inspects drmFamilies. Playback then fails for itags that the other clients already provided as clear streams.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit be62671. Configure here.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 049a6a6 via #149, at the top of this stack. Formats with nonempty drmFamilies are removed before signature processing and itag deduplication, preserving clear alternatives from later clients.

@alexeichhorn
alexeichhorn merged commit 89854c9 into main Oct 24, 2026
38 of 39 checks passed
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.

1 participant