youtubeDownloader
youtubeDownloader copied to clipboard
Deployed to Zeit : But on submit page is not found // Works locally though, just not deployed
Saw your post on Medium and wanted to build one myself.
I deployed it here: https://ytdownloader-hmb8sypdc.vercel.app/
My server.js file looks like this:
`
server.get('/download', async (req, res) => {
try {
let url = req.query.url;
let info = await ytdl.getInfo(url);
const video_title = info.videoDetails.title.replace(/\s+/g, '-');
res.header('Content-Disposition', `attachment; filename="${video_title}.mp4"`);
ytdl(url, {
format: 'mp4',
quality: 'highest',
}).pipe(res);
}
catch (err) {
console.log('Error locating video...', err);
return app.render(req, res, '/404');
}
});
`
Thanks!
so on zeit you have deployed index.html, right? if that is the case then you should also deploy the server script somewhere else. The approach demonstrated on the blog is having index.html deployed separate from the server, however, you can have it so that the index.html is directly served by the server which means you only have to deploy the server.
Also sorry for the late reply
@Moorad actually, I built the app in Typescript with Nextjs so it can deploy to Zeit/Now. Open to sharing the repo with you, sending the invite to Moorad now :)
Perhaps you can help me figure this out cause it's a bummer to not be able to use this on production and only locally...
sure, I will look into it first thing tomorrow morning
@Moorad did you get a chance to check my repo? Thanks!
@guntherkoo I'm really really sorry, I got caught up with some irl stuff. Could you please resend the invite since it has expired
Hi @Moorad , sorry took so long.. just added you to collab again.