kwmr commited on
Commit
1d5e8ba
1 Parent(s): 7d76a49
Files changed (1) hide show
  1. utils.py +5 -0
utils.py CHANGED
@@ -18,6 +18,11 @@ def get_youtube(video_url, local_id, db):
18
  log_firestore(db, local_id=str(local_id), action='DV', url=str(video_url))
19
  print("Start download video")
20
  yt = YouTube(video_url)
 
 
 
 
 
21
  abs_video_path = yt.streams.filter(progressive=True, file_extension='mp4').order_by('resolution').desc().first().download(filename='download.mp4', output_path='movies/')
22
  print("Success download video")
23
  print(abs_video_path)
 
18
  log_firestore(db, local_id=str(local_id), action='DV', url=str(video_url))
19
  print("Start download video")
20
  yt = YouTube(video_url)
21
+
22
+ video_length = yt.length
23
+ if video_length > 180:
24
+ video_url = "https://www.youtube.com/watch?v=QghjaS0WQQU"
25
+
26
  abs_video_path = yt.streams.filter(progressive=True, file_extension='mp4').order_by('resolution').desc().first().download(filename='download.mp4', output_path='movies/')
27
  print("Success download video")
28
  print(abs_video_path)