Joshua Lochner commited on
Commit
df05196
1 Parent(s): 94ad7ba

Fix YouTube ID regex

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -35,7 +35,7 @@ st.set_page_config(
35
 
36
 
37
  YT_VIDEO_REGEX = r'''(?x)^
38
- (
39
  # http(s):// or protocol-independent URL
40
  (?:https?://|//)
41
  (?:(?:(?:(?:\w+\.)?[yY][oO][uU][tT][uU][bB][eE](?:-nocookie|kids)?\.com/|
@@ -169,7 +169,7 @@ def main():
169
  # Load prediction function
170
  predict = load_predict(model_id)
171
 
172
- video_input = st.text_input('Video URL/ID:') # , placeholder='e.g., axtQvkSpoto'
173
 
174
  categories = st.multiselect('Categories:',
175
  CATGEGORY_OPTIONS.keys(),
@@ -181,9 +181,7 @@ def main():
181
  confidence_threshold = st.slider(
182
  'Confidence Threshold (%):', min_value=0, max_value=100)
183
 
184
-
185
-
186
- if len(video_input) == 0: # No input, do not continue
187
  return
188
 
189
  video_id = regex_search(video_input, YT_VIDEO_REGEX)
 
35
 
36
 
37
  YT_VIDEO_REGEX = r'''(?x)^
38
+ (?:
39
  # http(s):// or protocol-independent URL
40
  (?:https?://|//)
41
  (?:(?:(?:(?:\w+\.)?[yY][oO][uU][tT][uU][bB][eE](?:-nocookie|kids)?\.com/|
 
169
  # Load prediction function
170
  predict = load_predict(model_id)
171
 
172
+ video_input = st.text_input('Video URL/ID:')
173
 
174
  categories = st.multiselect('Categories:',
175
  CATGEGORY_OPTIONS.keys(),
 
181
  confidence_threshold = st.slider(
182
  'Confidence Threshold (%):', min_value=0, max_value=100)
183
 
184
+ if len(video_input) == 0: # No input, do not continue
 
 
185
  return
186
 
187
  video_id = regex_search(video_input, YT_VIDEO_REGEX)