Giter Site home page Giter Site logo

ch-download's Introduction

DEPRECATED

Download videos (course) from coursehunter.net

How to install (Node.js and GIT required):

~ git clone https://github.com/alekseylovchikov/ch-download.git
~ cd ch-download
~ npm install

How to use:

Download premium courses (required paid subscription)

# from downloaded directory
~ node index.js -u course-url -e email -p password [-d dirname] [-l lessons]

Download free courses

# from downloaded directory
~ node index.js -u course-url [-d dirname] [-l lessons]

Arguments:

-e: email for login
-p: password for login
-u, --url: https://coursehunter.net/course_name
-d, --dir: download folder, default <course_name>
-l, --lessons: download only listed lessons, e.g.: "1-5, 7, 10, 12-15" or 3-7,9,11,15-20

How to videos:

Download (without git) free courses

Authors:

ch-download's People

Contributors

alekseylovchikov avatar baixiaoji avatar dependabot[bot] avatar forest-shadow avatar gebeto avatar jivan99 avatar juni4567 avatar nazarb99 avatar pintu1991 avatar sawalhah avatar sema4-bohdanboiko avatar sergeikaptelin avatar valx76 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ch-download's Issues

Unable to do npm install

191 silly saveTree ├─┬ [email protected]
191 silly saveTree │ └── [email protected]
191 silly saveTree └── [email protected]
192 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...tgz"}},"6.0.59":{"nam'
192 verbose stack at JSON.parse ()
192 verbose stack at parseJson (/usr/local/lib/node_modules/npm/node_modules/json-parse-better-errors/index.js:7:17)
192 verbose stack at consumeBody.call.then.buffer (/usr/local/lib/node_modules/npm/node_modules/node-fetch-npm/src/body.js:96:50)
192 verbose stack at processTicksAndRejections (internal/process/task_queues.js:86:5)
193 verbose cwd /Users/fasil/Documents/downloader
194 verbose Darwin 18.6.0
195 verbose argv "/usr/local/Cellar/node/11.14.0_1/bin/node" "/usr/local/bin/npm" "install"
196 verbose node v11.14.0
197 verbose npm v6.9.0
198 error Unexpected end of JSON input while parsing near '...tgz"}},"6.0.59":{"nam'
199 verbose exit [ 1, true ]

Thanks!

Thanks for this tool. I use it a lot.

I am getting error while downloading specific video

coursehunters -u https://coursehunters.net/course/frontendmaster-deep-foundations-of-advanced-js -d /var/www/html/Deep-JavaScript-Basics/

error -
Starting app...

File /var/www/html/Deep-JavaScript-Basics//videos.txt created
/home/prashant/.nvm/versions/node/v10.14.1/lib/node_modules/parsecoursehunters/src/download/getVideos.js:36
const videoName = ${index + 1} + el.children[0].data.replace(/[/:*?"<>|]/g, '');
^

TypeError: Cannot read property 'data' of undefined
at filterSpan.map.el (/home/prashant/.nvm/versions/node/v10.14.1/lib/node_modules/parsecoursehunters/src/download/getVideos.js:36:66)
at Array.map (:null:null)
at Node. (/home/prashant/.nvm/versions/node/v10.14.1/lib/node_modules/parsecoursehunters/src/download/getVideos.js:33:22)
at testFn (/home/prashant/.nvm/versions/node/v10.14.1/lib/node_modules/parsecoursehunters/node_modules/cheerio/lib/api/traversing.js:320:22)
at /home/prashant/.nvm/versions/node/v10.14.1/lib/node_modules/parsecoursehunters/node_modules/lodash/_baseFilter.js:14:9
at /home/prashant/.nvm/versions/node/v10.14.1/lib/node_modules/parsecoursehunters/node_modules/lodash/_createBaseEach.js:24:11

I have an issue downloading a specific course.

trying to download https://coursehunters.net/course/progressivnye-veb-prilozheniya-v-react-s-create-react-app does not work,

the videos.txt file is completely empty

output:

Starting app...

File progressivnye-veb-prilozheniya-v-react-s-create-react-app/videos.txt already exists
Start download videos, please wait...

it quits afterwards.

Feature Request: Formatting and Padding zeros

CH provides unpadded course numbers:

lesson1.mp4
lesson2.mp4
...
lesson10.mp4

Some video players (MPV) require padding.

lesson01.mp4
...
lesson20.mp4

three zeros for more than a 100 video:

lesson001.mp4
...
lesson010.mp4
...
lesson100.mp4

Another thing is that on linux, it is more than recommended to not have spaces on your files so, you don't have to escape them. this is a command line app after all.
image
not only that this is unreadable, but also unusable. If you want to change the path you have to press ctrl+w a number of times and it's frustrating. I would suggest kebab-case (lowercase included) at least for linux.

Doesn't work

Will it work ever again? I can't even download a simple free course off.

findNotExistingVideo not working properly

const name = data.names[i].toString().replace(/[^A-Za-zА-Яа-я\d\s]/gmi, ''); // alelov

should add .replace('Урок ', '') to the end of this line, for making findNotExistingVideo.js works properly.
(for now in findNotExistingVideo.js, comparing videos and existing files will always result in false because video.name is like "Урок 1 xxxxx", while existing filename is like "1 xxxxx", remove the 'Урок ' prefix of video.name will fix the issue)

Feature Request: Custom Directory To Still Use Course Name Folder

Feature:

ch-download to download videos and put them in a folder with a custom directory set.
a -D captial d flag to do that?

Motivation:

I have a shell alias that can be called anywhere node ~/absolute/path/to/index.js -e email -p password -d ~/media/courses -u and would love to not have to worry about naming the directory inside media/courses and still use a custom one.

Check your e-mail or password

Hi! The app refuses to work with valid credentials. Yesterday everything was fine. I'm able to log in on coursehunters with these credentials and see the course. Password doesn't contain any special symbols, tried to screen it with single quotes, got no success.

Unable to get premium

Hi!

I have been trying to pay for premium access but could not. Could it be the merchants you guys use? I am a subscriber from West Africa.

Regards

Not able to download get this error?

node index.js -u https://coursehunter.net/course/100-dney-koda-polnyy-uchebnyy-kurs-python-pro -e ******* -p **********

https://coursehunter.net/course/prodvinutye-patterny-bezopasnosti-react
C:\Users\ch-download-master\src\download\getVideos.js:27
return materialsAnchorEl.get()[0]?.attribs.href;
^

SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:1053:16)
at Module._compile (internal/modules/cjs/loader.js:1101:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (C:\Users\ch-download-master\ch-download-master\index.js:23:19)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)

It don't work now

➜  dl coursehunters -u https://coursehunters.net/course/node-js-servernyy-javascript-12-noyabrya-21-dekabrya-2018  -e [email protected] -p asdfasdfasdfsadf
#############################
###  CH DOWNLOADER 0.0.7  ###
### THIS IS ALPHA VERSION ###
#############################

Starting app...

Directory /home/asd/dl/node-js-servernyy-javascript-12-noyabrya-21-dekabrya-2018 created
File node-js-servernyy-javascript-12-noyabrya-21-dekabrya-2018/videos.txt created
Start download videos, please wait...

And it don't do anything.

the install instruction won't work

npm install -g https://github.com/alekseylovchikov/ch-download
this is not working, should use the good old $>node index -u <url> or do a proper npm publish

This is a great tool that helps me so much! I use it on a raspberry pi to collect courses when sleeping! Really love your guys' amazing work!

Получаю ошибку throw er; // Unhandled stream error in pipe.

`Start download video: Урок 12. Блок 2 HTML \ CSS - 2
internal/streams/legacy.js:59
throw er; // Unhandled stream error in pipe.
^

Error: ENOENT: no such file or directory, open 'D:\1\sozdanie-kontentnogo-sayta-na-jekyll-ot-a-do-ya\Урок 12. Блок 2 HTML \ CSS - 2.mp4'`

coursehunters -u https://coursehunters.net/course/sozdanie-kontentnogo-sayta-na-jekyll-ot-a-do-ya -l 12

Wrong password

Seems like CH is changed their Auth API. I've tried with right password but showing wrong password again and again.

curl --location --request PUT 'https://coursehunter.net/api/auth/login' \
--header 'Content-Type: application/json' \
--header 'Cookie: ch_quiz=44c2c13503cd628582ab33102a8d227f' \
--data-raw '{
    "e_mail": "[email protected]",
    "password": "secrectPasswordNobodyKnowsTilNow"
}'

Error: check your email or password

Hello there!
I find out that if your password starts with $ sign then app will throw an error Check your email or password. So now I need to escape this sign with backslash.
It will be nice if you can fix this issue.
Cheers!

Videos not downloading

I am having an issue where the downloader starts but says creating videos.txt and then stops and nothing is downloaded , a video.txt file of 0kb is created (blank)

Feature Request: Skip download materials

When we download the course videos one after another, the download materials are downloaded every time we run the code.
Some of them are very large in size and they are not necessary.
Users should be able to choose whether to download the download materials or not.
Adding the choice as an argument in the code could help.

Ошибка при указании параметра --dir или -d на OS X

Если указывать параметр --dir или -d на Mac, получаем ошибку "Check your email or password". Но это не настоящая ошибка.

Код настоящей ошибки.

{ Error: EISDIR: illegal operation on a directory, mkdir '/'
    at Object.mkdirSync (fs.js:752:3)
    at downloadFolder.split.reduce (/Users/phoenix/projects/phoenix-group.by/node_modules/parsecoursehunters/src/create/createFolder.js:12:10)
    at Array.reduce (<anonymous>:null:null)
    at createFolder (/Users/phoenix/projects/phoenix-group.by/node_modules/parsecoursehunters/src/create/createFolder.js:9:29)
    at runGetVideos (/Users/phoenix/projects/phoenix-group.by/node_modules/parsecoursehunters/index.js:81:3)
    at getToken.then.token (/Users/phoenix/projects/phoenix-group.by/node_modules/parsecoursehunters/index.js:66:22)
    at process._tickCallback (internal/process/next_tick.js:68:7)
 errno: -21, syscall: 'mkdir', code: 'EISDIR', path: '/' }

В функции createFolder(downloadFolder) когда происходит проверка на наличие директории / на Mac функция fs.mkdirSync(curDir) возвращает код ошибки EISDIR который сейчас никак не обрабатывается и падает с ошибкой "Check your email or password".

Рабочая функция:

function createFolder(downloadFolder) {
  const sep = path.sep;
  const initDir = path.isAbsolute(downloadFolder) ? sep : '';
  downloadFolder.split(sep).reduce((parentDir, childDir) => {
    const curDir = path.resolve(parentDir, childDir);
    try {
      fs.mkdirSync(curDir);
    } catch (err) {
      if (err.code !== 'EEXIST' && err.code !== 'EISDIR') {
        throw err;
      }
      if (curDir == makeDownloadFolderPath(downloadFolder))
        console.log(`Directory ${curDir} already exists`.blue);
      return curDir;
    }
    console.log(`Directory ${curDir} created`.blue);
    return curDir;
  }, initDir);
}

Если требуется могу отправить Pull Request с исправлением.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.