Skip to content

Commit

Permalink
Merge pull request #80 from shihabmridha/revive
Browse files Browse the repository at this point in the history
Revive the project (2.0.0)
  • Loading branch information
shihabmridha authored Dec 25, 2023
2 parents 3f7123d + d10214d commit 99fa6ee
Show file tree
Hide file tree
Showing 18 changed files with 2,837 additions and 967 deletions.
21 changes: 21 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"semi": ["error"]
}
}
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig"
]
}
5 changes: 4 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
"skipFiles": [
"${workspaceFolder}/node_modules/**/*.js",
"<node_internals>/**"
]
],
"env": {
"NODE_PATH": "."
}
},
]
}
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
# !! Discontinued !!

<br>

## [😍 SUPPORT](https://www.educative.io?aff=xkwW)
Help maintaning this project by showing your support. Use **[this affiliate link](https://www.educative.io?aff=xkwW)** for future purchase.
Help maintaning this project by showing your support. Use **[this affiliate link](https://www.educative.io?aff=xkwW)** for future purchase.

## ✉️ Description
This tool is to download course from for later usage. It uses your login credentials and download the course.

## 🧯 IMPORTANT
- A bunch of things are not working (image is not loaded, full code snippet not captured, not multi-language support etc).
- You need a subscription to use this.
- Might not work in WSL
- Might not work in WSL.

# Prerequisite
- Node.js (tested version: 20.10.0)
- PNPM package manager

## 💡 Usage
- Install typescript cli.
- Clone the project and navigate into it.
- `npm install` to install dependencies.
- `pnpm install` to install dependencies.
- Open ___config/default.json___ file to set configurations. (Email, Password, Course URL).
- `npm run compile` to compile typescript.
- `npm start` to start download.
- `pnpm compile` to compile typescript.
- `pnpm start` to start download.

> IMPORTANT: If you make changes to the code, make sure to compile it.
## ⚙️ CONFIG
Config file (___config/default.json___) has the following properties.
- email: Your subscription email.
- password: Your subscription password.
- loginCheck: By default, before downloading a course we check if you are already logged in. If you are sure that you are already logged in then you can set this value to ___false___ to skip login check. Recommended value: `true`.
- skipLogin: By default, before downloading a course we check if you are already logged in. If you are sure that you are already logged in then you can set this value to ___false___ to skip login check.
- multiLanguage: A lesson can contains code snippets in multiple programming languages. Set this to `true` to download snippets in all available language. Default is `false`.
- saveAs: Available options: ___`pdf` and `html`___. Default is ___`html`___.
- headless: Browser mode. Default is `false`.
- downloadAll: Download all available courses for the account

> IMPORTANT: If you save as html it is actually gonna save as mhtml.

## 🛠 TROUBLESHOOT

**NAVIGATION TIMEOUT (Or, some other timeout)?**
- Open globals.ts and increase the value of `HTTP_REQUEST_TIMEOUT`. Default is 30000ms.
- Open configuration.ts and increase the value of `_httpTimeout`. Default is 30000ms.

**DOWNLOAD EMPTY PAGE?**
- Verify your login credentials and set `loginCheck: true`.
- Open ___browser.ts___ file and find `launchBrowser()` and set ` headless: false` to see live actions.
- Verify your login credentials and set `skipLogin: true`.
- Make sure you are logged in.

**FORCE LOGIN? LOGIN TO ANOTHER ACCOUNT?**
Expand Down
8 changes: 4 additions & 4 deletions config/default.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"email": "[email protected]",
"password": "yourPassword",
"loginCheck": true,
"skipLogin": true,
"saveAs": "html",
"multiLanguage": false,
"headless": true,
"courseUrl": "https://www.educative.io/courses/grokking-the-behavioral-interview",
"downloadAllCourses": false
"headless": false,
"courseUrl": "https://www.educative.io/courses/learn-intermediate-java",
"downloadAll": false
}
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
{
"name": "educative.io-downloader",
"version": "1.0.0",
"version": "2.0.0",
"description": "Download course from educative.io",
"main": "app.js",
"main": "build/app.js",
"dependencies": {
"config": "^3.2.4",
"puppeteer": "^2.0.0"
"puppeteer": "^21.5.2"
},
"devDependencies": {
"@types/node": "^13.1.7",
"@types/puppeteer": "^2.0.0",
"@types/config": "^0.0.36"
"@types/config": "^3.3.3",
"@types/node": "^20.10.0",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"cross-env": "^7.0.3",
"eslint": "^8.55.0",
"typescript": "^5.3.2"
},
"scripts": {
"start": "node build/src/app.js",
"dev": "nodemon build/src/app.js",
"start": "cross-env NODE_PATH=. node build/src/app.js",
"compile": "tsc -p .",
"test": "echo \"Error: no test specified\" && exit 1"
"compile:watch": "tsc -w"
},
"author": "Shihab Mridha",
"license": "ISC"
Expand Down
Loading

0 comments on commit 99fa6ee

Please sign in to comment.