Skip to content

Commit

Permalink
feat: v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulrahman1s committed Sep 19, 2022
1 parent ab7f4a3 commit 9c7b5c7
Show file tree
Hide file tree
Showing 11 changed files with 225 additions and 200 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
node_modules
cookies.json
node_modules
20 changes: 6 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,17 @@

### Requirements
- Nodejs v16 or newer installed
- Git Installed
- FrontendMasters account
- Valid FrontendMasters account cookies ([Guide](https://developer.chrome.com/docs/devtools/storage/cookies/))

### Usage
1. Clone the repo
```sh
$ git clone https://github.com/abdulrahman1s/fem-dl.git
$ cd fem-dl
```s
$ npx fem-dl
```

2. Rename [`cookies.example.json`](./cookies.example.json) to `cookies.json`

3. Copy the saved cookies at **frontendmasters.com** to `cookies.json` ([Guide](https://developer.chrome.com/docs/devtools/storage/cookies/))

4. Run!
```sh
$ npm install && npm start
or via pnpm
```s
$ pnpm dlx fem-dl
```


### Disclaimer
I am not responsible for any use of this program, please read [FrontendMasters terms of service](https://static.frontendmasters.com/assets/legal/MasterServicesAgreement.pdf) before using this.
8 changes: 0 additions & 8 deletions cookies.example.json

This file was deleted.

3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 27 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"name": "fem-dl",
"version": "0.0.1",
"version": "0.1.0",
"description": "Frontend Masters Downloader",
"private": true,
"main": "src/index.js",
"scripts": {
"start": "node --no-warnings --experimental-specifier-resolution=node src/index.js"
"start": "node src/index.js"
},
"bin": {
"fem-dl": "src/index.js"
},
"type": "module",
"dependencies": {
Expand All @@ -17,5 +20,24 @@
},
"engines": {
"node": ">=16"
}
}
},
"homepage": "https://github.com/abdulrahman1s/fem-dl#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/abdulrahman1s/fem-dl.git"
},
"bugs": {
"url": "https://github.com/abdulrahman1s/fem-dl/issues"
},
"license": "UNLICENSE",
"files": [
"src/*"
],
"keywords": [
"frontendmasters",
"fem",
"downloader",
"cli",
"courses"
]
}
6 changes: 5 additions & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const FEM_BASE = 'frontendmasters.com'

export const FEM_ENDPOINT = `https://${FEM_BASE}`
export const FEM_API_ENDPOINT = `https://api.${FEM_BASE}/v1`
export const FEM_CAPTIONS_ENDPOINT = `https://captions.${FEM_BASE}`

export const PLAYLIST_EXT = 'm3u8'
export const CAPTION_EXT = 'vtt'
export const QUALITY_FORMAT = {
Expand All @@ -12,7 +14,9 @@ export const QUALITY_FORMAT = {
360: 'index_360_Q8_2mbps'
}

export const FEM_COURSE_REG = /(:?https?:\/\/)?frontendmasters\.com\/courses\/([^/]+)/

export const SUPPORTED_FORMATS = [
'mp4',
// 'mkv'
'mkv'
]
Loading

0 comments on commit 9c7b5c7

Please sign in to comment.