Moved video files to public/videos directory, small refactoring.

This commit is contained in:
Krzysztof Płaczek
2023-03-30 12:46:30 +02:00
parent 5902bf7c2b
commit 5784cf8ed3
10 changed files with 42 additions and 41 deletions

View File

@@ -18,11 +18,8 @@ class SymfonyCastDlService
'base_uri' => config('symfonycast.base_url'),
'cookies' => true
]);
$response = $this->client->get('login');
$token = $htmlParser->getCsrfToken($response);
$this->client->post('login', [
'form_params' => [
'email' => config('symfonycast.login'),
@@ -38,7 +35,6 @@ class SymfonyCastDlService
public function getInfo(): void
{
$coursePage = $this->client->get('courses/filtering');
$courses = $this->htmlParser->getCourses($coursePage);
$courses->each->save();
/** @var Course $course */
@@ -68,7 +64,7 @@ class SymfonyCastDlService
return;
}
if (!is_dir($chapter->directory_path)) {
mkdir($chapter->directory_path);
mkdir(directory: $chapter->directory_path, recursive: true);
}
if (!$chapter->is_video_file) {
$this->client->request(