Welcome to my page!
I'm Aleksei and I'm a FrontEnd developer.
alekseylovchikov / ch-download Goto Github PK
View Code? Open in Web Editor NEWDownload videos (course) from coursehunter.net
Download videos (course) from coursehunter.net
Line 85 in 4883cd4
.replace('Урок ', '')
to the end of this line, for making findNotExistingVideo.js works properly.video.name
is like "Урок 1 xxxxx", while existing filename is like "1 xxxxx", remove the 'Урок ' prefix of video.name
will fix the issue)Hello,
CH DOWNLOADER 0.0.7
When I enter the URL it downloads only txt file. It happens both for free and premium courses.
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 ]
Can you publisher the current verison in npm?
the package in npm website version was 0.0.6, so could you publisher?
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
Will it work ever again? I can't even download a simple free course off.
.
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)
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"
}'
I think this will be useful to many.
Since I saw a request to download subtitles in the chat site
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!
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.
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.
Если указывать параметр --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 с исправлением.
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 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)
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.
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.
I have purchased the premium version of coursehunter and still I am getting this error.
The url link is https://coursehunter.net/course/full-stack-instagram-klon-2-0
`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
Check PR with update API endpoinds for lessons #61
ch-download to download videos and put them in a folder with a custom directory set.
a -D
captial d flag to do that?
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.
Thanks for this tool. I use it a lot.
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.
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!
Tested via node js: v10.15.0 and v8.9.1
I try to download:
https://coursehunters.net/course/kak-strukturirovat-proekt-laravel
I get:
Empty videos.txt file.
➜ 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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.