learningai commited on
Commit
aaed919
·
1 Parent(s): 85f0d62

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +2 -1
utils.py CHANGED
@@ -4,6 +4,7 @@ from logger import logging
4
  from typing import Optional
5
  import whisper
6
  import config
 
7
 
8
 
9
  def get_video_from_yt(video_url : str, save_file_dir : str, video_name : str="yt_audio") -> Optional[Path]:
@@ -18,7 +19,7 @@ def get_video_from_yt(video_url : str, save_file_dir : str, video_name : str="yt
18
  # create directory if not exists
19
  os.makedirs(save_file_dir, exist_ok=True)
20
 
21
- filepath = f"{save_file_dir}/{video_name}"
22
 
23
  # download the file
24
  os.system(f'yt-dlp --quiet -o {filepath} -x --audio-format "wav" {video_url}')
 
4
  from typing import Optional
5
  import whisper
6
  import config
7
+ from datetime import datetime
8
 
9
 
10
  def get_video_from_yt(video_url : str, save_file_dir : str, video_name : str="yt_audio") -> Optional[Path]:
 
19
  # create directory if not exists
20
  os.makedirs(save_file_dir, exist_ok=True)
21
 
22
+ filepath = f"{save_file_dir}/{video_name}_{datetime.now().strftime('%d%m%Y__%H%M%S')}"
23
 
24
  # download the file
25
  os.system(f'yt-dlp --quiet -o {filepath} -x --audio-format "wav" {video_url}')