Web scrapping for youtube embedded video URLS with nitro.

This isn't a nuxt question, but seems puppetteer (webscraper) doesn't work properly inside nitro. I'd like to know how I can use it for getting the first youtube video from a query, and embedding the youtube link inside my page.
5 Replies
kapa.ai
kapa.ai3mo ago
Hi @Thick Black W. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry, but the knowledge sources provided do not contain information about using Puppeteer or other web scraping tools inside Nitro, nor do they cover how to programmatically fetch and embed YouTube video URLs using Nitro or Nuxt. The sources focus on Nitro's integration with Nuxt, server API routes, storage, proxying, and related backend features, but do not address headless browser automation or web scraping capabilities. If you need to perform web scraping (e.g., using Puppeteer) to extract YouTube video URLs, you may encounter compatibility issues running Puppeteer inside Nitro, as Nitro is designed for universal deployment (including serverless and edge environments) where headless browsers are often not supported. The knowledge sources do not provide a solution or workaround for this scenario. For embedding YouTube videos in a Nuxt app, you would typically use the YouTube embed URL directly if you already have it, but the process of scraping or programmatically obtaining that URL is not covered in the provided documentation. If you have further questions about Nitro or Nuxt features that are documented in the sources, feel free to ask! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@1321238874634195004> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
m&tra
m&tra3mo ago
have you tried using cloudflare's implementation of puppeteer via workers? i know nuxthub has this integration with their browser rendering feature
Thick Black W
Thick Black WOP3mo ago
maybe I should try asking chatgpt, brb update: there is a much easier way than puppetteer.
m&tra
m&tra3mo ago
yeah depending on how deep you want to go, you could probably get away with native fetch or cheerio

Did you find this page helpful?