RobCaamano commited on
Commit
39a88b6
1 Parent(s): ff4a5b9

Update yt_download.py

Browse files
Files changed (1) hide show
  1. yt_download.py +3 -4
yt_download.py CHANGED
@@ -27,7 +27,7 @@ def download_youtube_video(video_url, download_captions=False):
27
 
28
  # Downloading video
29
  stream = yt.streams.get_highest_resolution()
30
- dwnld = stream.download(output_path='./downloads')
31
  if progress_bar:
32
  progress_bar.close()
33
 
@@ -43,11 +43,10 @@ def download_youtube_video(video_url, download_captions=False):
43
  else:
44
  print("No English captions found for this video.")
45
 
46
- return dwnld
47
-
48
  # Driver function
49
  def download_video(url, download_captions=False):
50
- video_path = download_youtube_video(url, download_captions)
 
51
  return video_path
52
 
53
  if __name__ == "__main__":
 
27
 
28
  # Downloading video
29
  stream = yt.streams.get_highest_resolution()
30
+ stream.download(output_path='./downloads')
31
  if progress_bar:
32
  progress_bar.close()
33
 
 
43
  else:
44
  print("No English captions found for this video.")
45
 
 
 
46
  # Driver function
47
  def download_video(url, download_captions=False):
48
+ video_path = './downloads/' + YouTube(url).streams.get_highest_resolution().default_filename
49
+ download_youtube_video(url, download_captions)
50
  return video_path
51
 
52
  if __name__ == "__main__":