ytdl-js / react-native-ytdl

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

add `c` and `cver` params to `getVideoInfoPage` to fix 404 errors #80

Closed Darguima closed 3 years ago

Darguima commented 3 years ago

The getVideoInfoPage is having problems again. This issues reports the error - https://github.com/ytdl-js/react-native-ytdl/issues/78#issuecomment-864398263.

After search on the issues in node-ytdl-core repository I found this solution https://github.com/fent/node-ytdl-core/commit/d1f535712410eebd79a7468abd07d94f8c4ebe5a

It's simply more 2 parameters to the URL on getVideoInfoPage function:

Without this parameters the constant body that is defined like that:

const body = await utils.exposedMiniget(url.toString(), options).text();

will be empty and throw the error

react-native-ytdl commented 3 years ago

Thanks for the PR! :rocket: