ytdl-js / react-native-ytdl

A YouTube downloader for React Native
121 stars 46 forks source link

403 response, result of consent screen #77

Closed Orawko closed 3 years ago

Orawko commented 3 years ago

I would like to use some youtube video in my app, but when I run:

const youtubeURL = 'http://www.youtube.com/watch?v=04GiqLjRO3A';
const urls = await ytdl(youtubeURL, { quality: 'highestaudio' });
console.log(urls)

I recieve 403 network error, and following warning:

Possible Unhandled Promise Rejection (id: 0): TypeError: Cannot read property 'storyboards' of undefined TypeError: Cannot read property 'storyboards' of undefined at Object.exports.getStoryboards

Week or two earlier, I used that without any problems. Maybe something has changed on the youtube site.

Edit: When I paste that url to safari on simulator, I can see youtube consent screen. As I have found, It is shown to some European countries (in my case Poland)

Darguima commented 3 years ago

This problem has been resolved in the latest version v4.8.2

Just need to reinstall the package

yarn upgrade react-native-ytdl@latest

The Youtube consent screen is not a problem.

Orawko commented 3 years ago

@Darguima Thank You for the response! After updating to mentioned version, problem is gone and video loads succesfully (maybe slightly longer than earlier)