Downloads new lessons and series from laracasts if there are updates. Or the whole catalogue.
This is working as of 2020-02-09
, although you are rate limited to 30 downloads every 24 hours.
Syncs your local folder with the laracasts website, when there are new lessons the app download it for you. If your local folder is empty, all lessons and series will be downloaded!
A .skip file is used to prevent downloading deleted lessons for these with space problems. Thanks to @vinicius73
Just call php makeskips.php
before deleting the lessons.
Even to download free lessons or series. The download option is only allowed to users with a valid subscription.
- PHP >= 5.4
- php-cURL
- php-xml
- php-json
- Composer
OR
- Docker
- Clone this repo to your local machine.
- Make a local copy of the
.env
file:
$ cp .env.example .env
- Update the
.env
with your login and API information. To obtain this, do the following:- Go to laracasts.com and navigate to the Browse page.
- Open your browsers Dev Tools and open the Network tab, then refresh the page.
- Find an XHR request to
algolia.net
and look at the request URL. - Within the URL, find the GET parameters:
- Copy the
x-algolia-application-id
value toALGOLIA_APP_ID
in.env
. - Copy the
x-algolia-api-key
value toALGOLIA_API_KEY
in.env
.
- Copy the
- The next steps, choose if you want a local installation or a Docker based installation and follow along.
- Install project dependencies:
$ composer install
- To run a download of all content, run the following command:
$ php start.php [empty for all OR provide flags]
- See downloading specific series or lessons for optional flags.
- Build the image:
$ docker-compose build
- Install project dependencies:
$ docker-compose run --rm composer
- Then, run the command of your choice as if we were running it locally, but instead against the docker container:
$ docker-compose run --rm laracastdl php ./start.php [empty for all OR provide flags]
- See downloading specific series or lessons for optional flags.
Also works in the browser, but is better from the cli because of the instant feedback.
- You can use series and lessons names
- You can use series and lessons slugs (preferred because there are some custom slugs too)
- You can download multiples series/lessons
You can either use the Series slug (preferred):
$ php start.php -s "series-slug-example"
$ php start.php --series-name "series-slug-example"
Or the Series name:
$ php start.php -s "Series name example"
$ php start.php --series-name "Series name example"
You can either use the Lessons slug (preferred):
$ php start.php -l "lesson-slug-example"
$ php start.php --lesson-name "lesson-slug-example"
Or the Lesson name:
$ php start.php -l "Lesson name example"
$ php start.php --lesson-name "Lessons name example"
If you have a cURL error 60: SSL certificate problem: self signed certificate in certificate chain
or SLL error: cURL error 35
do this:
- Download http://curl.haxx.se/ca/cacert.pem
- Add
curl.cainfo = "PATH_TO/cacert.pem"
to your php.ini
And you are done! If using apache you may need to restart it.
This library is under the MIT License, see the complete license here