File tree Expand file tree Collapse file tree
sync-missing-youtube-transcripts
services/transcript-bridge Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,31 +69,6 @@ async function fetchYouTubeCaptions(videoId: string): Promise<{
6969 fullText : string ;
7070 status : "completed" | "no_caption_available" ;
7171} > {
72- // 1. Try Residential Bridge Service if configured
73- const bridgeUrl = process . env . TRANSCRIPT_BRIDGE_URL || "https://transcripts.codingcat.dev" ;
74- const bridgeToken = process . env . TRANSCRIPT_BRIDGE_TOKEN || "e06fdac10c7c18aed27e47e3d18860121a0ca378288a3e04" ;
75-
76- if ( bridgeUrl ) {
77- try {
78- const bridgeResp = await fetch ( `${ bridgeUrl . replace ( / \/ + $ / , "" ) } /transcript?videoId=${ videoId } ` , {
79- headers : bridgeToken ? { Authorization : `Bearer ${ bridgeToken } ` } : { } ,
80- } ) ;
81- if ( bridgeResp . ok ) {
82- const data = ( await bridgeResp . json ( ) ) as any ;
83- if ( data ?. status === "completed" && Array . isArray ( data ?. cues ) && data . cues . length > 0 ) {
84- console . log ( `[Sync Missing YouTube Transcripts] Successfully fetched captions via residential bridge for ${ videoId } ` ) ;
85- return {
86- cues : data . cues ,
87- fullText : data . fullText || data . cues . map ( ( c : any ) => c . text ) . join ( " " ) ,
88- status : "completed" ,
89- } ;
90- }
91- }
92- } catch ( bridgeErr ) {
93- console . warn ( `[Sync Missing YouTube Transcripts] Residential bridge failed, trying direct fallback:` , bridgeErr ) ;
94- }
95- }
96-
9772 const INNERTUBE_API_URL =
9873 "https://www.youtube.com/youtubei/v1/player?prettyPrint=false" ;
9974 const INNERTUBE_CLIENT_VERSION = "20.10.38" ;
Original file line number Diff line number Diff line change @@ -80,31 +80,6 @@ async function fetchYouTubeCaptions(videoId: string): Promise<{
8080 fullText : string ;
8181 status : "completed" | "no_caption_available" ;
8282} > {
83- // 1. Try Residential Bridge Service if configured
84- const bridgeUrl = process . env . TRANSCRIPT_BRIDGE_URL || "https://transcripts.codingcat.dev" ;
85- const bridgeToken = process . env . TRANSCRIPT_BRIDGE_TOKEN || "e06fdac10c7c18aed27e47e3d18860121a0ca378288a3e04" ;
86-
87- if ( bridgeUrl ) {
88- try {
89- const bridgeResp = await fetch ( `${ bridgeUrl . replace ( / \/ + $ / , "" ) } /transcript?videoId=${ videoId } ` , {
90- headers : bridgeToken ? { Authorization : `Bearer ${ bridgeToken } ` } : { } ,
91- } ) ;
92- if ( bridgeResp . ok ) {
93- const data = ( await bridgeResp . json ( ) ) as any ;
94- if ( data ?. status === "completed" && Array . isArray ( data ?. cues ) && data . cues . length > 0 ) {
95- console . log ( `[Sync YouTube Transcript] Successfully fetched captions via residential bridge for ${ videoId } ` ) ;
96- return {
97- cues : data . cues ,
98- fullText : data . fullText || data . cues . map ( ( c : any ) => c . text ) . join ( " " ) ,
99- status : "completed" ,
100- } ;
101- }
102- }
103- } catch ( bridgeErr ) {
104- console . warn ( `[Sync YouTube Transcript] Residential bridge failed, trying direct fallback:` , bridgeErr ) ;
105- }
106- }
107-
10883 const INNERTUBE_API_URL =
10984 "https://www.youtube.com/youtubei/v1/player?prettyPrint=false" ;
11085 const INNERTUBE_CLIENT_VERSION = "20.10.38" ;
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments