H4wk507 / fem-downloader

Download courses from https://frontendmasters.com/ using node and ffmpeg
GNU General Public License v3.0
5 stars 1 forks source link

Can anyone confirm if this still works? #1

Open sahillangoo opened 4 months ago

beevk commented 1 month ago

Nope

H4wk507 commented 1 month ago

Tested it today and it works. What problem do you encounter?

beevk commented 1 month ago

Tested it today and it works. What problem do you encounter?

Hi, I just tried it today and received 403 Forbidden error.

...
...
[https @ 0x5b1f754fca00] No trailing CRLF found in HTTP header. Adding it.
[https @ 0x5edb6b6c3a00] HTTP error 403 Forbidden
https://stream.frontendmasters.com/2022/09/12/aPVwjxMZsP/AErmRZlPtt/index_1080_Q8_7mbps.m3u8: Server returned 403 Forbidden (access denied)
...
...
// This just repeats bunch of time (with different URLs) along with ffmpeg logs.

I tried logging out and logging back again to get new FEM_AUTH_MOD but that new token also didn't help. My guess is it detects the script and stops website access but I'm not 100% sure.

This is the config I tried it with:

const config = {
  FEM_AUTH_MOD: "MY-Auth-Code",
  COURSE_URL: "https://frontendmasters.com/courses/algorithms",
  QUALITY: "1080", // 2160, 1440, 1080, 720, 360
};
H4wk507 commented 1 month ago

I tested the same config and it seems like 1080p quality does not work. It looks like frontend masters updated their m3u8 stream quality for 1080p from Q8 to Q10. I added the fix in #2 and it works for me now, could you make a pull and test on your machine if it works now?

beevk commented 1 month ago

Yup, it worked initially but later I came across an issue where the script crashed after downloading a few videos. I believe the cause might be related to download speed and concurrency (not sure though).

I implemented a potential solution that limits download speed and concurrent downloads, and it seems to fix the crashing issue in my testing.

Would you be open to a pull request for this feature?

H4wk507 commented 1 month ago
  1. What was the error message?
  2. I can't open the pull request. You have to open it from your fork.
beevk commented 1 month ago
  1. What was the error message?

I got this error:

[hls @ 0x59496dbc7780] Opening 'crypto+https://stream.frontendmasters.com/2022/09/12/aPVwjxMZsP/MaxcdZelaq/index_1080_Q10_7mbps_00001.ts' for reading

file:///home/user1/fem-downloader/main.js:56
    const finalUrl = [...url.split("/").slice(0, -1), `${quality}.m3u8`].join(
                             ^

TypeError: Cannot read properties of undefined (reading 'split')
    at main (file:///home/user1/fem-downloader/main.js:56:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///home/user1/fem-downloader/main.js:89:1

Node.js v21.2.0
  1. I can't open the pull request. You have to open it from your fork.

I will do that. Thanks

I also noticed for some other course (Eg: https://frontendmasters.com/courses/practical-algorithms/), index_1080_Q10_7mbps doesn't work and returns the same error but when I changed it to index_1080_Q8_7mbps, it worked fine.