Removed old code

This commit is contained in:
Ben
2018-12-23 20:34:06 +00:00
parent 12f554dc88
commit 7a544b2234
6 changed files with 1 additions and 131 deletions

2
.gitattributes vendored
View File

@@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto

62
.gitignore vendored
View File

@@ -1,61 +1 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# next.js build output
.next
node_modules

21
LICENSE
View File

@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2018 plane000
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,6 +0,0 @@
# youtube-downloader
Simple to use youtube downloader, simply fill up the text files with videos you wish to download, sepperated by lines. run `npm i` and `node index.js` to download all of the videos in the file!
# Contrubutors
- Ben (plane000)#8618 <benjaminkyd@gmail.com>

View File

@@ -1,40 +0,0 @@
const fs = require('fs');
const ytdl = require('ytdl-core');
let videos = [];
if (!fs.existsSync('./videos.txt')) {
console.log('Could not find videos.txt, make sure it exists and has youtube links, each on new lines');
process.exit();
}
let text = fs.readFileSync('./videos.txt').toString();
text.split('\n').forEach((line) => {
videos.push(line.replace(/\r/, ''));
});
videos.forEach((url) => {
if (ytdl.validateURL(url)) {
ytdl.getInfo(url, (err, info) => {
if (err) {
console.log(`An error occured while downloading '${url}'`)
} else {
let title = info.title;
try {
let stream = ytdl(url, {quality: 'highest'}).pipe(fs.createWriteStream(`${title}.mp4`));
stream.on('finish', () => console.log(`Finish downloading ${title}`));
} catch (e) {
console.log(`An error occured while downloaing '${title}' retrying`)
try {
let stream = ytdl(url, {quality: 'highest'}).pipe(fs.createWriteStream(`${title}.mp4`));
stream.on('finish', () => console.log(`Finished downloading '${title}'`));
} catch (e) {
console.log(`Unable to download '${title}'`)
}
}
console.log(`Downloading '${title}'`);
}
})
} else console.log(`Video ${url} was not found`);
});

View File

@@ -1 +0,0 @@
https://www.youtube.com/watch?v=C00igZTktfc