ytdl-js / react-native-ytdl

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

(Android working) But not working with IOS 14.* #73

Closed tyhour closed 3 years ago

tyhour commented 3 years ago

I have problem with IOS can't get data response with error below. TypeError: undefined is not an object (evaluating 'videoDetails.thumbnail.thumbnails I was console.log in package and I see info = {"player_response": undefined} Thanks for help.

TylerOlthuizen commented 3 years ago

I'm getting the same error too

TylerOlthuizen commented 3 years ago

What things have you tried during debugging?

ninacoder-info commented 3 years ago

same problem it's been working before

Darguima commented 3 years ago

I found a workaround. You need edit the package on node_modules so it is undo when you run yarn or npm install. I already created a PR to correct it, just need wait be approved.

Add html5: 1 to the query object on node_modules/react-native-ytdl/lib/info.js, on function getVideoInfoPage (about line 329)

Some like this:

query: {
  video_id: id,
  eurl: VIDEO_EURL + id,
  ps: 'default',
  gl: 'US',
  hl: options.lang || 'en',
  html5: 1
}

I found the solution there: https://github.com/fent/node-ytdl-core/issues/923#issuecomment-843365128

tyhour commented 3 years ago

I found a workaround. You need edit the package on node_modules so it is undo when you run yarn or npm install. I already created a PR to correct it, just need wait be approved.

Add html5: 1 to the query object on node_modules/react-native-ytdl/lib/info.js, on function getVideoInfoPage (about line 329)

Some like this:

query: {
  video_id: id,
  eurl: VIDEO_EURL + id,
  ps: 'default',
  gl: 'US',
  hl: options.lang || 'en',
  html5: 1
}

I found the solution there: fent/node-ytdl-core#923 (comment)

I found a workaround. You need edit the package on node_modules so it is undo when you run yarn or npm install. I already created a PR to correct it, just need wait be approved.

Add html5: 1 to the query object on node_modules/react-native-ytdl/lib/info.js, on function getVideoInfoPage (about line 329)

Some like this:

query: {
  video_id: id,
  eurl: VIDEO_EURL + id,
  ps: 'default',
  gl: 'US',
  hl: options.lang || 'en',
  html5: 1
}

I found the solution there: fent/node-ytdl-core#923 (comment)

Now I used ytdl-core with rest api for my app right now. I thinks this package not update anymore. So issue has been fixed for me.