diff --git a/Contributors.md b/Contributors.md deleted file mode 100644 index 0be888f..0000000 --- a/Contributors.md +++ /dev/null @@ -1 +0,0 @@ -Balaji S github URL: https://github.com/balajinikhil diff --git a/Dockerfile b/Dockerfile index c3cae39..fc6d405 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ FROM node:latest -RUN cd Server/ - RUN npm i EXPOSE 4000 diff --git a/README.md b/README.md deleted file mode 100644 index ef06872..0000000 --- a/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Youtube Downloader - -This is a repository that has sample code for my [Medium Article](https://blog.usejournal.com/how-i-made-my-own-youtube-downloader-using-javascript-and-node-js-160b172f6e10) - -## Getting Started - -If there is any issues please open a new issue. - -1. You need to clone this repository -``` -git clone https://github.com/mooradal/youtubeDownloader -``` - -2. After you clone the repo you will have to navigate to the Server folder -``` -cd Server -``` - -3. Then you will have to install all the packages and dependencies -``` -npm install -``` - -4. Finally you need to run it -``` -node index.js -``` - -5. If you want to use nodemon (nodemon is a package that will auto restart the server when files are changed) you can run **(Optional)** - -``` -npm run dev -``` -or -``` -nodemon index.js -``` - -## Info - -If there is any issues please open a new issue. You are welcome to add pull requests at anytime - -Thank you so much for supporting me and thank you for almost 2,000 claps. I really appreciate that. I will try to post more articles and I'm thinking of turning this project from a sample code to an actual functional public website for everyone to use! diff --git a/index.html b/index.html deleted file mode 100644 index 42af61c..0000000 --- a/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - Youtube Downloader - - - -

Paste YouTube URL

- - - - - - - - \ No newline at end of file diff --git a/Server/index.js b/index.js similarity index 100% rename from Server/index.js rename to index.js diff --git a/Server/package-lock.json b/package-lock.json similarity index 100% rename from Server/package-lock.json rename to package-lock.json diff --git a/Server/package.json b/package.json similarity index 100% rename from Server/package.json rename to package.json diff --git a/script.js b/script.js deleted file mode 100644 index c593f3b..0000000 --- a/script.js +++ /dev/null @@ -1,40 +0,0 @@ -let Btn = document.getElementById('btn'); -let URLinput = document.querySelector('.URL-input'); -let select = document.querySelector('.opt'); -let serverURL = 'http://localhost:4000'; - -Btn.addEventListener('click', () => { - if (!URLinput.value) { - alert('Enter YouTube URL'); - } else { - if (select.value == 'mp3') { - downloadMp3(URLinput.value); - } else if (select.value == 'mp4') { - downloadMp4(URLinput.value); - } - } -}); - -async function downloadMp3(query) { - const res = await fetch(`${serverURL}/downloadmp3?url=${query}`); - if(res.status == 200) { - var a = document.createElement('a'); - a.href = `${serverURL}/downloadmp3?url=${query}`; - a.setAttribute('download', ''); - a.click(); - } else if(res.status == 400) { - alert("Invalid url"); - } -} - -async function downloadMp4(query) { - const res = await fetch(`${serverURL}/downloadmp4?url=${query}`); - if(res.status == 200) { - var a = document.createElement('a'); - a.href = `${serverURL}/downloadmp4?url=${query}`; - a.setAttribute('download', ''); - a.click(); - } else if(res.status == 400) { - alert('Invalid url'); - } -} \ No newline at end of file diff --git a/style.css b/style.css deleted file mode 100644 index a6a2037..0000000 --- a/style.css +++ /dev/null @@ -1,71 +0,0 @@ -* { - text-align: center; -} - -body { - display: grid; - grid-template-columns: auto; -} - -.heading { - font-family: Arial; - margin-top: 40vh; -} - -.URL-input, -.convert-button { - font-size: 1.3em; - padding: 5px 10px; -} - -.URL-input { - margin: auto; - border-radius: 4px 0px 0px 4px; - width: 30em; - text-align: left; - border: 2px solid #eeeeee; - background: #eeeeee; - outline: none; -} - -.URL-input:focus { - border: 2px solid #0485ff; -} - -.convert-button { - margin: 2% auto; - border: 2px solid #0485ff; - background: #0485ff; - color: white; - transition: 0.15s; -} - -.convert-button:hover { - background: #016acc; - border-color: #016acc; -} - -@media only screen and (max-width: 600px) { - body { - display: grid; - grid-template-columns: auto; - justify-content: center; - } - - .URL-input { - margin: auto; - width: 100%; - } - - .convert-button { - margin: 7% auto; - width: 100%; - } -} - -.opt { - width: 30vw; - margin: 2% auto; - padding: 4px; - border-radius: 7%; -} \ No newline at end of file