David Chuan-En Lin commited on
Commit
453ac06
1 Parent(s): 4e96569

limit video length

Browse files
Files changed (1) hide show
  1. whichframe.py +3 -0
whichframe.py CHANGED
@@ -19,6 +19,9 @@ def fetch_video(url):
19
  yt = YouTube(url)
20
  streams = yt.streams.filter(adaptive=True, subtype="mp4", resolution="360p", only_video=True)
21
  length = yt.length
 
 
 
22
  video = streams[0]
23
  return video, video.url
24
 
19
  yt = YouTube(url)
20
  streams = yt.streams.filter(adaptive=True, subtype="mp4", resolution="360p", only_video=True)
21
  length = yt.length
22
+ if length >= 300:
23
+ st.error("Please find a YouTube video shorter than 5 minutes. Sorry about this, the server capacity is limited for the time being.")
24
+ st.stop()
25
  video = streams[0]
26
  return video, video.url
27