Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloaded has no sounds @latest version #1264

Open
Hadestia opened this issue Nov 18, 2023 · 3 comments
Open

Downloaded has no sounds @latest version #1264

Hadestia opened this issue Nov 18, 2023 · 3 comments

Comments

@Hadestia
Copy link

Hadestia commented Nov 18, 2023

Why video has no sounds when downloading it with a normal process i got my code that looks like below and everytime the download was done it doesn't have any sounds, I'd tried ytdl.downloadFromInfo() as well but it gives me the same output.

`
await ytdl.getInfo(videoID).then(async (info) => {

if (info.live_playback) {
	reject('live-stream');
}
		
if (Number(info.videoDetails.lengthSeconds) > 720) {
	reject('long-music');
}
			
const final_path = `${path}${videoID}.mp4`;
const stream = Filesystem.createWriteStream(final_path);
await ytdl(videoID).pipe(stream);
			
stream.on('finish', function () {
	let result = {
		title: info.videoDetails.title,
		dur: Number(info.videoDetails.lengthSeconds),
		viewCount: info.videoDetails.viewCount,
		likes: info.videoDetails.likes,
		author: info.videoDetails.author.name,
		path: final_path
	}
	resolve(result);
});
			
stream.on('error', function (err) {
	reject(err);
});

}).catch((err) => {
reject(err);
});
`

@NotSername
Copy link

Add a filter to ytdl(videoid)

await ytdl(videoID, { filter: 'audioandvideo' }).pipe(stream);

@matifzia
Copy link

matifzia commented Jan 9, 2024

@Hadestia is saying true. there are issues with the latest version 4.11.5. It has mostly hasVideo: false or hasAudio: false in the formats. and also not able to download proper video. only some of the video format's download without audio/video

@MikeyA-yo
Copy link

Add a filter to ytdl(videoid)

await ytdl(videoID, { filter: 'audioandvideo' }).pipe(stream);

this works for me thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants