20lives / FrontendMastersDownloader

FrontendMasters Downloader - A tool to keep offline copy of frontendmasters courses
200 stars 41 forks source link

FedHasher not working #54

Open MichaelMurithi opened 1 year ago

MichaelMurithi commented 1 year ago

Hello, I tried login in to the tool but I get the following error in the command line: fed-error

I tried to debug the application by running it locally and I noticed that fedHasher() function below is not working:

export default function (timestamp) {
  return fetch(`${constants.fedHasherUrl}${timestamp}`)
    .then((res) => res.json())
    .then((json) => json.hash);
}

This is because the application used with the fedHasherUrl here 'https://fed-hasher.herokuapp.com/timestamp=' is no longer available on Heroku.

Steps to reproduce:

  1. Run the application (either using npx or npm locally)
  2. Enter your email and password from the command line prompt.
aprakash97 commented 1 year ago

Did it work locally (npm)? I tried but it didn't work. Can you please share the steps briefly.

lfkunzler commented 1 year ago

Didn't work locally (with npm). Same issue. I haven't found any replacement for fed-hasher. Any suggestion?

lfkunzler commented 1 year ago
git clone https://github.com/20lives/frontendmastersDownloader.git
cd frondendmastersDownloader
npm install inquirer
npm run start
? Email address: ...
? Password: * * *

return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
                                           ^
FetchError: invalid json response body at https://fed-hasher.herokuapp.com/timestamp=1681218116 reason: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
    at /tmp/frontendmastersDownloader/node_modules/node-fetch/lib/index.js:272:32
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async generateTimestamp (file:///tmp/frontendmastersDownloader/src/fedApi.js:19:10)
    at async Object.login (file:///tmp/frontendmastersDownloader/src/fedApi.js:51:3)
    at async run (file:///tmp/frontendmastersDownloader/src/index.js:15:22) {
  type: 'invalid-json'
}

Node.js v19.8.1
NerdHusky commented 1 year ago

It seems the heroku site that fedhasher is using doesn't work. Is someone competent to make this project work again??