Closed ipkpjersi closed 4 years ago
downloading in 1kb @hakanersu
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?");
}
no i didn`t check that ok wait i change that btw thanks for help
On Thu, Apr 4, 2019 at 12:48 PM Hakan ERSU notifications@github.com wrote:
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?"); }
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hakanersu/codecourse-downloader/issues/29#issuecomment-479780291, or mute the thread https://github.com/notifications/unsubscribe-auth/AI-sGI8MpUpzY9yigflt9wcELK0GC5Vaks5vdadLgaJpZM4Zga7a .
I can make it stop when $dl_total_size
is 1kb or skip.
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.
@ralbear I am appreciated any pr.
That's my plan, now lets see if i have a moment to do that! 😄
it must be fixed with latest update.
Hello,
Snippet videos do not seem to be downloading properly:
Thanks.