Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Refactor: Migrate to Innertube API for Caption Fetching#6

Merged
MrMySQL merged 2 commits into
mainfrom
copilot-upgrad-fetching-transcript
Jun 13, 2025
Merged

Refactor: Migrate to Innertube API for Caption Fetching#6
MrMySQL merged 2 commits into
mainfrom
copilot-upgrad-fetching-transcript

Conversation

@MrMySQL

@MrMySQL MrMySQL commented Jun 13, 2025

Copy link
Copy Markdown
Owner

This pull request introduces a fundamental change in how the library fetches YouTube captions, moving to the Innertube API. This crucial update addresses recent breaking changes in YouTube's undocumented APIs and temporarily disables cookie-based authentication.


Key Changes:

  • Migration to Innertube API (CORE CHANGE): The most significant change in this PR is the refactoring of the caption fetching mechanism to utilize YouTube's Innertube API. Previously, the script relied on parsing the watch page's HTML directly. This new approach involves:
    • Extracting an INNERTUBE_API_KEY from the video's HTML.
    • Making a direct POST request to a new INNERTUBE_API_URL with a specific INNERTUBE_CONTEXT and the videoId.
    • Parsing the JSON response from the Innertube API to extract caption data.

@codecov

codecov Bot commented Jun 13, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 89.47368% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/TranscriptListFetcher.php 90.32% 3 Missing ⚠️
src/Transcript.php 50.00% 1 Missing ⚠️
Files with missing lines Coverage Δ Complexity Δ
src/TranscriptList.php 100.00% <100.00%> (ø) 18.00 <0.00> (+1.00)
src/Transcript.php 95.65% <50.00%> (-2.08%) 13.00 <0.00> (+1.00) ⬇️
src/TranscriptListFetcher.php 81.70% <90.32%> (-7.53%) 23.00 <11.00> (+3.00) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MrMySQL MrMySQL force-pushed the copilot-upgrad-fetching-transcript branch from cc26d66 to cafb9d0 Compare June 13, 2025 22:44
@MrMySQL MrMySQL changed the title Enhanced TranscriptListFetcher to utilize the Innertube API for fetching captions Refactor: Migrate to Innertube API for Caption Fetching Jun 13, 2025
@MrMySQL MrMySQL merged commit e10e5b1 into main Jun 13, 2025
2 of 3 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