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
1
vote
0 answers

Is hosting a Discord music bot on serverless infrastructure possible?

I've been running a custom Discord bot on a VPS for a while, but to streamline the development/deployment process and bring it in line with my other personal projects, I've been considering moving it to Cloudflare Workers. Discord fully supports…
HelloImRandom
  • 97
  • 2
  • 6
1
vote
0 answers

How can I create a write stream for res for a child_process.spawn method as it says cp.spawn().pipe(res) is not a method

const express = require('express'); const router = express.Router(); const ytdl = require('ytdl-core'); const cp = require('child_process'); const ffmpeg = require('ffmpeg-static'); router.get('/', async (req, res) => { const { v, f, q } =…
niishaaant
  • 11
  • 1
1
vote
1 answer

No video id found ytdl

Hello lately ive been developing a music bot on discord and i got it to join and leave perfectly but playing music is just annoying and some reason play and playStream doesnt work. With the bot i would like a person to message the name of a song and…
adam lewis
  • 11
  • 6
1
vote
3 answers

How can i download high quality you tube video using ytdl-core package in nodejs

my code snippet as below: const express = require('express'); const app = express(); const ytdl = require('ytdl-core'); const fs = require('fs') var router = express.Router(); router.get('/', function (req, res, next) { console.log('rputer…
Keyur Patel
  • 59
  • 1
  • 5
1
vote
1 answer

stream audio using yt-dlp kn python instead of downloading the file

i want to stream audio for a discord bot instead of downloading the file and extracting the audio file from it. i have tried code from Is there a way to directly stream audio from a youtube video using youtube-dl or pafy library in python 3.7?
1
vote
0 answers

node-ytdl-core miniget Error: Status code: 410

I'm currently making a Discord.js music bot. I use ytdl-core to get the video information (ie. URL, title, author's name, age restriction etc.). When I get an age restricted video I want to handle it by either bypassing the age restriction somehow…
ProGamer2711
  • 451
  • 1
  • 5
  • 18
1
vote
1 answer

how to speed up ytdl playlist load [discord.py]

This is the ytdl options: youtube_dl.utils.bug_reports_message = lambda: '' ytdl_format_options = { 'format': 'bestaudio/best', 'outtmpl': '%(extractor)s-%(id)s-%(title)s.%(ext)s', 'restrictfilenames': True, 'noplaylist': False, …
C-Gian
  • 62
  • 2
  • 19
1
vote
1 answer

Discord Bot error when playing music - discord.js v13

I made Music Bot and want to play music with yt-search and ytdl-core, everything works for a short time but then I get an error and I don't know how to solve this problem. const {videos} = await yts(message.content); if (!videos.length) return…
Lukas
  • 110
  • 11
1
vote
0 answers

Return a Nodejs Readable Stream as Response in CloudFlare Worker

I am trying to send a Readable Stream as Response to a CloudFlare Worker. I am using ytdl-core npm module to fetch the Readable Stream. Here is the entry point for the worker. const getAudio = (videoID, quality = "lowest") => { const audioStream =…
A Rogue Otaku
  • 913
  • 10
  • 20
1
vote
1 answer

Discord.py ytdl doesn't play age-restricted videos

I made a discord.py music bot that uses youtube_dl to play audio from youtube. But when I'm trying to play the age-restricted video it gives me an error: An error occurred: Command raised an exception: DownloadError: ERROR: Sign in to confirm your…
1
vote
1 answer

DiscordJS music bot disconnects immediately after starting to play the song

I try to play a Youtube URL but when it starts playing it stops after 1 second. mp3 files are working fine, it just doesn't work when I try to play Youtube URLs. Here is my Code: case 'play': { const Channel = ['903334978199388271']; for…
WupsiPupsi
  • 11
  • 2
1
vote
0 answers

How to access single url while youtube-dl extract playlist information

So, I made a discord bot and I need to extract the information from a playlist while playing music because my internet is slow. This is the code that I've tried. import sys from youtube_dl import YoutubeDL import threading import time info =…
geranard
  • 13
  • 3
1
vote
0 answers

Stop livestream when nobody is in the voice channel and play when a person joins discord.js

cloned a GitHub project and wanted to modify it a bit. The bot basically plays a Youtube livestream in a voice channel 24/7. I wanted to make it that the bot stops playing when nobody is in the voice channel and start as soon as a member joins the…
1
vote
0 answers

There is a way to play an audio from ytdl-core while it's downloading?

The ytdl-core has a function that creates a internal.Readable stream that can be piped to a file, example: ytdl(url, { filter: "audioonly"}).pipe(this.fs.createWriteStream(`path/to/file.mp3`)); And then, I return the file path after it's…
1
vote
1 answer

child process spawn output file and directory in NodeJs

I am using ffmpeg with child process to merge audio and video, but when i am trying to download the file, it is downloading in the same folder, but i want it to download it in the public folder. following is my code for the child process spawn. //…
Zeeshan
  • 371
  • 1
  • 3
  • 6
1 2
3
9 10