ikeboy / pluralsight-scraper

Pluralsight video downloader
https://www.knyz.org/blog/post/pluralsight-scraper-released/
GNU General Public License v2.0
140 stars 49 forks source link

npm ERR! code ELIFECYCLE #16

Open Aryangh1379 opened 4 years ago

Aryangh1379 commented 4 years ago

Hi Dear, i coudn't download linux-system-security-lpic-2 it gave me some kind of error that i intserted bellow . First i tried to download you example course, it was fine.

aryan@Ubuntu:~/pluralsight-scraper$ npm run get -- "https://app.pluralsight.com/library/courses/rust-fundamentals/table-of-contents"

> pluralsight-scraper@2.1.0 get /home/aryan/pluralsight-scraper
> node index.js get "https://app.pluralsight.com/library/courses/rust-fundamentals/table-of-contents"

Downloading course: rust-fundamentals
Retrieving metadata for: 1. Course Overview
Downloading video file for: 1. Course Overview.mp4
Retrieving metadata for: 2. Module Overview
Downloading video file for: 2. Module Overview.mp4
Retrieving metadata for: 3. Installing Rust
Downloading video file for: 3. Installing Rust.mp4
^Caryan@Ubuntu:~/pluralsight-scraper$ npm run get -- "https://app.pluralsight.com/library/courses/linux-system-security-lpic-2/table-of-contents"

> pluralsight-scraper@2.1.0 get /home/aryan/pluralsight-scraper
> node index.js get "https://app.pluralsight.com/library/courses/linux-system-security-lpic-2/table-of-contents"

Downloading course: linux-system-security-lpic-
Something went wrong. Double check the URL and try logging in again.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pluralsight-scraper@2.1.0 get: `node index.js get "https://app.pluralsight.com/library/courses/linux-system-security-lpic-2/table-of-contents"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pluralsight-scraper@2.1.0 get script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/aryan/.npm/_logs/2020-04-10T09_33_13_237Z-debug.log
aryan@Ubuntu:~/pluralsight-scraper$ 

Thanks in advance!

vezaynk commented 4 years ago

Whoopsy. The regex only matches - and [a-z], my bad! I totally forgot about numbers. Fix coming soon.

If you want to do it yourself and PR it, update this line: https://github.com/knyzorg/pluralsight-scraper/blob/8388d58bfdb760d55f50e60ed852fbe063546ea4/index.js#L10

To include the [0-9] pattern as well.

cicerothoma commented 4 years ago

Hi Dear, I also had trouble using the script on my windows machine. When I run your own example, it works but when I change the URL it no longer works `C:\Users\COLLINS\projects\pluralsight\pluralsight-scraper>npm run get -- "https://app.pluralsight.com/library/courses/rust-fundamentals/table-of-contents"

pluralsight-scraper@2.1.0 get C:\Users\COLLINS\projects\pluralsight\pluralsight-scraper node index.js get "https://app.pluralsight.com/library/courses/rust-fundamentals/table-of-contents"

Downloading course: rust-fundamentals Retrieving metadata for: 1. Course Overview Downloading video file for: 1. Course Overview.mp4 Terminate batch job (Y/N)? y

C:\Users\COLLINS\projects\pluralsight\pluralsight-scraper>npm run get -- "https://app.pluralsight.com/library/courses/math-for-programmers/table-of-contents"

pluralsight-scraper@2.1.0 get C:\Users\COLLINS\projects\pluralsight\pluralsight-scraper node index.js get "https://app.pluralsight.com/library/courses/math-for-programmers/table-of-contents"

Downloading course: math-for-programmers Retrieving metadata for: 1. Welcome Something went wrong. Double check the URL and try logging in again. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! pluralsight-scraper@2.1.0 get: node index.js get "https://app.pluralsight.com/library/courses/math-for-programmers/table-of-contents" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the pluralsight-scraper@2.1.0 get script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\COLLINS\AppData\Roaming\npm-cache_logs\2020-04-11T20_09_06_202Z-debug.log`

vezaynk commented 4 years ago

@cicerothoma Your problem is likely different. I will investigate another time, but it looks like a suspension.

Improved error handling to be tracked in #17

Aryangh1379 commented 4 years ago

Whoopsy. The regex only matches - and [a-z], my bad! I totally forgot about numbers. Fix coming soon.

If you want to do it yourself and PR it, update this line:

https://github.com/knyzorg/pluralsight-scraper/blob/8388d58bfdb760d55f50e60ed852fbe063546ea4/index.js#L10

To include the [0-9] pattern as well.

return /library\/courses\/([a-z\-0-9]+)/gi.exec(url)[1]; Is this True ? i'm not good at programming