Git Product home page Git Product logo

laracasts-downloader's Introduction

Laracasts Downloader

Join the chat at https://gitter.im/laracasts-downloader SensioLabsInsight Scrutinizer Code Quality Build Status

Downloads new lessons and series from laracasts if there are updates. Or the whole catalogue.

Currently looking for maintainers.

LIMITED FUNCTIONALITY NOTE:

Due to recent changes in the structure of the series page, it is no longer possible to fetch the full catalog of lessons and series. Between a lengthy (unknown) delay on algolia indexing, and incomplete list of content on the series page, ability to download is severely hindered.

Description

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.

An account with an active subscription is necessary!

Even to download free lessons or series. The download option is only allowed to users with a valid subscription.

Requirements

  • PHP >= 5.4
  • php-cURL
  • php-xml
  • php-json
  • Composer

OR

  • Docker

Installation

  1. Clone this repo to your local machine.
  2. Make a local copy of the .env file:
$ cp .env.example .env
  1. 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 to ALGOLIA_APP_ID in .env.
      • Copy the x-algolia-api-key value to ALGOLIA_API_KEY in .env.
  2. The next steps, choose if you want a local installation or a Docker based installation and follow along.

Using your local machine

  1. Install project dependencies:
$ composer install
  1. To run a download of all content, run the following command:
$ php start.php [empty for all OR provide flags]
  1. See downloading specific series or lessons for optional flags.

Using Docker

  1. Build the image:
$ docker-compose build
  1. Install project dependencies:
$ docker-compose run --rm composer
  1. 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]
  1. 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.

Downloading specific series or lessons

  • 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

Commands to download an entire series

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"

Filter to download specific episodes of a series

You can provide episode number(s) saperated by comma ,: You can add 1 or more episodes.

$ php start.php -s "lesson-slug-example" -e "12,15"
$ php start.php --series-name "series-slug-example" --series-episodes "12,15"

Or the with Series name:

$ php start.php -s "Series name example" -e "12"
$ php start.php --series-name "Series name example" --series-episodes "12"

This will only download episodes which you mentioned in -e or --series-episodes flag, it will also ignor already downloaded episodes as usual.

Command to download specific lessons

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"

Troubleshooting

If you have a cURL error 60: SSL certificate problem: self signed certificate in certificate chain or SLL error: cURL error 35 do this:

And you are done! If using apache you may need to restart it.

License

This library is under the MIT License, see the complete license here

laracasts-downloader's People

Contributors

carlosflorencio avatar othyn avatar willvincent avatar agarzon avatar mark1282 avatar mattias avatar fmulyono avatar meeshalk avatar billyct avatar vinicius73 avatar aniruddh-j avatar antoineaugusti avatar bassel avatar insign avatar jsawo avatar leorossi avatar mul14 avatar antonkomarev avatar

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.