Giter Site home page Giter Site logo

inovindexer's Introduction

Inov Indexer

Contents

0. Intro.

1. Usage - Starting Fresh (Most Cases).

2. Usage - Starting with JSON File.

3. Usage - Continuing with download.

0. Intro

Indexes links and download links from certain websites and then downloads them. Most of the application uses promises for ease. Please ensure, when writing files, you have a minimum of 10gb available (for the audios)

- Getting started

  1. clone this repository & make sure Node.js is installed (LTS) on your machine.
  2. run npm install.
  3. choose how you want to start the code (three choices below) all located in main.js.
  4. you will then be prompted for a url, and then your email and password for that url. (When calling the login class method)

1. Usage - Starting Fresh

When running this for the first time you will want to use this option.

const indexer = new Indexer();

indexer.login()
  .then(() => indexer.startIndex())
  .then(() => indexer.writeJsonObj())
  .then(() => indexer.writeDownloads())
  .catch((err) => {
    console.log(err);
    indexer.end();
  });

2. Usage - Starting with JSON File.

When you have already run the first option once, if you ran it for enough time it would have generated a lessons.json file within the folder lessons/. You can then use this file to save time as this file contains all the indexing information. Just plug this file into the initiation of the class and run the write function.

const fs = require('fs');

const obj = JSON.parse(fs.readFileSync('lessons.json', 'utf8'));
const indexer = new Indexer({ lessons: obj, resume: false });

indexer.login()
  .then(() => indexer.writeDownloads())
  .then(() => indexer.end())
  .catch((err) => {
    console.log(err);
    indexer.end();
  });

3. Usage - Continuing with download.

Almost exactly the same as the previous step (2) however we need to pass in another option which is resume and this needs to be set to true. This will then continue downloading where you left off instead of starting again.

const fs = require('fs');

const obj = JSON.parse(fs.readFileSync('lessons.json', 'utf8'));
const indexer = new Indexer({ lessons: obj, resume: true });

indexer.login()
  .then(() => indexer.writeDownloads())
  .then(() => indexer.end())
  .catch((err) => {
    console.log(err);
    indexer.end();
  });

inovindexer's People

Contributors

willmayger avatar

Stargazers

Fernando Pasik avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

fritoebola

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.