diff --git a/src/main/java/com/example/video_downloader/VideoDownloaderApplication.java b/src/main/java/com/example/video_downloader/VideoDownloaderApplication.java index 3b61d97..68beb82 100644 --- a/src/main/java/com/example/video_downloader/VideoDownloaderApplication.java +++ b/src/main/java/com/example/video_downloader/VideoDownloaderApplication.java @@ -7,7 +7,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; public class VideoDownloaderApplication { public static void main(String[] args) { - SpringApplication.run(VideoDownloaderApplication.class, args); } } diff --git a/src/main/java/com/example/video_downloader/controllers/VideoController.java b/src/main/java/com/example/video_downloader/controllers/VideoController.java index 86682cd..404546e 100644 --- a/src/main/java/com/example/video_downloader/controllers/VideoController.java +++ b/src/main/java/com/example/video_downloader/controllers/VideoController.java @@ -5,13 +5,10 @@ import com.example.video_downloader.entity.Video; import com.example.video_downloader.services.VideoService; import lombok.Data; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import org.springframework.web.server.ResponseStatusException; import java.util.List; -import java.util.Optional; @RestController @RequestMapping(path="/video") @@ -22,7 +19,7 @@ public class VideoController { private VideoService videoService; @Data - private class Response { + private static class Response { private Long id; } diff --git a/src/main/java/com/example/video_downloader/dto/SaveNewVideoRequest.java b/src/main/java/com/example/video_downloader/dto/SaveNewVideoRequest.java index bfdf986..ccde4d8 100644 --- a/src/main/java/com/example/video_downloader/dto/SaveNewVideoRequest.java +++ b/src/main/java/com/example/video_downloader/dto/SaveNewVideoRequest.java @@ -5,4 +5,5 @@ import lombok.Data; @Data public class SaveNewVideoRequest { private String url; + } diff --git a/src/main/java/com/example/video_downloader/services/ProcessService.java b/src/main/java/com/example/video_downloader/services/ProcessService.java index 9954489..ecec741 100644 --- a/src/main/java/com/example/video_downloader/services/ProcessService.java +++ b/src/main/java/com/example/video_downloader/services/ProcessService.java @@ -1,6 +1,8 @@ package com.example.video_downloader.services; +import com.example.video_downloader.repositories.VideoRepository; import jakarta.annotation.PostConstruct; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.io.IOException; @@ -9,9 +11,12 @@ import java.nio.charset.StandardCharsets; @Service public class ProcessService { - @PostConstruct + @Autowired + private VideoRepository videoRepository; + + //@PostConstruct public void init() throws InterruptedException, IOException { - execute("yt-dlp", ""); + execute("yt-dlp", "youtube:player_client=android", ""); } public void execute(String... command) throws InterruptedException, IOException {