summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/courseware.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/courseware.js b/lib/courseware.js
index 82a1e1b..0c47210 100644
--- a/lib/courseware.js
+++ b/lib/courseware.js
@@ -12,6 +12,7 @@ var fs = require('fs'),
ProgressBar = require('progress'),
inquirer = require('inquirer'),
colors = require('colors'),
+ util = require('util'),
_ = require('lodash');
var isWin = /^win/.test(process.platform),
@@ -46,7 +47,7 @@ function listVideos(url, jar, id, callback) {
if (res.statusCode === 200) {
var $ = cheerio.load(body),
- pageView = $('section.course-content').html(),
+ pageView = $('div.col-sm-9.course-content section').html(),
getVideoIds = (pageView) ? pageView.match(/(.0:)(.*?)(&)/g) : pageView;
getVideoIds = (!getVideoIds) ? [] : getVideoIds.map(function map(item) { return { id: id, video: 'https://youtu.be/' + item.replace('.0:','').replace('&','')}; });
@@ -93,11 +94,11 @@ module.exports = {
'use strict';
- var chapter = $('.chapter'), master = $('div.inner-wrapper h1').text(), courses = [];
+ var chapter = $('.accordion-caret'), master = $('h1').text(), courses = [];
$(chapter).each(function each(i, item) {
var current = $(item),
- title = current.find('h3 a').text(),
+ title = current.find('a.accordion-toggle').text(),
list = current.find('ul'),
stack = [];