1lint commited on
Commit
5d1198f
·
1 Parent(s): 517cc63

add error msg for video length

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. header.md +1 -2
app.py CHANGED
@@ -46,10 +46,10 @@ def download_yt_url(url: str, filename: str = "%(title)s", format = 'mp4'):
46
 
47
  # restrict video length so one user doesn't take up all our bandwidth
48
  def video_filter(info):
49
- MAX_DURATION = 5*60
50
  duration = info.get('duration')
51
  if duration and duration > MAX_DURATION:
52
- return f'The video is too long at {duration}s, choose a video less than {MAX_DURATION}s'
53
 
54
  ydl_opts = {
55
  'match_filter': video_filter,
 
46
 
47
  # restrict video length so one user doesn't take up all our bandwidth
48
  def video_filter(info):
49
+ MAX_DURATION = 10*60
50
  duration = info.get('duration')
51
  if duration and duration > MAX_DURATION:
52
+ raise Exception(f'The video is too long at {duration}s, choose a video less than {MAX_DURATION}s')
53
 
54
  ydl_opts = {
55
  'match_filter': video_filter,
header.md CHANGED
@@ -1,4 +1,3 @@
1
  # <p style="text-align: center;">Acapellify: Extract vocals from Youtube Video URL</p>
2
  ### <p style="text-align: center;">Based on https://gradio.app/fastapi-app-with-the-gradio-client/</p>
3
- ### <p style="text-align: center;">Backend uses gradio client linked to abidlabs/music-separation</p>
4
- ### <p style="text-align: center;">Free to Use (courtesy of HF Spaces)</p>
 
1
  # <p style="text-align: center;">Acapellify: Extract vocals from Youtube Video URL</p>
2
  ### <p style="text-align: center;">Based on https://gradio.app/fastapi-app-with-the-gradio-client/</p>
3
+ ### <p style="text-align: center;">Hosted on HF Spaces, backend uses gradio client linked to abidlabs/music-separation</p>