downlad into temp folder then move to out folder when done, temp replace with my fork until upstream PR is merged

This commit is contained in:
2026-02-12 23:26:08 -05:00
parent bd643344ef
commit a2a0aabb3a
5 changed files with 28 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ import (
)
// startAsyncDownload initiates a download in a goroutine and handles progress updates
func startAsyncDownload(s *discordgo.Session, i *discordgo.InteractionCreate, url, videoFormatID, audioFormatID, outputDir string) {
func startAsyncDownload(s *discordgo.Session, i *discordgo.InteractionCreate, url, videoFormatID, audioFormatID, outputDir, tempDir string) {
progressChan := make(chan ProgressUpdate, 1)
resultChan := make(chan DownloadResult, 1)
@@ -29,7 +29,7 @@ func startAsyncDownload(s *discordgo.Session, i *discordgo.InteractionCreate, ur
}()
// Call DownloadVideo (it panics on error instead of returning error)
DownloadVideo(outputDir, url, DownloadOptions{
DownloadVideo(outputDir, tempDir, url, DownloadOptions{
EmbedThumbnail: true,
IncludeSubtitles: true,
VideoFormatID: videoFormatID,