ytdl-js / react-native-ytdl

A YouTube downloader for React Native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: undefined is not an object (evaluating 'videoDetails.thumbnail.thumbnails')

OmarSaidIbrahim opened this issue · comments

I keep getting the following error every time I relaunch the function of audio extraction

WARN Possible Unhandled Promise Rejection (id: 3):
TypeError: undefined is not an object (evaluating 'videoDetails.thumbnail.thumbnails')
cleanVideoDetails@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:109981:53
_callee$@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:105318:57
tryCatch@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:26922:23
invoke@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:27098:32
tryCatch@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:26922:23
invoke@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:26998:30
http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:27008:21
tryCallOne@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:28860:16
http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:28961:27
_callTimer@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:32400:17
_callImmediatesPass@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:32436:19
callImmediates@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:32654:33
callImmediates@[native code]
__callImmediates@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2719:35
http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2505:34
__guard@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2702:15
flushedQueue@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2504:21
flushedQueue@[native code]
invokeCallbackAndReturnFlushedQueue@[native code]

The first time I launch the function, it works fine. If I relaunch the function with a different youtube link it gives me the above error. The error below stops at the function:

const downloadableURLs = await ytdl(URL, { quality: 'highestaudio' });

Screenshot 2021-06-02 at 18 53 51

Screenshot 2021-06-02 at 18 54 23

working with React-Native 0.64.1

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.

Thank you so much, now it works !!

After 12 days I got this error even though I have updated the packages using yarn.

TypeError undefined is not an object: "info.player_response.storyboards"

Screenshot 2021-06-19 at 13 10 59

I am also getting this error.
It's Youtube that sometimes makes changes and it is necessary to fix some code, so now you only can wait for a new version or try to fix and open a PR.

Edit: This package is based in node-ytdl-core where also this is a problem (Status Code 403).

I found a solution.
Is only two parameters that need be added to an URL.
The commit is this: #80

For now, while it is not accepted (if it is), you can:

  • edit your node_modules/react-native-ytdl/lib/info.js and add the two params
  • or download temporarily my fork

Im gonna try it now and let you know. Thanks for the help anyway.

EDIT: yup works fine for me. Thanks again