Giter Site home page Giter Site logo

carlosflorencio / laracasts-downloader Goto Github PK

View Code? Open in Web Editor NEW
679.0 28.0 141.0 177 KB

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

Home Page: http://carlosflorencio.github.io/laracasts-downloader

License: MIT License

PHP 100.00%
laracasts downloader php laravel

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.

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.

You need an active subscription account to use this script.

Requirements

  • PHP >= 7.2
  • php-cURL
  • php-xml
  • php-json
  • Composer
  • FFmpeg (required if DOWNLOAD_SOURCE=vimeo)

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 your Laracasts account credentials (EMAIL, PASSWORD) in .env
  2. Decide whether you want to use vimeo or laracasts as DOWNLOAD_SOURCE. By using Laracasts link you are limited to 30 downloads per day and can't customize video quality.
  3. Choose your preferred quality (240p, 360p, 540p, 720p, 1080p, 1440p, 2160p) by changing VIDEO_QUALITY in .env. (will be ignored if DOWNLOAD_SOURCE=laracasts)
  4. 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
  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.

Options

Disable Scrapping

The script scraps each Laracasts pages and caches them to memories its latest state and stores them in Downloads/cache.php. If you already make sure this file is updated and do not want to experience impatience of scrapping; you can use --cache-only option.

php start.php --cache-only

Download specific 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 (NOT recommended):

$ php start.php -s "Series name example"
$ php start.php --series-name "Series name example"

Download specific episodes

You can provide episode number(s) separated by comma ,:

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

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

$ php start.php -s "nuxtjs-from-scratch" -e "12,15" -s "laravel-from-scratch" -e "5"

It will download episode 12 and 15 for "nuxtjs-from-scratch" and episode 5 for "laravel-from-scratch" course.

$ php start.php -s "nuxtjs-from-scratch" -e "12,15" -s "laravel-from-scratch"

It will download episode 12 and 15 for "nuxtjs-from-scratch" course and all episodes for "laravel-from-scratch" course.

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

agarzon avatar amirrezam75 avatar aniruddh-j avatar antoineaugusti avatar antonkomarev avatar bassel avatar billyct avatar carlosflorencio avatar devsarry avatar fmulyono avatar fselias avatar insign avatar jsawo avatar leorossi avatar mark1282 avatar mattias avatar meeshalk avatar mul14 avatar othyn avatar vinicius73 avatar willvincent 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

laracasts-downloader's Issues

cannot play video

Hi, after some lessons downloaded,I tried to play in vlc , but it looks like it cannot play the video, the vlc will get error. or do I need to wait to download all the 600 lessons so that I can play the video ?

Thank you in advance

Metadata

Would it be possible to download the lesson metadata, i.e. synopsis, etc... and embed it into the video file?

Had to run with sudo

I assume it's an issue because the Readme does not mention execution with SUDO. This is what happens when running without SUDO using PHP7 in Ubuntu 16.04:
screenshot

The script works when running with SUDO

No download button

Hello, some videos returns "No download button"

There are some old videos hosted on Wistia, i managed to find a way to download those too.

If you want i can make a pull request later with the modification.

New videos updater

Hello!, I just wanted to thanks fot such an amazing tool!, you saved me a lot of time downloading the videos!

Is there a way that we can set the system to check when there are new videos available?

Thanks

Server Error 500

Hello, guys.
It just comes up errors like this:

laracasts-downloader git:(master) ✗ php start.php

====================================
Starting Collecting the data
====================================
ERROR: Server error response [url] https://laracasts.com/lessons/?page=6 [status code] 500 [reason phrase] Internal Server Error%

And the error page changes. Could anybody tell why?

Thank you very much!

[Question] Problem Sync

Hi,

First thunk you for this package, very useful,

I have a small question, I have some series downloaded directly from my server, because I installed laracasts-downloader on my server, and I pulled the series to local, now I want to sync the series, so I installed the package on local, but still download the series,

I have Lessons folder with Series, may be this is the problem

Thanks

image

Dont work anymore

Hi I try to use the script, download some files, but dont play with media player, the whole folder size its around 4 mb! only. when open the mp4 file with wordpad I notice that no its a video, its a html file with info inside like this>
`

<title>The Best Laravel and PHP Screencasts</title> <script src="/js/lib/wow.min.js"></script> <script>new WOW({ mobile: false }).init();</script> <script> window.LARACASTS = {"signedIn":false,"csrfToken":"OPVYa3JPQW7Mrs4C02YUoqzHrZXOplPooTkHYgBx","stripeKey":"pk_live_42cAcd2OvCDs4hpErd5ZscBT","user":null}; </script> <script id="flash-template" type="text/template">
</script>

It's Kinda Like Netflix for Your Career!

Learn practical, modern web development, through expert screencasts. Most video tutorials are boring. These aren't. Ready to binge?

Laravel Skill

Laravel

  • 15 Series
  • 710 Videos
PHP Skill

PHP

  • 13 Series
  • 304 Videos
Testing Skill

Testing

  • 5 Series
  • 79 Videos
JavaScript Skill

JavaScript

  • 6 Series
  • 238 Videos
Tooling Skill

Tooling

  • 10 Series
  • 268 Videos

The most concise screencasts for the working developer, updated daily.

The secret sauce for Laracasts is a simple one. No slides. No scripts. Just Sublime. As a visual learner, I'd often find myself watching video tutorials and falling asleep. There's only so many diagrams and bullet lists that one person can get through!

When launching Laracasts in 2013, I made a point to, at all times, keep the focus on, not academic theory, but real-life code and workflow.

Show More

Plenty of educational resources will teach you how to make a website. But what about those of us who already do that full-time, every single day? Where do we go to further our education? If ever there was a field that required nonstop learning, programming is certainly it.

Laracasts is the defacto educational resource specifically for working developers building the web with PHP and JavaScript. It's kinda like Netflix for your career!

Invest in Yourself

Thousands of developers up their game with Laracasts every day.

“Who is this Laracasts guy, and why should I trust him?” It's a fair enough question! Would hundreds upon hundreds of glowing endorsements help?

Countless Testimonials
Taylor Otwell

Laracasts is insane!

Taylor Otwell Laravel
Ian Landsman

Really, Laracasts is totally off the hook. Jeffrey Way is an amazing teacher.

Ian Landsman Userscape
Dries Vints

Probably the most "must-watch" web development screencasts on the internet.

Dries Vints Beatswitch
Eric Barnes

Laracasts is the premier learning tool for Laravel. The tutorials are always concise and relevant. If you use Laravel, subscribing is a must!

Eric Barnes Userscape
Chris Fidao

Even when developing something I "know," I review Laracasts on the topic. There's always something new Jeff talks about, even if it's just a different point of view.

Chris Fidao Userscape
Ricardo Fuhrmann

The best resource to learn Laravel! Jeffrey did an amazing job. This was exactly what was missing for the community.

Ricardo Fuhrmann
Ionut Tanasa

Laracasts was the missing piece in learning Laravel. Yeah there were some series on other websites, but none of them was at this level.

Ionut Tanasa
Tolu Olowu

Jeffrey is simply a one-of-a-kind tutor - teaching is obviously his calling. Laravel and Laracasts, twice as nice!!

Tolu Olowu
Alejandro Sanabria

The next level for learning Laravel!

Alejandro Sanabria

Choose a plan that fits your needs.

Joining takes less than a minute, and, if your peers are correct, is a pretty dang good decision. If you're still on the fence, we have a plan called “monthly� - and it’s not like the gym. Seriously - you can cancel in five seconds, if this isn't for you.

Monthly

$ 9

Still undecided? Ease in with a monthly plan that can be canceled in ten seconds.

Yearly

$ 86

This is your career we're talking about. Go all in, and save 20% off the monthly rate.

Forever

$ 350

We get it. Not everyone loves subscriptions. Pay once, and access Laracasts forever.

Teams

$ 300

Follow in the steps of thousands of companies who have elevated their teams to the next level.

There's a chance you may already know me! A veteran in the PHP community, I am a co-host on the official Laravel podcast, have written successful books, built popular packages, contributed to many open-source projects, spoken at every Laracon conference, been a guest on countless podcasts (including PHP Town Hall, Shop Talk, No Capes, and Full Stack Radio), and have contributed to the largest web dev magazines in the world.

And if I may be so bold, I'm really good at teaching this stuff. You won't find boring, sleep-inducing slides and diagrams anywhere on this site. No, here, we're entirely focused on the code - just like we're sitting next to each other.

Buy me the equivalent of lunch once a month, and I'll teach you everything I know about this business.

Want us to email you occasionally with Laracasts news?

Laracasts

Lots of your peers think Laracasts is one of the best things ever. So buy Jeffrey lunch once a month, see for yourself, and massively level up your skills in the process.

© Laracasts 2017. All rights reserved. Yes, all of them. That means you, Todd.
Proudly hosted with Laravel Forge and DigitalOcean.
<script src="https://cdn.jsdelivr.net/algoliasearch/3/algoliasearch.min.js"></script> <script src="https://cdn.jsdelivr.net/autocomplete.js/0/autocomplete.min.js"></script> <script> (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]= function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date; e=o.createElement(i);r=o.getElementsByTagName(i)[0]; e.src='//www.google-analytics.com/analytics.js'; r.parentNode.insertBefore(e,r)}(window,document,'script','ga')); ga('create','UA-44120322-1'); </script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script src="/js/manifest.js?id=173"></script> <script src="/js/vendor.js?id=173"></script> <script src="/js/all.min.js?v=176"></script> <script> ga('send', 'pageview'); $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': LARACASTS.csrfToken } }); </script> <script> </script> `

Not all episodes were retrieved

Hello,
I'm not sure if this is a problem with the Downloader, but I just tried downloading Let's build a forum with Laravel.
Apparently only 67 out of 70 episodes were found.
170824_download_episodes

used: php start.php -s "lets-build-a-forum-with-laravel" for downloading

Also just double checked with Professional PHP Workflow....
Here only 6 out of 11 episodes were found.
170824_download_episodes2

used: php start.php -s "professional-php-workflow-in-sublime-text"

Regards!

File numbering problem

Hi, Thanks for this nice package. However I was facing a small difficulty. The videos in lessons forlder are numbered in descending order. But when there is problem in one video, and I restart it, the numbering order changes completely. Now I have downloaded many videos and some of them were corrupt and I deleted them. Now when I try to download them, the program can't identify any new videos.

Downloading home page HTML content (~70 kB)

Firstly I'd like to thank you for providing such a tool for us.

I'm currently using it with Docker and I've followed the instructions in the README.md file. Yet the script outputs the following for all files:

> Download started: how-to-use-gzipping-to-decrease-file-sizes-by-seventy-five-percent . . . . Saving on lessons folder.
> Can't download this lesson! :( No download button
> Tring to find a Wistia.net video
> Elapsed time: 315ms, Memory: 4.00Mb         
> Current: 1 of 213 total. Left: 212

It ends up downloading the home page HTML content (a file with a size of 70 kB - give or take).

I have an active subscription, by the way.

Error on download

Hello King 👍

Problem here when downloading I get a error like this,

ERROR: cURL error 18: transfer closed with 41717430 bytes remaining to read

Take note that I'm downloading > Current: 43 of 217 total. Left: 174

So the next file name should be 0174-*

But if I do php start.php the next file to be download gets the name 0260-*

How can I resolve this?

SLL error: cURL error 35

I have a problem.. with php7.0.8
The log:

====================================
Authenticating

Successfull!

====================================
Starting Collecting the data

====================================
Checking for options []

No options provided

====================================
Downloading

0 new lessons and 24 episodes. 9.626s elapsed with 6.00Mb of memory usage.

====================================
Downloading Series

Download started: 17 - How Do I Impersonate Users . . . . Saving on series/how-do-i folder.
Total: 0% Downloaded: 0 B of 0 B
Retry download after connection fail!
Total: 0% Downloaded: 0 B of 0 B
Retry download after connection fail!
Total: 0% Downloaded: 0 B of 0 B
Retry download after connection fail!
ERROR: cURL error 35: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version%

Auth Issue

When running the script I received the message 'Your login details are wrong'. Upon inspection it turns out the issue was a special character in my password.

The line:

"$options = parse_ini_file('config.ini');" in boostrap.php was returning the password field as an empty string in the array because of this.
I know this is down to parse_ini_file not liking special characters, but I was wondering if there was a solution for anyone else who comes across this issue.

failed to open stream: No such file or directory

Starting Collecting the data

216 new lessons and 496 episodes. 5.841s elapsed with 3.25Mb of memory usage.

Authenticating

Successfull!

Downloading Lessons

Download started: prevent-spam-with-recaptcha . . . . Saving on lessons folder.
ERROR: Unable to open ./lessons/0216-prevent-spam-with-recaptcha.mp4 using mode r+: fopen(./lessons/0216-prevent-spam-with-recaptcha.mp4): failed to open stream: No such file or directory

Wrong episode download

After first initial download, a video is downloaded into a wrong folder. So for example the series laravel-5-from-scratch contains a video(01-Initial Setup.mp4) which originally belongs to another series(I think its the build project flyer with me series).

I was not able to solve the problem by simply deleting the wrong file and them redownload it.

I'm also not sure if this happens for other episodes too.

can we put in content into specific directory?

so let's say I want do download everything for offline usage, can we auto sync into different directories series wise?

BTW: I liked your terminal style info in your gh-pages webpage 👍

Downloaded files are just 94KB and do not contain video content

Hey,

my downloaded files are just 94KB and do not contain video content? I run the command
php start.php -s "learn-vue-2-step-by-step"
it lists all 30 sessions and downloads them to my local folder. But they are too small and do not contain video content.

Any idea?

Cheers, Max

I attached the terminal output.
output.txt

Offset option

Hello! Thanks for a good tool for downloading laracasts series!

Is there an option or a way to set offset for downloading a series?
For example i have to download a series starting from second or third lesson.

Thanks.

ignore this

nevermind.. I am an idiot. I had copied .env.example to .env but had only put the right username/password in the .env.example =/

However.. this did detect one bug.. it shows

====================================
Authenticating
====================================
> Successfull!

even with wrong info.. in this case the defaults
EMAIL=test.com
PASSWORD=password

Incorrect episode name

When grabbing an episode:
I get this in the console:

Download started: 08 - Custom Components 101 New . . . . Saving on series/learning-vue-step-by-step folder.

The file is then named:
08-Custom Components 101 New.mp4

Except that little problem, the downloader is working great with the new layout.
Thanks for your hard work.

Series not downloaded correctly

Hi,

i have been trying to download the latest episodes of a laracasts series but for some reason it doesn't work.

> Download started: 70 - Thread Views Design 3 - KISS . . . . Saving on series/lets-build-a-forum-with-laravel folder.
> Can't download this lesson! :( No download button
> Tring to find a Wistia.net video
> Elapsed time: 147ms, Memory: 4.00Mb
> Current: 6 of 6 total. Left: 0

A 70K file is downloaded instead.

-rw-r--r-- 1 root root  70K Aug 22 21:57 70-Thread Views Design 3 - KISS.mp4

I am using a valid laracasts premium account. Any idea why that's the case? Any help is appreciated.

videos broken

Edit:

When I try to resume the download, the last video is broken.

[email protected] PASSWORD=xxx LOCAL_PATH=Downloads LESSONS_FOLDER=lessons SERIES_FOLDER=series TIMEZONE=America/Caracas RETRY_DOWNLOAD=true

not picking up latest episode

Just ran a download.. this is the bash file I use to download all the latest videos on all series I'm watching

#!/usr/bin/env bash

series='
-s "professional-php-workflow-in-sublime-text"
-s "whats-new-in-laravel-5-5"
-s "laravel-from-scratch-2017"
-s "learn-vue-2-step-by-step"
-s "php-for-beginners"
-s "whatcha-working-on"
-s "whats-new-in-laravel-5-4"
-s "whats-new-in-php-7-1"
-s "how-do-i"
-s "lets-build-a-forum-with-laravel"
-s "php-bits"
-s "git-me-some-version-control"
'

php start.php ${series}

it picked up a few new videos and all seemed to work fine

except there's an oddity.. the whatcha-working-on series has a 24th episode and it's not downloading it.. there's only 23 in the folder.. the 24th is watchable and released but it's not being picked up as of right now.. any idea why ?

Add ability to retry download

Sometimes on bad internet connection download is interrupting:

ERROR: cURL error 7: Failed to connect to laracasts.com port 443: Network is unreachable

or

ERROR: cURL error 6: Could not resolve host: 10-lvl3-pdl.vimeocdn.com

It will be great to have RETRY_COUNT in config, by default is 1. If value is greater than 1 it will retry download process on these cURL errors without interrupting all the process. Or have an ability to launch start.php with --retry flag.

failed to open stream: No such file or directory

I've setup your script like written in the README.
But no matter where i set the download folder or as which user ever i execute it, the script always returns the attached error.

root@debian:~/laracasts-downloader# php start.php

Starting Collecting the data

209 new lessons and 296 episodes. 17.904s elapsed with 3.25Mb of memory usage.

Authenticating

Successfull!

Downloading Lessons

Download started: email-verification-in-laravel . . . . Saving on lessons folder.
ERROR: Unable to open /path_to_folder/laracast/lessons/0001-email-verification-in-laravel.mp4 using mode r+: fopen(/path_to_folder/laracast/lessons/0001-email-verification-in-laravel.mp4): failed to open stream: No such file or directory

Any idea whats going wrong?
Thanks for support!

size of videos not actual, only 70kb

I'm was sucessfullly to download videos series "Learn Vue 2: Step By Step".

> Download started: 33 - Scoped Slots . . . . Saving on series/learn-vue-2-step-by-step folder.
> Elapsed time: 465ms, Memory: 4.00Mb         
> Current: 33 of 33 total. Left: 0
> Finished! Downloaded 0 new lessons and 33 new episodes. Failed: 0

but, size of video only 70,7 kb..



what's happen??

New website layout breaks downloader

I think the redesing broke your downloader. I am getting the following error:
***Notice: Undefined index: series in D:\Laracasts\laracasts-downloader\App\Utils\U
tils.php on line 85

Warning: Invalid argument supplied for foreach() in D:\Laracasts\laracasts-downl
oader\App\Utils\Utils.php on line 85

Notice: Undefined index: lessons in D:\Laracasts\laracasts-downloader\App\Utils
Utils.php on line 101

Warning: array_diff(): Argument #1 is not an array in D:\Laracasts\laracasts-dow
nloader\App\Utils\Utils.php on line 101


videos are downloading descending order

Your library is cool for user like me, who have limited internet speed. How ever when I start downloading a series, videos are downloading descending order, I mean last video of the series is downloading first. I don't know is it a bug or not? It will be better if you can make it downloading ascending order.

Bug in Mac/Mamp

Hello,

I worked with archlinux, php7 ...etc it worked fine now I'm with:
Os : Mac sierra
MAMP : Php 7.1

when I run in console : php start.php I get nothing, I tried in browser I get : Fatal error: Uncaught League\Flysystem\Exception: Impossible to create the root directory "". in /Users/mac/code/laracasts-downloader/vendor/league/flysystem/src/Adapter/Local.php:106 Stack trace: #0 /Users/mac/code/laracasts-downloader/vendor/league/flysystem/src/Adapter/Local.php(78): League\Flysystem\Adapter\Local->ensureDirectory(false) #1 /Users/mac/Code/laracasts-downloader/start.php(14): League\Flysystem\Adapter\Local->__construct(false) #2 {main} thrown in /Users/mac/code/laracasts-downloader/vendor/league/flysystem/src/Adapter/Local.php on line 106

Why this issue ?

Downloaded was not playing.

I was downloading using command { php start.php -s "Series name example" -s "series-slug-example" }
(without curly brackets ) then it says that download was completed, but when i try to play the .mp4 files it was not playing.

Thank's!

laracasts refresh

Laracasts brings a refresh today and laracasts-downloader doesn't work.
Hope there's a new release soon,thank you :)

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.