Questions tagged [ytdl]

ytdl-core is a YouTube downloading module. Written with only Javascript and a node-friendly streaming interface. Use this tag for questions about the usage of ytdl-core

ytdl-core is a YouTube downloading module. Written with only Javascript and a node-friendly streaming interface.

YouTube is an American online video-sharing platform

145 questions
0
votes
4 answers

How can I change URL format?

I am using ytdl-core and it provides this URL…
0
votes
1 answer

Discord.js YTDL-Core Crashing

I wrote a Music bot for Discord with Node.js and YTDl-Core. I can Play every Song on YouTube, with one restriction, if I play a song/video of an channel which is little it is adding it to queue, but can't play it and the bot leaves the VoiceChannel,…
Snoweuph
  • 91
  • 1
  • 8
0
votes
2 answers

Stream youtube livestream through discord.js

I have been working on a custom discord bot, mostly for fun, but also for some friends. I want to stream a livestream (https://www.youtube.com/watch?v=5qap5aO4i9A) in a voice chat whenever anyone uses the !play study command. I am using…
Bagel03
  • 725
  • 7
  • 22
0
votes
2 answers

how can i get the filesize of each resolution without downloading it first ytdl-core

so I'm making a project using YTDL-core I had a question, how can I get the file size of each resolution without downloading it my code so far const { getInfo } = require("ytdl-core"); const ytdl = require("ytdl-core") const url =…
Farrel Athaillah
  • 107
  • 1
  • 10
0
votes
1 answer

Wrong in promises, program opens and instantly closes

Code ytdl.js const ytdl = require('ytdl-core') const fs = require('fs') downloadAudio = link => { return new Promise((resolve, reject) => { const stream = ytdl(link).pipe(fs.createWriteStream(`musica.mp3`)); stream.on('error',…
0
votes
1 answer

YTDL-CORE discordjs Error : Unable to retrieve video metadata

When I use ytdl.getInfo,that throwing Error : Unable to retrieve video metadata It was working at last week, but today it has stopped. I didn't change a code But when I use VPN, it working good How can I fix it?
Ihor
  • 1
  • 6
0
votes
1 answer

"Cannot read property 'url' of undefined" even though it's already defined

I'm making a Discord music Bot and I'm having trouble with an error saying TypeError: Cannot read property 'url' of undefined I tried console logging it and it showed me the url, so I don't understand what is the problem with my code. Here's my…
user13460312
0
votes
1 answer

SyntaxError: await is only valid in async function AND TypeError: Cannot read property 'length' of undefined

I have tried to get a result but I can't find how to solve SyntaxError: await is only valid in async function static async searchYoutube(query, message, voiceChannel) { await youtube.searchVideos(query, 5).catch(videos => { await…
YUNGJOHAN
  • 21
  • 6
0
votes
1 answer

TypeError: Cannot read property 'length' of undefined - specific bug

My bot uses the /play command, which previously delivered this list to choose the song Suddenly gives the error "Cannot read property 'length' of undefined" and I don't understand why if It worked correctly before Here I leave the specific part…
YUNGJOHAN
  • 21
  • 6
0
votes
1 answer

Why my ytdl info of thumbnail is an Object?

My info thumbnail is an Object, if so, then how would I get the URL? Because I wanna make an Embed with thumbnail, let info = ytdl.getInfo(url); let song = { . . . thumbnail: info.videoDetails.thumbnail } let embed = new…
AdolfJames Urian
  • 97
  • 1
  • 1
  • 9
0
votes
1 answer

youtube_dl error: Failed to parse JSON (caused by JSONDecodeError('Expecting value: line 1 column 1 (char 0)')) disocrd error

Error: youtube_dl.utils.DownloadError: ERROR: query "song": Failed to parse JSON (caused by JSONDecodeError('Expecting value: line 1 column 1 (char 0)') Play command: @commands.command(name='play',aliases=['p'] ) async def _play(self, ctx:…
0
votes
1 answer

How do I stop a ytdl stream?

How do I stop a ytdl stream if someone types -skip or something like that? I start the stream like this : search(searchfor, opts, function(err, results) { var rasss = results[0].link; const streamOptions = { seek: 0, volume: 1 }; var…
0
votes
1 answer

Discord.js Cannot read property 'push' of undefined

const Discord = require('discord.js'); const serverQueue = require('./play.js'); const ytdl = require('ytdl-core'); module.exports.run = async (bot, message, args) => { const voiceChannel = message.member.voice.channel; if (!voiceChannel) …
LeRegedit
  • 9
  • 7
0
votes
1 answer

Getting the current timestamp for a video with a Discord.js music bot?

I am trying to create a music bot with discord.js & ytdl-core. I would like to display the current timestamp when using a command called !nowplaying. However, I am not sure how I get the time. My code: //bot.queue is a collection, and contains some…
Malmadork
  • 237
  • 4
  • 13
0
votes
1 answer

I'm having trouble making a discord bot that plays music

The bot successfully connects to the voice channel, but does not play the song from the URL I typed, the code is: if(message.content.startsWith(prefix + "join")) { message.channel.send("Entrando a " + message.member.voiceChannel); if…
1 2 3
9
10