Skip to content

fix(plugin): support ytAtN attestation format for initial attestation extraction - #104

Merged
jim60105 merged 2 commits into
masterfrom
copilot/fix-initial-attestation-extraction
Feb 21, 2026
Merged

fix(plugin): support ytAtN attestation format for initial attestation extraction#104
jim60105 merged 2 commits into
masterfrom
copilot/fix-initial-attestation-extraction

Conversation

Copilot AI commented Feb 21, 2026

Copy link
Copy Markdown

YouTube changed its webpage attestation embedding from a direct string assignment (window.ytAtR) to a function call (window.ytAtN), breaking initial attestation extraction entirely.

Changes

  • plugin/yt_dlp_plugins/extractor/getpot_bgutil.py: Rewrites _get_attestation to try the new window.ytAtN(...) format first (extracting R property), falling back to the legacy window.ytAtR = ... format
  • Plugin version: 1.2.21.3.0
  • CHANGELOG.md: Documents the fix

Format comparison

// Legacy format (ytAtR)
window.ytAtR = '{"bgChallenge": {...}}';

// New format (ytAtN) — challenge is nested under R property
window.ytAtN({..., R: '{"bgChallenge": {...}}', ...});

Ports Brainicism/bgutil-ytdlp-pot-provider#195.

Original prompt

This section details on the original issue you should resolve

<issue_title>Failed to extract initial attestation from the webpage</issue_title>
<issue_description>Seemingly addressed in this pull?</issue_description>

<agent_instructions>Get Brainicism#195 content and implement it into our project. Also do a research explaning the root cause</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…station extraction

YouTube changed the webpage format for embedding BotGuard attestation data
from `window.ytAtR = '...'` to `window.ytAtN({..., R: '...', ...})`.

This commit ports the fix from Brainicism#195:
- Add primary regex for `window.ytAtN(...)` format, extracting the `R` property
- Keep `window.ytAtR = ...` as fallback for the legacy format
- Bump plugin version from 1.2.2 to 1.3.0

Ref: Brainicism#195

Co-authored-by: jim60105 <16995691+jim60105@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failed to extract initial attestation from webpage fix(plugin): support ytAtN attestation format for initial attestation extraction Feb 21, 2026
Copilot AI requested a review from jim60105 February 21, 2026 05:53
@jim60105
jim60105 marked this pull request as ready for review February 21, 2026 05:54
@codecov

codecov Bot commented Feb 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@jim60105
jim60105 merged commit 22332c1 into master Feb 21, 2026
5 checks passed
@jim60105
jim60105 deleted the copilot/fix-initial-attestation-extraction branch February 21, 2026 05:57
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.

Failed to extract initial attestation from the webpage

2 participants