diff --git a/.env b/.env index c8b61ce..4013de1 100755 --- a/.env +++ b/.env @@ -34,10 +34,10 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 ###> LISTMONK/API ### LISTMONK_BASE_URL=https://listmonk.powerpme.com -LISTMONK_API_USER= -LISTMONK_TOKEN= +LISTMONK_API_USER=MaherAPI +LISTMONK_TOKEN=BVqvuHgU3N1qstEiLeWM9Ocv9b5jSYaS ###> LISTMONK/API ### ###> monolog/mattermost ### -MATTERMOST_WEBHOOK_URL=https://mattermost.powerpme.com/hooks/ +MATTERMOST_WEBHOOK_URL=https://mattermost.powerpme.com/hooks/anc9zweugj8fprj1zifdxy6m7e ###< monolog/mattermost ### \ No newline at end of file diff --git a/public/downloader/anonyme/EKHotxqUvbo.webm b/public/downloader/anonyme/EKHotxqUvbo.webm new file mode 100644 index 0000000..7eb6887 Binary files /dev/null and b/public/downloader/anonyme/EKHotxqUvbo.webm differ diff --git a/public/downloader/user/1/hVCjJS1Kof4.webm b/public/downloader/user/1/hVCjJS1Kof4.webm new file mode 100644 index 0000000..252a59a Binary files /dev/null and b/public/downloader/user/1/hVCjJS1Kof4.webm differ diff --git a/src/Controller/Backend/TestController.php b/src/Controller/Backend/TestController.php index 3225265..61f8b84 100644 --- a/src/Controller/Backend/TestController.php +++ b/src/Controller/Backend/TestController.php @@ -12,6 +12,8 @@ use Symfony\Component\Routing\Attribute\Route; use Psr\Log\LoggerInterface; +use Symfony\Component\Process\Process; + #[Route('/admin/test')] final class TestController extends AbstractController { @@ -63,4 +65,26 @@ final class TestController extends AbstractController return $this->render('/frontend/test.html.twig', []); } + + #[Route('/url', name: 'app_test_url')] + public function url() + { + $process = new Process([ + 'yt-dlp', + '--print', + '%(title)s|%(filesize,filesize_approx)s', + '--', // 🛡️ Protection cruciale contre l'injection d'arguments + 'https://www.youtube.com/watch?v=Z8hhP38-4Eg' + ]); + + $process->run(); + + //dd($process->getOutput()); + if (!$process->isSuccessful()) { + echo $process->getCommandLine() . "
" . $process->getErrorOutput(); + die; + return new Response("error1", Response::HTTP_INTERNAL_SERVER_ERROR); + } + } + // } diff --git a/src/Entity/User.php b/src/Entity/User.php index 72d9bfc..ae0511d 100755 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -9,9 +9,12 @@ use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; use Symfony\Component\Security\Core\User\UserInterface; +use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; +use Symfony\Component\Validator\Constraints as Assert; -#[ORM\Entity(repositoryClass: UserRepository::class)] #[ORM\Table(name: '`user`')] +#[ORM\Entity(repositoryClass: UserRepository::class)] +#[UniqueEntity(fields: ['email'], message: 'There is already an account with this email.')] class User implements UserInterface, PasswordAuthenticatedUserInterface { #[ORM\Id] @@ -20,6 +23,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface private ?int $id = null; #[ORM\Column(length: 180, unique: true)] + #[Assert\Email] private ?string $email = null; #[ORM\Column]