youtubeDownloader icon indicating copy to clipboard operation
youtubeDownloader copied to clipboard

Deployed to Zeit : But on submit page is not found // Works locally though, just not deployed

Open guntherkoo opened this issue 4 years ago • 7 comments

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!

guntherkoo avatar Sep 12 '20 03:09 guntherkoo

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.

Moorad avatar Sep 16 '20 17:09 Moorad

Also sorry for the late reply

Moorad avatar Sep 16 '20 17:09 Moorad

@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...

guntherkoo avatar Sep 16 '20 18:09 guntherkoo

sure, I will look into it first thing tomorrow morning

Moorad avatar Sep 17 '20 02:09 Moorad

@Moorad did you get a chance to check my repo? Thanks!

guntherkoo avatar Sep 21 '20 20:09 guntherkoo

@guntherkoo I'm really really sorry, I got caught up with some irl stuff. Could you please resend the invite since it has expired

Moorad avatar Sep 25 '20 17:09 Moorad

Hi @Moorad , sorry took so long.. just added you to collab again.

guntherkoo avatar Oct 01 '20 14:10 guntherkoo