Spaces:
Runtime error
Runtime error
Added Default API key
Browse files
app.py
CHANGED
|
@@ -48,7 +48,7 @@ st.markdown(link,unsafe_allow_html=True)
|
|
| 48 |
|
| 49 |
with st.form("my_form"):
|
| 50 |
st.write('Enter Youtube API key( Will not be stored )')
|
| 51 |
-
youtube_api_key = st.text_input('API key')
|
| 52 |
st.write('Enter Youtube Video ID/ Video Link')
|
| 53 |
youtube_video_id = st.text_input('Video')
|
| 54 |
submitted = st.form_submit_button("Submit")
|
|
@@ -56,11 +56,11 @@ with st.form("my_form"):
|
|
| 56 |
|
| 57 |
if submitted:
|
| 58 |
youtube_video_id = find_video_id(youtube_video_id)
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
youtube_api_key= os.environ["youtube_api"]
|
| 63 |
-
st.write("API here",os.environ["youtube_api"],len(os.environ["youtube_api"]))
|
| 64 |
df = extract_comments_from_video(youtube_video_id,youtube_api_key)
|
| 65 |
|
| 66 |
if len(df) > 0:
|
|
|
|
| 48 |
|
| 49 |
with st.form("my_form"):
|
| 50 |
st.write('Enter Youtube API key( Will not be stored )')
|
| 51 |
+
youtube_api_key = st.text_input('API key',placeholder='For less frequent use,Keep this field empty')
|
| 52 |
st.write('Enter Youtube Video ID/ Video Link')
|
| 53 |
youtube_video_id = st.text_input('Video')
|
| 54 |
submitted = st.form_submit_button("Submit")
|
|
|
|
| 56 |
|
| 57 |
if submitted:
|
| 58 |
youtube_video_id = find_video_id(youtube_video_id)
|
| 59 |
+
|
| 60 |
+
if len(youtube_api_key)==0:
|
| 61 |
+
st.warning('Using Default API,Please create your own for frequent use', icon="⚠️")
|
| 62 |
youtube_api_key= os.environ["youtube_api"]
|
| 63 |
+
#st.write("API here",os.environ["youtube_api"],len(os.environ["youtube_api"]))
|
| 64 |
df = extract_comments_from_video(youtube_video_id,youtube_api_key)
|
| 65 |
|
| 66 |
if len(df) > 0:
|