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:
@@ -15,12 +15,17 @@ import (
|
||||
func main() {
|
||||
|
||||
out_dir := os.Getenv("OUT_PATH")
|
||||
temp_dir := os.Getenv("TEMP_PATH")
|
||||
bot_token := os.Getenv("DISCORD_TOKEN")
|
||||
|
||||
if out_dir == "" {
|
||||
panic("No output dir specified")
|
||||
}
|
||||
|
||||
if temp_dir == "" {
|
||||
panic("No temp dir specified")
|
||||
}
|
||||
|
||||
s, err := discordgo.New("Bot " + bot_token)
|
||||
if err != nil {
|
||||
log.Fatalf("Invalid bot parameters: %v", err)
|
||||
@@ -248,7 +253,7 @@ func main() {
|
||||
go func() {
|
||||
// Small delay to ensure response is sent first
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
startAsyncDownload(s, i, state.URL, state.VideoFormatID, state.AudioFormatID, out_dir)
|
||||
startAsyncDownload(s, i, state.URL, state.VideoFormatID, state.AudioFormatID, out_dir, temp_dir)
|
||||
}()
|
||||
|
||||
// Clean up state after starting download
|
||||
|
||||
Reference in New Issue
Block a user