Coder Social home page Coder Social logo

Comments (8)

hakanersu avatar hakanersu commented on June 20, 2024 1

it must be fixed with latest update.

from codecourse-downloader.

sagar3506 avatar sagar3506 commented on June 20, 2024

image
downloading in 1kb @hakanersu

from codecourse-downloader.

hakanersu avatar hakanersu commented on June 20, 2024

Can you change this lines to https://github.com/hakanersu/codecourse-downloader/blob/master/src/App.php#L121-L142

try {
                            $url = $this->remote->getRedirectUrl($lesson->link);

                            $this->remote->web->request('GET', $url, [
                                'sink' => $sink,
                                'progress' => function ($dl_total_size, $dl_size_so_far, $ul_total_size, $ul_size_so_far) use ($progressBar, $courseTitle, $lesson) {
                                    $total = \ByteUnits\bytes($dl_total_size)->format('MB');
                                    $sofar = \ByteUnits\bytes($dl_size_so_far)->format('MB');
                                    $percentage = $dl_total_size != '0.00' ? number_format($dl_size_so_far * 100 / $dl_total_size) : 0;
                                    $progressBar->setMessage("Downloading ({$courseTitle}): {$lesson->title} {$sofar}/{$total} ({$percentage}%)", 'status');
                                    // It takes too much time to figure this line. Without advance() it was not update message.
                                    // With  this method i can update message.
                                    $progressBar->display();
                                },
                            ]);
                        } catch (\Exception $e) {
                            //error("Cant download '{$lesson->title}'. Do you have active subscription?");
                            dd($e->getMessage());
                            continue;
                        } catch (GuzzleException $e) {
                            dd($e->getMessage());
                            continue;
                            //error("Cant download '{$lesson->title}'. Do you have active subscription?");
                        }

from codecourse-downloader.

sagar3506 avatar sagar3506 commented on June 20, 2024

from codecourse-downloader.

hakanersu avatar hakanersu commented on June 20, 2024

I can make it stop when $dl_total_size is 1kb or skip.

from codecourse-downloader.

ralbear avatar ralbear commented on June 20, 2024

I have a problem with snippets as well but now, in my case, any file was downloaded. The process skip the file directly without any error only:

All videos downloaded for course: cleanly-iterating-over-javascript-objects
   0/0  [>---------------------------]   0%

The snippets have a different page, so i guest the problem came from there.

I will work in a PR when i have a bit of time.

from codecourse-downloader.

hakanersu avatar hakanersu commented on June 20, 2024

@ralbear I am appreciated any pr.

from codecourse-downloader.

ralbear avatar ralbear commented on June 20, 2024

That's my plan, now lets see if i have a moment to do that! 😄

from codecourse-downloader.

Related Issues (20)

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.