Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to download YouTube videos with Expo?

I'm looking at being able to download YouTube videos within a React Native app created with Expo. I'm currently using Expo's FileSystem.downloadAsync, however this requires a direct URL to the resource to download. I've come across quite a few packages such as youtube-dl but they all require Node.JS to run.

My next thought was to use Node.JS within my app using nodejs-mobile - until I found out that you need to eject from Expo, which I definitely don't want to do.

Does anyone know of a way to download a YouTube video within an Expo app? Or just simply get a direct file link to pass into FileSystem.downloadAsync?

like image 792
Coder404 Avatar asked Dec 19 '25 21:12

Coder404


1 Answers

You might be able to use react-native-ytdl to get the direct video URL via their getInfo method (see this example) and then still use FileSystem.downloadAsync to download the file(s).

Since no linking is required, you wouldn't need to eject.

like image 140
sftgf Avatar answered Dec 21 '25 15:12

sftgf