Open picaron opened 6 years ago
Hey,
I've just tried the following with Node v8.9.0
and it seems happy.
npm run download https://egghead.io/courses/optimistic-ui-updates-in-react
Which video series did you try and download?
doesn't work for me either
npm run download https://egghead.io/courses/up-and-running-with-redux-observable
just creates an empty nested directory. Node 8.10 (I did have to update some pkgs in package.json because npm audit
was crying, and I had to manually npm i request
or it threw an error telling me to do so..)
your series fails too:
Fetching: https://egghead.io/courses/optimistic-ui-updates-in-react
Writing: videos/optimistic-ui-updates-in-react
All Done 🎉
Run into the same issue as @corysimmons @markbrown4
There are two problems:
request
now has to be installed seperately and required explicitly in the download module. I also had to use request-promise
or else it will not return the html reponse, but a Request Object
, which will lead to html.includes in not a function
(Edit: didn't see that you set the global request in the program file, still, doing as above somehow solve that problem)Egghead.io
page for course is no longer fully server side rendered. So we can't get the lessons link. I suggest parsing the json from api instead, https://egghead.io/api/v1/series/use-types-effectively-in-typescript/lessonsWanting to save time, so I came upon this repo. Though I'm writing my own solution now, I hope this info can be useful for you.
Thanks @harrisnguyen94, you're on the right track with the missing links in the HTML response now.
If you're able to modify the script to hit the API a PR would be welcome :)
@harrisnguyen94 Can you open-source/gist your solution when you get something that works pretty well. It seems they update the site as fast as we can make downloader scripts. 😅
@corysimmons PR's are welcome from you too 😄
CORS, I was trigger-happy. Though I will see if I can find another way tomorrow, as I really need this. Definitely will create a PR if I can make it works.
~A hint is that this url is still fully server side rendered https://egghead.io/lessons, and we can successfully get the link from it.~ Nevermind, it's late and I say stupid things.
I'm getting this error:
@markbrown4 what version of node did you test with?