Node-ytdl-core: This video is unavailable error

Created on 29 Dec 2018  Â·  21Comments  Â·  Source: fent/node-ytdl-core

Hi everyone! I was trying to add a video by a link but with every link I try it says: "Error: This video is unavailable.". I've the latest version of ytdl-core (0.28.3), and the error is in the
let info = await ytdl.videoInfo("url").catch(err => { console.log(err) });

bug needs more info stale

All 21 comments

Not sure what ytdl.videoinfo() refers to. Is that a custom function?

Ops, bad copy-paste, I was talking about
let info = await ytdl.getInfo("url").catch(err => { console.log(err) });

A few more questions to help narrow down the issue

  • This happens with every video you try? If not, can you the video this happens on?
  • Could you post more direct code to see if there's anything going on with the implementation?
  • Run npm ls ytdl-core to see if the installed version is the latest, sometimes even if you run npm install ytdl-core it'll install an older version due to another module depending on it.
  • It happens with every video I try
  • The script worked fine, a day I updated it and stopped working.. (I haven't modified that)
  • The version is the latest (0.28.3)

did you try going back to a older ytdl-core version to see whether that fixes your problem?

Yes, but nothing, same error.

What you can try is writing the body you receive from the request into a .html and open it using your browser / sending us
That might already tell you where the problem's at

I'm using Glitch.com for use ytdl-core. I'm hosting my own discord bot there.

I'm using Glitch.com for use ytdl-core. I'm hosting my own discord bot there.

haven't heard from that ¯\_(ツ)_/¯

I've already a server, but with glitch my music bot works better, it's a very small server (1gb ram, 20gb ssd and 1 vcore)

But I have a problem only when I use link, if I search a song with keywords the bot found it and reproduce it.

Does running your app locally or in another environment have it work?

I am getting the same issue, normal old household PC. No server or anything. Residential connection in Alberta, Canada.
ytdl-core: 0.29.1
node: 11.6.0
npm: 6.5.0-next.0

Just confirmed that this happens on my server as well, it is a dedicated machine through OVH in Ontario, Canada.
ytdl-core: 0.29.1
node: 11.6.0
npm: 6.5.0-next.0

Can confirm its happening on all of them for me. Even went all the way back to 0.20.2 and same issue.

Edit: I just tested ytdl-getinfo and even it is giving me the error This video is unavailable. So I am thinking its something with our connections or youtube itself.

Edit 2: ytdl-getinfo can search for the youtube video info. Instead of getting it from a link, you can give it search words. It seems a straight up link doesnt work but I can give search terms and that works.

Germany have a lot of issues with youtube videos, I'd host elsewhere. As for Ontario, it will just be specific videos probably

Hello!
I've the same issue and I don't know why...
Yesterday it was working well but today not at all !
I got the last version of ytld-core and I'm sure that not come from my connection because I can acces like I want at internet.
I'm currently in France but I don't think it's the cause :/ (I say that because of reading other comments)

Personnaly I use ytdl-core for my Discord bot in JS

Okay my bad!

That's because I was using toLowerCase method!
And I did that yesterday before to go bed that's why I didn't notice it earlier 😂

So I have a question about handling this error within an application without terminating. Whenever I get this error the program terminates rather than continuing to process videos. Is there anyway to prevent this. I've tried catching the exception in try-catch block.

I am looking for a way to catch this error as well. I don't want my code to terminate when this error is presented.

you can catch this error by listening to the error event from the returned stream

let stream = ytdl(url);
stream.on('error', err => {
  // handle it
});

do the following to catch uncaught errors, but it's strongly recommended to figure out where the error originates from so you can handle it properly

process.on('uncaughtException', err => {
});
Was this page helpful?
0 / 5 - 0 ratings

Related issues

jan-tennert picture jan-tennert  Â·  6Comments

GamerXD4 picture GamerXD4  Â·  5Comments

cloudrac3r picture cloudrac3r  Â·  5Comments

arcovoltaico picture arcovoltaico  Â·  6Comments

MidSpike picture MidSpike  Â·  4Comments