Why is npm install failing for YouTube video-to-mp3 conversion code on Pipedream?

This topic was automatically generated from Slack. You can find the original thread here.

I’m getting npm install failed as an error for this code, which is meant to download a YouTube video and convert it to an mp3.

I generated the code from GPT4 using ’s sample code from an earlier thread (though I think that was also generated by AI).

Has anyone successfully gotten ffmpeg to work on Pipedream?

Hi Thomas, could you share the specific error you’re seeing?

yep - that is the error actually:

Code Error
npm install failed

I’ve turned on support access for my test workflow: https://pipedream.com/@tomfrankly/test-youttube-to-mp3-p_ZJCo3zk/build

Thanks. ffmpeg should work and that import is correct, it’s actually failing on import youtubedl from "youtube-dl";. Looking into the package, it’s likely trying to use a system dependency that we don’t have on our execution environment

look like they actually deprecated that package and point users to another: youtube-dl - npm

unfortunately the new package install also fails, looking into why:

import youtubedl from 'youtube-dl-exec'

it seems like that package requires python be installed, since it’s a wrapper around GitHub - yt-dlp/yt-dlp: A youtube-dl fork with additional features and fixes . I think that’s part of the issue

Do you have another workaround / technique for downloading YouTube videos?

not that I know of, unless there’s another API that can do it. AFAIK, all of the YouTube-downloader apps use youtube-dl at their core

Not a huge issue at the moment. I anticipated that people would ask how they could transcribe and summarize YouTube videos once I released my voice notes-to-Notion workflow

Are you comfortable running this in a Python / Bash code step?

I’ve never written in Python, but I’m always down to learn and I have plenty of “treat me like a kindergardner” ChatGPT prompts at the ready :stuck_out_tongue:

Are there any potential issues with that, beyond me being unfamiliar with Python?

I’m turning this into a tutorial, so anything I do would be something that a large number of people might also do

The only hesitation I have in recommending Python is that it’s still in beta, and there are a few bugs we’re working to address.

do you know the best way to download YouTube videos in a workflow? e.g. could we build a pre-built Node action for this?

This would have been a nice use case for a custom container, and install the youtube-dl binary on.

I’m not aware of any other Node.js library that will download YouTube videos, nor of a 3rd party service that will act as a proxy.

Do you know what youtube-dl does that we can’t do via straight HTTP?

I know it’s a complex lib, just trying to see if it’s something we can hack for this specific use case

It might perform some request massaging with user-agents, etc. I’m not sure:

If it’s not feasible, no worries for now! I think people will still be very happy being able to transcribe and summarize voice notes and podcast episodes

any updates on this. trying to implement workflow that download video from youtube and convert to mp3