Coder that you are looking for π¨βπ»β¨
This works on localhost, but my application is now in production and it's not working at all. Can you please help me with this?
Doing God's work ππ½
Just what I was looking for! But I am getting a CORS error because I am running the code from localhost. Apparently, you embedded your code in the youtube video page from which you are getting the transcript, somehow. Do you have some code to get around the CORS error to make your code more generally applicable?
Shriyash Parandkar
β This failed for me: const transcriptRes = await page.goto(tracks[0].baseUrl + '&fmt=json3'); const transcriptJson = await transcriptRes.json(); // YouTube blocks this
β This worked like magic: const result = await page.evaluate(async () => { const response = await fetch(baseUrl); // Works inside browser context const transcript = await response.json(); });
If you're stuck, this change makes all the difference! Thanks for sharing π Finally got it working β what a relief! π